Skip to content
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

stdtypes.rst should refer to sys.float_info #53707

Closed
ygale mannequin opened this issue Aug 3, 2010 · 6 comments
Closed

stdtypes.rst should refer to sys.float_info #53707

ygale mannequin opened this issue Aug 3, 2010 · 6 comments
Assignees
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@ygale
Copy link
Mannequin

ygale mannequin commented Aug 3, 2010

BPO 9498
Nosy @birkenfeld, @mdickinson
Files
  • stdtypes_float_info.patch: Add reference to sys.float_info to stdtypes.rst for 3.2
  • stdtypes_float_info_2.patch: Corrected patch to add reference to sys.float_info and keep a qualified mention of C doubles.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/mdickinson'
    closed_at = <Date 2010-08-04.18:49:59.262>
    created_at = <Date 2010-08-03.20:37:32.094>
    labels = ['type-bug', 'docs']
    title = 'stdtypes.rst should refer to sys.float_info'
    updated_at = <Date 2010-08-04.18:49:59.260>
    user = 'https://bugs.python.org/ygale'

    bugs.python.org fields:

    activity = <Date 2010-08-04.18:49:59.260>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2010-08-04.18:49:59.262>
    closer = 'mark.dickinson'
    components = ['Documentation']
    creation = <Date 2010-08-03.20:37:32.094>
    creator = 'ygale'
    dependencies = []
    files = ['18353', '18355']
    hgrepos = []
    issue_num = 9498
    keywords = ['patch']
    message_count = 6.0
    messages = ['112670', '112671', '112674', '112682', '112683', '112859']
    nosy_count = 4.0
    nosy_names = ['georg.brandl', 'mark.dickinson', 'ygale', 'docs@python']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue9498'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @ygale
    Copy link
    Mannequin Author

    ygale mannequin commented Aug 3, 2010

    Library docs section 5.4 "Numeric Types" states about floating point numbers that "all bets on their precision are off unless you happen to know the machine you are working with."

    That has not been true since Python 2.6, when sys.float_info was added. There should be a reference to that here instead of that statement.

    In addition, that paragraph mentions that both float and complex are "implemented using double in C". There is no longer any special reason to mention how those are implemented in C, any more than anything else in Python. Everything you need to know about the implementation is in sys.float_info. (Well, almost everything, see bpo-9192.)

    The attached patch is for the Python 3.2 branch.

    @ygale ygale mannequin assigned docspython Aug 3, 2010
    @ygale ygale mannequin added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Aug 3, 2010
    @birkenfeld
    Copy link
    Member

    Mark, does this look ok to you?

    @birkenfeld birkenfeld assigned mdickinson and unassigned docspython Aug 3, 2010
    @mdickinson
    Copy link
    Member

    +1 for the reference to sys.float_info.

    I'd prefer to keep the mention of C doubles, though. You have to know what you're looking for to get this information from looking at sys.float_info.

    @ygale
    Copy link
    Mannequin Author

    ygale mannequin commented Aug 3, 2010

    It's not necessarily true for other than CPython, and it could theoretically not be true someday on some weird platform even for CPython.

    How about just adding this: "Floating point numbers are usually implemented using double in C." Then at least we're not committing ourselves to anything.

    @mdickinson
    Copy link
    Member

    it could theoretically not be true someday on some weird platform even for CPython.

    Granted. Though it would be quite a major change: the 'double' part is heavily hard-coded throughout.

    How about just adding this: "Floating point numbers are usually
    implemented using double in C." Then at least we're not committing
    ourselves to anything.

    That sounds fine to me.

    @mdickinson
    Copy link
    Member

    Thanks! Applied in revisions r83732 through r83734. (The release26-maint branch is frozen except for essential fixes, so not applying it there.)

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    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 type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants