You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The i3ipc.aio.connection.Con subclass overrides the command and command_children methods, but nothing else. All the find_* methods are untouched, and their type hints state: -> List['Con']. This means that even if you're in an AIO context, any type checker or language server will think the find_* methods return regular (non-AIO) containers. Any awaits on those containers will generate errors:
The
i3ipc.aio.connection.Con
subclass overrides thecommand
andcommand_children
methods, but nothing else. All thefind_*
methods are untouched, and their type hints state:-> List['Con']
. This means that even if you're in an AIO context, any type checker or language server will think thefind_*
methods return regular (non-AIO) containers. Anyawait
s on those containers will generate errors:This issue is discussed in this PEP-0673: https://www.python.org/dev/peps/pep-0673/
It seems like Python 3.11 will include proper syntax for this:
-> Self
. However, for now, the "correct" workaround is to use a bound type variable:This will cause the
find_*
methods on the AIO subclass to return instances of the AIO subclass rather than the parent class.The text was updated successfully, but these errors were encountered: