Skip to content

Add NotImplementedType and tighten NotImplemented type #2929

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

Closed
llchan opened this issue Apr 22, 2019 · 3 comments
Closed

Add NotImplementedType and tighten NotImplemented type #2929

llchan opened this issue Apr 22, 2019 · 3 comments

Comments

@llchan
Copy link
Contributor

llchan commented Apr 22, 2019

We curently have

NotImplemented: Any

but type(NotImplemented) is actually a built-in NotImplementedType. As far as I can tell, NotImplementedType is not exposed anywhere in PY3 at static analysis time. We should add that and also tighten the type of NotImplemented so that we can type special methods more precisely. Otherwise it's difficult to distinguish between a special method that truly returns anything and one that always returns NotImplemented.

@llchan llchan changed the title Add NotImplementedType and tighten NotImpelement type Add NotImplementedType and tighten NotImplemented type Apr 22, 2019
@JelleZijlstra
Copy link
Member

The current Any type is intentional and changing it is problematic; see Guido's comments in python/mypy#6710. As the discussion there makes clear, it's not clear that the changes proposed in this issue are going to be net positives.

@llchan
Copy link
Contributor Author

llchan commented Apr 23, 2019

Yeah, this was ticket was filed before the responses in the other ticket indicated that this was intentional. If you prefer to close this ticket and re-open if/when it becomes relevant again, feel free to do so.

@srittau
Copy link
Collaborator

srittau commented Jun 5, 2019

I am going to close this for now. Thanks!

@srittau srittau closed this as completed Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants