-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
delete _importlib_modulespec #5350
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
# but expected in new code. | ||
def exec_module(self, module: types.ModuleType) -> None: ... | ||
|
||
class _LoaderProtocol(Protocol): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit
8000
: According to CONTRIBUTING
, this should probably be called _SupportsLoadModule
, although in this case, _LoaderProtocol
also is a good name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And thinking a bit more about it: Maybe we should add a ...Protocol
convention for protocols that mimic classes or abcs.
8000
@rchen152 I think the CI failure is a bug in pytype: https://github.com/python/typeshed/runs/2517175044 |
Diff from mypy_primer, showing the effect of this PR on open source code: alerta (https://github.com/alerta/alerta.git)
+ alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
- alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
|
4 similar comments
Diff from mypy_primer, showing the effect of this PR on open source code: alerta (https://github.com/alerta/alerta.git)
+ alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
- alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
|
Diff from mypy_primer, showing the effect of this PR on open source code: alerta (https://github.com/alerta/alerta.git)
+ alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
- alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
|
Diff from mypy_primer, showing the effect of this PR on open source code: alerta (https://github.com/alerta/alerta.git)
+ alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
- alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
|
Diff from mypy_primer, showing the effect of this PR on open source code: alerta (https://github.com/alerta/alerta.git)
+ alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
- alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
|
Diff from mypy_primer, showing the effect of this PR on open source code: alerta (https://github.com/alerta/alerta.git)
+ alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
- alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
|
Diff from mypy_primer, showing the effect of this PR on open source code: alerta (https://github.com/alerta/alerta.git)
+ alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
- alerta/models/alarms/isa_18_2.py:10: error: Library stubs not installed for "flask" (or incompatible with Python 3.8)
|
According to the comments,
_importlib_modulespec
exists "for circular import reasons". But in general, circular imports should be fine in.pyi
files.