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 Live class's __enter__ method has an improperly annotated return type.
The method returns "Live", which causes improper type information when using context managers on subclasses of Live
In the example below, the live object returned by the context manager would be typed as an instance of Live instead of CustomLive by most type checkers.
AetherBreaker
changed the title
[BUG] [TYPING] Live class __enter__ method improperly returns "Live" instead of typing.Self
[BUG] [TYPING] Live class __enter__ method return type improperly annotated as "Live" instead of typing.Self
Feb 28, 2025
Describe the bug
The Live class's __enter__ method has an improperly annotated return type.
The method returns "Live", which causes improper type information when using context managers on subclasses of Live
In the example below, the live object returned by the context manager would be typed as an instance of Live instead of CustomLive by most type checkers.
Suggested Fix
Replace the return type of the __enter__ method with typing.Self
The text was updated successfully, but these errors were encountered: