This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Let math.dist() accept coordinates as sequences
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: mark.dickinson, rhettinger, tim.peters
Priority: normal Keywords: patch

Created on 2019-07-27 05:28 by rhettinger, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 14975 merged rhettinger, 2019-07-27 05:37
PR 14984 merged miss-islington, 2019-07-27 21:04
Messages (3)
msg348541 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-07-27 05:28
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.
msg348565 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-07-27 21:04
New changeset 6b5f1b496f0b20144592b640b9c975df43a29eb0 by Raymond Hettinger in branch 'master':
bpo-37691: Let math.dist() accept sequences and iterables for coordinates (GH-14975)
https://github.com/python/cpython/commit/6b5f1b496f0b20144592b640b9c975df43a29eb0
msg348566 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-07-27 21:27
New changeset 76821bab9cb77fa7f847e66f8b2309ca30546c7f 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)
https://github.com/python/cpython/commit/76821bab9cb77fa7f847e66f8b2309ca30546c7f
History
Date User Action Args
2022-04-11 14:59:18adminsetgithub: 81872
2019-07-27 21:27:32rhettingersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-07-27 21:27:04rhettingersetmessages: + msg348566
2019-07-27 21:04:45rhettingersetmessages: + msg348565
2019-07-27 21:04:43miss-islingtonsetpull_requests: + pull_request14751
2019-07-27 05:37:15rhettingersetkeywords: + patch
stage: patch review
pull_requests: + pull_request14744
2019-07-27 05:28:58rhettingercreate