Skip to content

Conversation

Akuli
Copy link
Collaborator

@Akuli Akuli commented May 6, 2021

According to the comments, _importlib_modulespec exists "for circular import reasons". But in general, circular imports should be fine in .pyi files.

Copy link
Collaborator

@srittau srittau left a 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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: According to CONTRIBUTING, this should probably be called _SupportsLoadModule, although in this case, _LoaderProtocol also is a good name.

Copy link
Collaborator

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.

@Akuli Akuli marked this pull request as ready for review May 6, 2021 09:59
@Akuli
Copy link
Collaborator Author

Akuli commented May 6, 2021

@rchen152 I think the CI failure is a bug in pytype: https://github.com/python/typeshed/runs/2517175044

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

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
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

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)

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

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)

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

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)

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

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)

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

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)

@Akuli Akuli merged commit e66b7fa into python:master May 6, 2021
@Akuli Akuli deleted the no-import-cycle-hack branch May 6, 2021 14:13
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2021

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)

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

Successfully merging this pull request may close these issues.

3 participants