Repository navigation
Support integer in-place multiplication and preserve empty cycle keys - #110
Closed
nawaaaaaAaar wants to merge 2 commits into
Closed
nawaaaaaAaar wants to merge 2 commits into
nawaaaaaAaar wants to merge 2 commits into
Conversation
Member
|
This violates our AI policy. |
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.
Summary
Restore the documented integer form of in-place multiplication (
styles *= n) while preserving the existing Cycler-product behavior.Ordinary integer multiplication works for positive counts, but the in-place form raises
TypeError. Testing zero/negative counts exposed a prerequisite: composing/copying empty cycles loses their declared keys or raisesStopIteration. Preserve key metadata independently of the first generated row and reuse ordinary multiplication for the in-place operation, retaining object identity.Before/after
Unchanged upstream:
d1737eb0a42bd451e8770cef245ebe60ebb36bfc.The final regression selection yields 19 failures and two passes before the implementation change, then 21 passes afterward. Coverage includes base/summed/product cycles, integer counts -2/0/1/2/3, object identity, equality, key metadata, representation and by-key values.
Verification
python -m build --no-isolation.git diff --checkpasses.Assistance
Prepared using AI assistance for investigation, implementation and tests. No personal account-owner review, provenance attestation or maintainer acceptance is asserted. This is one coherent multiplication correctness change, including the empty-result prerequisite, not separate PRs for the same operation.
Fixes #109.