Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pyee/asyncio.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# -*- coding: utf-8 -*-

from asyncio import AbstractEventLoop, ensure_future, Future, iscoroutine, wait
from typing import Any, Callable, cast, Dict, Optional, Set, Tuple
from typing import Any, Callable, cast, Dict, Optional, Self, Set, Tuple

from pyee.base import EventEmitter

Self = Any

__all__ = ["AsyncIOEventEmitter"]


Expand Down
3 changes: 1 addition & 2 deletions pyee/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
Mapping,
Optional,
overload,
Self,
Set,
Tuple,
TypeVar,
Union,
)

Self = Any


class PyeeException(Exception):
"""An exception internal to pyee. Deprecated in favor of PyeeError."""
Expand Down
4 changes: 1 addition & 3 deletions pyee/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

from concurrent.futures import Executor, Future, ThreadPoolExecutor
from types import TracebackType
from typing import Any, Callable, Dict, Optional, Tuple, Type
from typing import Any, Callable, Dict, Optional, Self, Tuple, Type

from pyee.base import EventEmitter

Self = Any

__all__ = ["ExecutorEventEmitter"]


Expand Down
6 changes: 2 additions & 4 deletions pyee/trio.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
AsyncGenerator,
Awaitable,
Callable,
cast,
Dict,
Optional,
Self,
Tuple,
Type,
)
Expand All @@ -18,8 +18,6 @@

from pyee.base import EventEmitter, PyeeError

Self = Any

__all__ = ["TrioEventEmitter"]


Expand Down Expand Up @@ -126,7 +124,7 @@ async def __aenter__(self: Self) -> "TrioEventEmitter":
self._context: Optional[AbstractAsyncContextManager["TrioEventEmitter"]] = (
self.context()
)
return await cast(Any, self._context).__aenter__()
return await self._context.__aenter__()

async def __aexit__(
self: Self,
Expand Down
7 changes: 2 additions & 5 deletions pyee/twisted.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# -*- coding: utf-8 -*-

from asyncio import iscoroutine
from typing import Any, Callable, cast, Dict, Optional, Tuple
from typing import Any, Callable, Dict, Optional, Self, Tuple

from twisted.internet.defer import Deferred, ensureDeferred
from twisted.python.failure import Failure

from pyee.base import EventEmitter, PyeeError

Self = Any


__all__ = ["TwistedEventEmitter"]


Expand Down Expand Up @@ -90,6 +87,6 @@ def _emit_handle_potential_error(self: Self, event: str, error: Any) -> None:
else:
self.emit("error", PyeeError(f"Unexpected failure object: {error}"))
else:
cast(Any, super(TwistedEventEmitter, self))._emit_handle_potential_error(
(super(TwistedEventEmitter, self))._emit_handle_potential_error(
event, error
)
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down