Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Dec 19, 2025

If a is an integer, the sign of a is discarded in the C source code. Clarify this behavior to prevent foot guns, where a common use case might naively assume that flipping the sign will produce different sequences (e.g. for a train/test split of a synthetic data generator in machine learning).
(cherry picked from commit 610aabf)

Co-authored-by: Andrej andrej.karpathy@gmail.com
Co-authored-by: Adam Turner 9087854+AA-Turner@users.noreply.github.com


📚 Documentation preview 📚: https://cpython-previews--142970.org.readthedocs.build/

…f an integer input (pythonGH-142483)

If *a* is an integer, the sign of *a* is discarded in the C source code. Clarify this behavior to prevent foot guns, where a common use case might naively assume that flipping the sign will produce different sequences (e.g. for a train/test split of a synthetic data generator in machine learning).
(cherry picked from commit 610aabf)

Co-authored-by: Andrej <andrej.karpathy@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Dec 19, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Dec 19, 2025
@hauntsaninja hauntsaninja enabled auto-merge (squash) December 19, 2025 08:30
@hauntsaninja hauntsaninja merged commit b46ce52 into python:3.14 Dec 19, 2025
38 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants