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

An alternative fix for a union-like literal string #17639

Merged
merged 3 commits into from
Aug 11, 2024

Conversation

ilevkivskyi
Copy link
Member

It is unfortunate to add two extra slots to a common type (and I guess this is why it was rejected in the original PR), but all other alternatives I tried are hacky and/or dangerous. So, this is a price to pay for introducing a new type syntax.

cc @JelleZijlstra

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Aug 4, 2024

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi
Copy link
Member Author

Btw, yet another crash likely caused by the original PR #17548

@ilevkivskyi
Copy link
Member Author

IIUC there are no objections, so I am merging this PR.

@ilevkivskyi ilevkivskyi merged commit 3da16bd into python:master Aug 11, 2024
19 checks passed
@ilevkivskyi ilevkivskyi deleted the alt-fix-raw-literal branch August 11, 2024 21:26
mr-c pushed a commit to mr-c/mypy that referenced this pull request Aug 14, 2024
It is unfortunate to add two extra slots to a common type (and I guess
this is why it was rejected in the original PR), but all other
alternatives I tried are hacky and/or dangerous. So, this is a price to
pay for introducing a new type syntax.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@mr-c mr-c mentioned this pull request Aug 14, 2024
md384 pushed a commit to md384/mypy that referenced this pull request Aug 14, 2024
It is unfortunate to add two extra slots to a common type (and I guess
this is why it was rejected in the original PR), but all other
alternatives I tried are hacky and/or dangerous. So, this is a price to
pay for introducing a new type syntax.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 3da16bd)
hauntsaninja pushed a commit that referenced this pull request Aug 24, 2024
It is unfortunate to add two extra slots to a common type (and I guess
this is why it was rejected in the original PR), but all other
alternatives I tried are hacky and/or dangerous. So, this is a price to
pay for introducing a new type syntax.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 3da16bd)
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.

1 participant