8000 bump fractions.pyi to 3.14 by mkaraev · Pull Request #14070 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

bump fractions.pyi to 3.14 #14070

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

mkaraev
Copy link
@mkaraev mkaraev commented May 15, 2025

No description provided.

This comment has been minimized.

This comment has been minimized.

@mkaraev
Copy link
Author
mkaraev commented May 15, 2025

@sobolevn can you please take a look?

This comment has been minimized.

@mkaraev mkaraev changed the title bump fraction.py to 3.14 bump fractions.pyi to 3.14 May 15, 2025
Copy link
Member
@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update https://github.com/python/typeshed/blob/main/stdlib/%40tests/test_cases/builtins/check_pow.py when adding new __pow__ overloads. Basically, any non-None modulo values must be a type-error, see python/cpython@fcca08e#diff-39381000227588e760871a319e6b5f8e88fc03643b03a94acd2e94b942135e9b

@sobolevn
Copy link
Member

For Fraction and if sys.version_info >= (3, 14): with modulo

@mkaraev
Copy link
Author
mkaraev commented May 15, 2025

For Fraction and if sys.version_info >= (3, 14): with modulo

Thanks, I didn't get it quickly :) will add tests

@mkaraev
Copy link
Author
mkaraev commented May 15, 2025

@sobolevn, okay, but what about these tests? aren't they enough?

assert_type(pow(Fraction(), 4, None), Fraction) # pyright: ignore[reportAssertTypeFailure]
assert_type(Fraction() ** 4, Fraction)

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@mkaraev mkaraev requested a review from sobolevn May 15, 2025 10:41
@mkaraev
Copy link
Author
mkaraev commented May 15, 2025

@sobolevn and also here additional check for non-None value of modulo

pow(Fraction(), 5, 8) # type: ignore

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
0