mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
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:
parent
6fba031476
commit
9bc80dac47
4 changed files with 21 additions and 1 deletions
|
@ -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))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue