Skip to content

Move Match and Pattern to re.pyi; move ContextManager protocols to contextlib.pyi#8447

Merged
srittau merged 1 commit intopython:masterfrom
AlexWaygood:re
Jul 31, 2022
Merged

Move Match and Pattern to re.pyi; move ContextManager protocols to contextlib.pyi#8447
srittau merged 1 commit intopython:masterfrom
AlexWaygood:re

Conversation

@AlexWaygood
Copy link
Member

No description provided.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/decorator.py:279: error: Module "contextlib" has no attribute "GeneratorContextManager"; maybe "_GeneratorContextManager", "_AsyncGeneratorContextManager", or "ContextManager"?
+ pyinstrument/vendor/decorator.py:279: error: Module "contextlib" has no attribute "GeneratorContextManager"; maybe "_GeneratorContextManager", "_AsyncGeneratorContextManager", or "AbstractContextManager"?

paroxython (https://github.com/laowantong/paroxython)
- paroxython/map_taxonomy.py:178: error: Argument 1 to "append" of "list" has incompatible type "Tuple[regex._regex.Pattern[str], TaxonPattern]"; expected "Tuple[typing.Pattern[Any], TaxonPattern]"
+ paroxython/map_taxonomy.py:178: error: Argument 1 to "append" of "list" has incompatible type "Tuple[regex._regex.Pattern[str], TaxonPattern]"; expected "Tuple[re.Pattern[Any], TaxonPattern]"

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/client.py:125: error: Argument 1 to "asynccontextmanager" has incompatible type "Callable[[Any], ContextManager[None]]"; expected "Callable[[Any], AsyncIterator[<nothing>]]"
+ src/prefect/client.py:125: error: Argument 1 to "asynccontextmanager" has incompatible type "Callable[[Any], AbstractContextManager[None]]"; expected "Callable[[Any], AsyncIterator[<nothing>]]"
- src/prefect/context.py:465: error: Incompatible types in assignment (expression has type "None", variable has type "ContextManager[SettingsContext]")
+ src/prefect/context.py:465: error: Incompatible types in assignment (expression has type "None", variable has type "AbstractContextManager[SettingsContext]")
- src/prefect/context.py:519: error: Incompatible types in assignment (expression has type "None", variable has type "ContextManager[PrefectObjectRegistry]")
+ src/prefect/context.py:519: error: Incompatible types in assignment (expression has type "None", variable has type "AbstractContextManager[PrefectObjectRegistry]")

@AlexWaygood AlexWaygood marked this pull request as ready for review July 30, 2022 17:42
@srittau srittau merged commit ea7bbbd into python:master Jul 31, 2022
@AlexWaygood AlexWaygood deleted the re branch July 31, 2022 13:28
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.

2 participants