Skip to content

float('infinity') should be valid #47438

Closed

Description

@mdickinson
BPO 3188
Nosy @mdickinson, @tiran
Files
  • infinity.patch
  • 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 2008-07-05.15:23:15.932>
    created_at = <Date 2008-06-24.10:47:34.248>
    labels = ['type-bug']
    title = "float('infinity') should be valid"
    updated_at = <Date 2008-07-05.15:23:15.910>
    user = 'https://github.com/mdickinson'

    bugs.python.org fields:

    activity = <Date 2008-07-05.15:23:15.910>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2008-07-05.15:23:15.932>
    closer = 'mark.dickinson'
    components = []
    creation = <Date 2008-06-24.10:47:34.248>
    creator = 'mark.dickinson'
    dependencies = []
    files = ['10716']
    hgrepos = []
    issue_num = 3188
    keywords = ['patch']
    message_count = 2.0
    messages = ['68675', '69281']
    nosy_count = 2.0
    nosy_names = ['mark.dickinson', 'christian.heimes']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue3188'
    versions = ['Python 2.6', 'Python 3.0', 'Python 2.7']

    Activity

    1. mdickinson commented on Jun 24, 2008

      @mdickinson
      MemberAuthor

      2.6 adds float('inf') and float('nan') as cross-platform ways to
      generate infinities and NaNs. The C99 standard (section 7.20.1.3,
      paragraph 3) specifies that 'infinity' (in any case, with optional
      preceding sign) should also be a valid input to strtod, and I propose
      that in Python float('infinity') should correspondingly be valid.

      Note that the IEEE 754 standard also states that 'inf' and 'infinity'
      should be valid input string representations of infinity, and Python's
      decimal module also allows both 'inf' and 'infinity'.

      A patch is attached.

      Unless I'm mistaken, this change is simple and unlikely to be
      controversial. I plan to check it in in a week or two if there's no
      feedback before then.

    2. self-assigned this
      on Jun 24, 2008
    3. mdickinson commented on Jul 5, 2008

      @mdickinson
      MemberAuthor

      Checked in, r64729.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions