PEP 673 (Self Type) tracker #6300
Copy link
Copy link
Closed
Labels
project: feature trackerTracks whether a typing feature can be used in typeshed stubsTracks whether a typing feature can be used in typeshed stubs
Description
This issue is supposed to track when we can start to use typing_extensions.Self (PEP 673) in typeshed. Support is needed in released versions of:
- PEP accepted
- mypy (Add support for Self type mypy#14041)
- pytype
- pyright (Implement proposed "Self" type microsoft/pyright#2515)
- pyre
- PyCharm (nice to have, but not required)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
project: feature trackerTracks whether a typing feature can be used in typeshed stubsTracks whether a typing feature can be used in typeshed stubs
Activity
Gobot1234 commentedon Dec 5, 2021
I've opened a PR for this to mypy python/mypy#11666 (although it's marked as a draft).
tmke8 commentedon Jan 31, 2022
PEP has been accepted: https://mail.python.org/archives/list/[email protected]/thread/J7BWL5KWOPQQK5KFWKENVLXW6UGSPTGI/
johnthagen commentedon Dec 14, 2022
PyCharm 2022.3 supports the
Selftypecj81499 commentedon Dec 15, 2022
The
mypyPR in the issue description appears to be merged. Is there something still blocked use from amypyperspective? Or does the description need to be updated?TeamSpen210 commentedon Dec 15, 2022
It's merged, but still awaiting a release.
srittau commentedon Dec 15, 2022
Once that happens, we can try start using it in typeshed. I suspect that pytype will accept it as it's quite permissive. I don't know about pyre.
tmke8 commentedon Dec 15, 2022
I can find 10 hits for
from typing_extensions import Selfin the pyre integration tests:https://github.com/facebook/pyre-check/blob/2da1844a4ae1861bf5b765a80feaf463a62d8831/source/analysis/test/integration/typeVariableTest.ml#L3593
So I'd guess that pyre support is pretty good.
johnthagen commentedon Feb 7, 2023
mypy 1.0 has released with support for
Self:srittau commentedon Feb 13, 2023
We started using this in the stdlib, and nothing exploded. I guess this means this is supported now.