Skip to content

Conversation

@srittau
Copy link
Collaborator

@srittau srittau commented Aug 14, 2021

Built-in generics not possible in type aliases

Built-in generics not possible in type aliases
@hoefling
Copy link
Contributor

@srittau it's also not possible to use PEP 604 syntax in class bases, e.g.

class c_char_p(_PointerLike, _SimpleCData[bytes | None]): ...

instead of

class c_char_p(_PointerLike, _SimpleCData[Optional[bytes]]):

@srittau
Copy link
Collaborator Author

srittau commented Aug 14, 2021

@srittau it's also not possible to use PEP 604 syntax in class bases, e.g.

Good catch, updated.

@Akuli
Copy link
Collaborator

Akuli commented Aug 14, 2021

I didn't do this in #5879, because I thought it would be easier to say "Use the new syntax", and when needed, say "mypy is still buggy, use the old syntax here" when reviewing.

@hoefling
Copy link
Contributor

FWIW, both issues with PEP 604 syntax are resolved on mypy's master, so the 0.920 / 0.1000 /whatever should obsolete the warnings.

Co-authored-by: Akuli <akuviljanen17@gmail.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
@JelleZijlstra JelleZijlstra merged commit 5f2e117 into python:master Aug 15, 2021
@srittau srittau deleted the contributing-pep-604 branch August 15, 2021 09:50
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.

4 participants