Skip to content

Commit

Permalink
Some stub fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
gresm committed Dec 14, 2024
1 parent d2e8e72 commit e86d6de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions buildconfig/stubs/pygame/event.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ from pygame import Window, constants as _c

class Event(EventLike):
type: int
__dict__: dict[str, Any]
dict: dict[str, Any] # type: ignore

@overload
def __init__(
self, type: int, dict: Optional[Dict[str, Any]] = None, **kwargs: Any
) -> None: ...
@overload
def __init__(
self, dict: Optional[dict[str, Any]] = None, **kwargs: Any
self, dict: Optional[Dict[str, Any]] = None, **kwargs: Any
) -> None: ...

def __getattribute__(self, name: str) -> Any: ...
Expand Down
5 changes: 5 additions & 0 deletions src_py/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ def __setattr__(self, name: str, value: Any):
def __delattr__(self, name: str) -> None:
del self._dict[name]

def __dir__(self):
ret = super().__dir__()
ret = (*ret, *self._dict.keys())
return ret


EventType = Event
_register_event_class(Event)
Expand Down

0 comments on commit e86d6de

Please sign in to comment.