Skip to content

Conversation

@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented May 6, 2024

@Daverball
Copy link

It might be worth considering also updating ContextManager and AsyncContextManager to match what I did in python/typeshed#11048 for AbstractContextManager and AbstractAsyncContextManager, now that you've laid the necessary groundwork for defaults in _SpecialGenericAlias.

But we can also save it for a follow-up PR, if you'd prefer that. A change in typeshed doesn't make sense until we test 3.13 to the CI.

@JelleZijlstra JelleZijlstra marked this pull request as ready for review May 6, 2024 16:55
@JelleZijlstra JelleZijlstra requested a review from AlexWaygood as a code owner May 6, 2024 16:55
@JelleZijlstra
Copy link
Member Author

@Daverball Possibly, but note that we're one day away from the feature freeze for Python 3.13. I can spend some time on it later today, but please open a separate issue first.

@AlexWaygood if you have time, could you review this PR that just adds defaults for Generator and AsyncGenerator?

@graingert
Copy link
Contributor

typing.Generator and typing.AsyncGenerator are deprecated, why are they getting new features?

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@mikeshardmind
Copy link
Contributor

mikeshardmind commented May 6, 2024

typing.Generator and typing.AsyncGenerator are deprecated, why are they getting new features?

I would hope this isn't a real blocker here. From a user standpoint, users are told collections.abc variants are meant to behave identically. (they are actually documented as a deprecated alias and not as a separate object)

Deprecated alias to collections.abc.Generator.

(https://docs.python.org/3/library/typing.html#typing.Generator)

If this deprecation results in them not being equivalent anymore, you've broken the documented idea of them being equivalent.

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
@JelleZijlstra JelleZijlstra enabled auto-merge (squash) May 6, 2024 22:04
@JelleZijlstra JelleZijlstra merged commit 8419f01 into python:main May 6, 2024
@JelleZijlstra JelleZijlstra deleted the gendef branch May 6, 2024 23:15
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
…erator (python#118648) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants