Use built-in Self type in __init__.pyi when available#114
Use built-in Self type in __init__.pyi when available#114Marco-Sulla merged 1 commit intoMarco-Sulla:masterfrom
Conversation
|
Failed for Python 3.8 - 3.10: Notice that it doesn't fail on every archs because type checking is only enabled for the primary workflow. Furthermore it doesn't fail on 3.6 - 3.7 because It's quite strange it doesn't work. Maybe it's a stupid idea, but try moving the import at the same level of the other imports, just before |
Starting in python 3.11 the typing module has a Self type that does the equivalent of the SelfT typevar. This integrate a bit better with type checkers.
|
Thanks for the insight, it seems not to work well with |
|
It's odd. It works for |
|
Anyway, ty for the improvement. |
Starting in python 3.11 the typing module has a
Selftype that does the equivalent of theSelfTtypevar.This integrate a bit better with type checkers.
Seen with
tyin class inheritance (it is essentially a problem intybut is a sounds like a good occasion to make the update):