Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 673 (Self Type) tracker #6300

Closed
4 of 6 tasks
srittau opened this issue Nov 15, 2021 · 9 comments
Closed
4 of 6 tasks

PEP 673 (Self Type) tracker #6300

srittau opened this issue Nov 15, 2021 · 9 comments
Labels
project: feature tracker Tracks whether a typing feature can be used in typeshed stubs

Comments

@srittau
Copy link
Collaborator

srittau commented Nov 15, 2021

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:

@srittau srittau added the project: feature tracker Tracks whether a typing feature can be used in typeshed stubs label Nov 15, 2021
@Gobot1234
Copy link
Contributor

I've opened a PR for this to mypy python/mypy#11666 (although it's marked as a draft).

@tmke8
Copy link
Contributor

tmke8 commented Jan 31, 2022

PEP has been accepted: https://mail.python.org/archives/list/typing-sig@python.org/thread/J7BWL5KWOPQQK5KFWKENVLXW6UGSPTGI/

@johnthagen
Copy link
Contributor

PyCharm 2022.3 supports the Self type

@cj81499
Copy link
Contributor

cj81499 commented Dec 15, 2022

The mypy PR in the issue description appears to be merged. Is there something still blocked use from a mypy perspective? Or does the description need to be updated?

@TeamSpen210
Copy link
Contributor

It's merged, but still awaiting a release.

@srittau
Copy link
Collaborator Author

srittau commented 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
Copy link
Contributor

tmke8 commented Dec 15, 2022

I can find 10 hits for from typing_extensions import Self in 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
Copy link
Contributor

mypy 1.0 has released with support for Self:

@srittau
Copy link
Collaborator Author

srittau commented Feb 13, 2023

We started using this in the stdlib, and nothing exploded. I guess this means this is supported now.

@srittau srittau closed this as completed Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: feature tracker Tracks whether a typing feature can be used in typeshed stubs
Projects
None yet
Development

No branches or pull requests

6 participants