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

Let math.dist() accept coordinates as sequences #81872

Closed
rhettinger opened this issue Jul 27, 2019 · 3 comments
Closed

Let math.dist() accept coordinates as sequences #81872

rhettinger opened this issue Jul 27, 2019 · 3 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir

Comments

@rhettinger
Copy link
Contributor

BPO 37691
Nosy @tim-one, @rhettinger, @mdickinson
PRs
  • bpo-37691: Let math.dist() accept sequences and iterables for coordinates #14975
  • [3.8] bpo-37691: Let math.dist() accept sequences and iterables for coordinates (GH-14975) #14984
  • 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/rhettinger'
    closed_at = <Date 2019-07-27.21:27:32.563>
    created_at = <Date 2019-07-27.05:28:58.011>
    labels = ['3.8', 'library', '3.9']
    title = 'Let math.dist() accept coordinates as sequences'
    updated_at = <Date 2019-07-27.21:27:32.562>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2019-07-27.21:27:32.562>
    actor = 'rhettinger'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2019-07-27.21:27:32.563>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2019-07-27.05:28:58.011>
    creator = 'rhettinger'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37691
    keywords = ['patch']
    message_count = 3.0
    messages = ['348541', '348565', '348566']
    nosy_count = 3.0
    nosy_names = ['tim.peters', 'rhettinger', 'mark.dickinson']
    pr_nums = ['14975', '14984']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37691'
    versions = ['Python 3.8', 'Python 3.9']

    @rhettinger
    Copy link
    Contributor Author

    I did some user testing with Python 3.8 and found that math.dist() was a little restrictive in only accepting coordinates as tuples. Mostly it worked out fine except but was a little inconvenient with generalized unpacking:

    label, *coordinates = cursor.fetchone() # coordinates is a list

    Also, it would be nice to allow numpy arrays as arguments.

    @rhettinger rhettinger added 3.8 only security fixes 3.9 only security fixes labels Jul 27, 2019
    @rhettinger rhettinger self-assigned this Jul 27, 2019
    @rhettinger rhettinger added the stdlib Python modules in the Lib dir label Jul 27, 2019
    @rhettinger
    Copy link
    Contributor Author

    New changeset 6b5f1b4 by Raymond Hettinger in branch 'master':
    bpo-37691: Let math.dist() accept sequences and iterables for coordinates (GH-14975)
    6b5f1b4

    @rhettinger
    Copy link
    Contributor Author

    New changeset 76821ba by Raymond Hettinger (Miss Islington (bot)) in branch '3.8':
    bpo-37691: Let math.dist() accept sequences and iterables for coordinates (GH-14975) (GH-14984)
    76821ba

    @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
    3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant