gh-94473: Flatten arguments in tkinter.Canvas.coords() (GH-98479)

It now accepts not only "x1, y1, x2, y2, ..." and "[x1, y1, x2, y2, ...]",
but also "(x1, y1), (x2, y2), ..." and "[(x1, y1), (x2, y2), ...]".
This commit is contained in:
Serhiy Storchaka 2023-05-22 11:54:41 +03:00 committed by GitHub
parent 6fba031476
commit 9bc80dac47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 1 deletions

View file

@ -2817,7 +2817,7 @@ class Canvas(Widget, XView, YView):
def coords(self, *args):
"""Return a list of coordinates for the item given in ARGS."""
# XXX Should use _flatten on args
args = _flatten(args)
return [self.tk.getdouble(x) for x in
self.tk.splitlist(
self.tk.call((self._w, 'coords') + args))]