typing: complete type annotations in ntheory/partitions_.py#29865
Open
717986230 wants to merge 1 commit into
Open
typing: complete type annotations in ntheory/partitions_.py#29865717986230 wants to merge 1 commit into
717986230 wants to merge 1 commit into
Conversation
|
✅ Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes.
Click here to see the pull request description that was parsed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References to other Issues or PRs
Issue: #28806
Brief description of what is fixed or changed
Adds the missing type annotations in
sympy/ntheory/partitions_.py:_pre() -> None, with module-level declarations_factor: list[int]and_totient: list[int](annotation only, so the'_factor' not in globals()check in_partitionkeeps working)_a(n: int, k: int, prec: int) -> MPF_TUP_d(n: int, j: int, prec: int, sq23pi: MPF_TUP, sqrt8: MPF_TUP) -> MPF_TUP; the local rebindingj = from_int(j)was renamed tojmso the parameter keeps a single type_partition_rec:prev: list[int]_M(n: int, N: int) -> floatnpartitions(n: int, verbose: bool = False) -> IntegerMPF_TUPis the existing alias fromsympy.core.evalf(raw mpmath mpf tuple), imported underTYPE_CHECKING.Verified locally:
mypy sympyreports no new errors (only the 2 pre-existingno-redeferrors insympy/__init__.py, also present on master),pytest sympy/ntheory/tests/test_partitions.pypasses, and_partition(100) == 190569292.Other comments
Typing-only change, no behavior change intended.
AI Generation Disclosure
This PR (code and description) was prepared with Claude Code (Anthropic), operated by me. All changed lines in
sympy/ntheory/partitions_.pywere AI-generated and then verified locally with mypy and the test suite as described above.NO ENTRY