Skip to content
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

CONTRIBUTING: Use PEP 604 syntax #5925

Merged
merged 4 commits into from
Aug 15, 2021

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.

CONTRIBUTING.md Outdated Show resolved Hide resolved
@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.

CONTRIBUTING.md Outdated Show resolved Hide resolved
@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