Skip to content

bpo-39416: Document some restrictions on the default string representations of numeric classes #18111

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

Merged
merged 4 commits into from
Oct 21, 2020

Conversation

kpinc
Copy link
Contributor

@kpinc kpinc commented Jan 22, 2020

bpo-39416: Document string representations of the Numeric classes

This is a change to the specification of the Python language.

The idea here is to put sane minimal limits on the Python language's default
representations of its Numeric classes. That way "Marty's Robotic Massage Parlor
and Python Interpreter" implementation of Python won't do anything too
crazy.

Some discussion in the email thread:
Subject: Documenting Python's float.str()
https://mail.python.org/archives/list/[email protected]/thread/FV22TKT3S2Q3P7PNN6MCXI6IX3HRRNAL/

https://bugs.python.org/issue39416

Automerge-Triggered-By: GH:merwok

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@kpinc

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Jan 22, 2020
@kpinc kpinc changed the title Restrict Python's Numeric classes default external representations bpo-39416: Restrict Python's Numeric classes default external representations Jan 22, 2020
@kpinc
Copy link
Contributor Author

kpinc commented Jan 22, 2020

Note that the "when possible" in "The representation is in base 10, when possible."
is because of things like NaN, inf, etc.

@merwok
Copy link
Member

merwok commented Jan 22, 2020

You can use this web app to add a NEWS entry: https://blurb-it.herokuapp.com/

@kpinc
Copy link
Contributor Author

kpinc commented Jan 22, 2020

You can use this web app to add a NEWS entry: https://blurb-it.herokuapp.com/

Thanks. Done.

@aeros aeros requested a review from mdickinson January 22, 2020 09:09
@merwok merwok changed the title bpo-39416: Restrict Python's Numeric classes default external representations bpo-39416: restrict numeric classes default external representations Jan 22, 2020
@merwok merwok closed this Jan 22, 2020
@merwok merwok reopened this Jan 22, 2020
@merwok
Copy link
Member

merwok commented Jan 22, 2020

Sorry, clicked on the close button by mistake!

I edited the title to remove redundant Python and change Numeric (a specific ABC) to numeric (a more general concept). From the PR description, I get that the goal here is to change the language doc, not to change any existing code, so I would suggest to edit the title to match the wording used in the news entry.

@kpinc kpinc changed the title bpo-39416: restrict numeric classes default external representations bpo-39416: Document some restrictions on the default string representations of numeric classes Jan 22, 2020
@kpinc
Copy link
Contributor Author

kpinc commented Jan 22, 2020

Sorry, clicked on the close button by mistake!

And here I thought you were making my life simpler. ;-)

From the PR description, I get that the goal here is to change the language doc, not to change any existing code, so I would suggest to edit the title to match the wording used in the news entry.

Done.

@kpinc
Copy link
Contributor Author

kpinc commented Oct 20, 2020 via email

@merwok
Copy link
Member

merwok commented Oct 20, 2020

Change looks good to me. @ericvsmith would you mind giving a +1? You were on the mailing-list thread where some people expressed concern about not guaranteeing too much here.

Copy link
Member

@ericvsmith ericvsmith left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@miss-islington miss-islington merged commit c60394c into python:master Oct 21, 2020
@miss-islington
Copy link
Contributor

Thanks @kpinc for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 21, 2020
…ations of numeric classes (pythonGH-18111)

[bpo-39416](): Document string representations of the Numeric classes

This is a change to the specification of the Python language.

The idea here is to put sane minimal limits on the Python language's default
representations of its Numeric classes.  That way "Marty's Robotic Massage Parlor
and Python Interpreter" implementation of Python won't do anything too
crazy.

Some discussion in the email thread:
Subject: Documenting Python's float.__str__()
https://mail.python.org/archives/list/[email protected]/thread/FV22TKT3S2Q3P7PNN6MCXI6IX3HRRNAL/
(cherry picked from commit c60394c)

Co-authored-by: kpinc <[email protected]>
@bedevere-bot
Copy link

GH-22860 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Oct 21, 2020
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 21, 2020
…ations of numeric classes (pythonGH-18111)

[bpo-39416](): Document string representations of the Numeric classes

This is a change to the specification of the Python language.

The idea here is to put sane minimal limits on the Python language's default
representations of its Numeric classes.  That way "Marty's Robotic Massage Parlor
and Python Interpreter" implementation of Python won't do anything too
crazy.

Some discussion in the email thread:
Subject: Documenting Python's float.__str__()
https://mail.python.org/archives/list/[email protected]/thread/FV22TKT3S2Q3P7PNN6MCXI6IX3HRRNAL/
(cherry picked from commit c60394c)

Co-authored-by: kpinc <[email protected]>
@bedevere-bot
Copy link

GH-22861 is a backport of this pull request to the 3.8 branch.

@@ -182,6 +182,24 @@ Ellipsis
related to mathematical numbers, but subject to the limitations of numerical
representation in computers.

The string representations of the Numeric classes, computed by
Copy link
Member

Choose a reason for hiding this comment

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

Ah, this should have been changed to numeric too, but that’s very minor so I will leave it and merge the backport PRs as is.

miss-islington added a commit that referenced this pull request Oct 21, 2020
…resentations of numeric classes (GH-18111) (GH-22860)

[[bpo-39416]()](): Document string representations of the Numeric classes

This is a change to the specification of the Python language.

The idea here is to put sane minimal limits on the Python language's default
representations of its Numeric classes.  That way "Marty's Robotic Massage Parlor
and Python Interpreter" implementation of Python won't do anything too
crazy.

Some discussion in the email thread:
Subject: Documenting Python's float.__str__()
https://mail.python.org/archives/list/[email protected]/thread/FV22TKT3S2Q3P7PNN6MCXI6IX3HRRNAL/
(cherry picked from commit c60394c)


Co-authored-by: kpinc <[email protected]>

Automerge-Triggered-By: GH:merwok
miss-islington added a commit that referenced this pull request Oct 21, 2020
…resentations of numeric classes (GH-18111) (GH-22861)

[[bpo-39416]()](): Document string representations of the Numeric classes

This is a change to the specification of the Python language.

The idea here is to put sane minimal limits on the Python language's default
representations of its Numeric classes.  That way "Marty's Robotic Massage Parlor
and Python Interpreter" implementation of Python won't do anything too
crazy.

Some discussion in the email thread:
Subject: Documenting Python's float.__str__()
https://mail.python.org/archives/list/[email protected]/thread/FV22TKT3S2Q3P7PNN6MCXI6IX3HRRNAL/
(cherry picked from commit c60394c)


Co-authored-by: kpinc <[email protected]>

Automerge-Triggered-By: GH:merwok
@kpinc
Copy link
Contributor Author

kpinc commented Oct 21, 2020 via email

@ericvsmith
Copy link
Member

How do you want me to approach fixing this? Should I submit a new PR? Is it not worth the time to fix??

I think a new PR. You don't need an issue. Mention it here and someone will approve it.

@kpinc
Copy link
Contributor Author

kpinc commented Oct 21, 2020 via email

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…ations of numeric classes (pythonGH-18111)

[bpo-39416](): Document string representations of the Numeric classes

This is a change to the specification of the Python language.

The idea here is to put sane minimal limits on the Python language's default
representations of its Numeric classes.  That way "Marty's Robotic Massage Parlor
and Python Interpreter" implementation of Python won't do anything too
crazy.

Some discussion in the email thread:
Subject: Documenting Python's float.__str__()
https://mail.python.org/archives/list/[email protected]/thread/FV22TKT3S2Q3P7PNN6MCXI6IX3HRRNAL/
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants