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
# Actually the type of Ellipsis is <type 'ellipsis'>, but since it's
# not exposed anywhere under that name, we make it private here.
class ellipsis: ...
Ellipsis: ellipsis
However I do not see how this ellipsis does not leak. Wouldn't it be better to rename ellipsis to _ellipsis or import it from somewhere and not export it again?
You're probably right, but I think mypy depends internally on the object being available under this name, so it might be fairly complicated to fix. (The same goes for builtins.function and builtins.module, which don't exist at runtime either.)
That's why I didn't patch it. #2999 is also from me.
My opinion is this: We should get closer to what Python actually does. Mypy is not the only typeshed user and is probably also not the biggest one in terms of user numbers.
I agree that we should work towards a fix, but currently mypy and typeshed are closely tied together and we can't make changes that will break mypy. This should probably be brought up in mypy's issue tracker of there isn't an issue already.
typeshed are closely tied together and we can't make changes that will break mypy
It's a bit unfortunate that the CI's are circular (both depend on each other). However other than that, typeshed could depend on an older version of typeshed.
In Python 3.10, there is now types.EllipsisType, the type of Ellispsis. We should add this to typeshed so we can change the type of Ellipsis to that (at least in 3.10+). Do we need to change mypy for this as well?
Activity
JelleZijlstra commentedon Jan 2, 2020
You're probably right, but I think mypy depends internally on the object being available under this name, so it might be fairly complicated to fix. (The same goes for
builtins.functionandbuiltins.module, which don't exist at runtime either.)davidhalter commentedon Jan 2, 2020
That's why I didn't patch it. #2999 is also from me.
My opinion is this: We should get closer to what Python actually does. Mypy is not the only typeshed user and is probably also not the biggest one in terms of user numbers.
srittau commentedon Jan 5, 2020
I agree that we should work towards a fix, but currently mypy and typeshed are closely tied together and we can't make changes that will break mypy. This should probably be brought up in mypy's issue tracker of there isn't an issue already.
davidhalter commentedon Jan 5, 2020
Opened python/mypy#8240. Hopefully that helps.
It's a bit unfortunate that the CI's are circular (both depend on each other). However other than that, typeshed could depend on an older version of typeshed.
gvanrossum commentedon Nov 23, 2020
In Python 3.10, there is now
types.EllipsisType, the type ofEllispsis. We should add this to typeshed so we can change the type ofEllipsisto that (at least in 3.10+). Do we need to change mypy for this as well?References: https://bugs.python.org/issue41810, python/cpython#22336, python/typing#684 (comment)
AlexWaygood commentedon Jun 12, 2022
Closing as we now have #7580, and I don't think we need both issues to be open when they're about the same thing.