diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-05-22 08:54:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-22 08:54:41 (GMT) |
commit | 9bc80dac47f6d43d0bbfbf10c4cc3848b175e97f (patch) | |
tree | 880c0b929091cb922c9f864b7a58b0e4ac90838a /Lib/test/test_tkinter/test_widgets.py | |
parent | 6fba0314765d7c58a33e9859d9cd5bcc35d2fd0a (diff) | |
download | cpython-9bc80dac47f6d43d0bbfbf10c4cc3848b175e97f.zip cpython-9bc80dac47f6d43d0bbfbf10c4cc3848b175e97f.tar.gz cpython-9bc80dac47f6d43d0bbfbf10c4cc3848b175e97f.tar.bz2 |
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), ...]".
Diffstat (limited to 'Lib/test/test_tkinter/test_widgets.py')
-rw-r--r-- | Lib/test/test_tkinter/test_widgets.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_tkinter/test_widgets.py b/Lib/test/test_tkinter/test_widgets.py index b452451..76cc16e 100644 --- a/Lib/test/test_tkinter/test_widgets.py +++ b/Lib/test/test_tkinter/test_widgets.py @@ -901,6 +901,12 @@ class CanvasTest(AbstractWidgetTest, unittest.TestCase): c.coords(i, [21, 31, 41, 51, 61, 11]) self.assertEqual(c.coords(i), [21.0, 31.0, 41.0, 51.0, 61.0, 11.0]) + c.coords(i, (22, 32), (42, 52), (62, 12)) + self.assertEqual(c.coords(i), [22.0, 32.0, 42.0, 52.0, 62.0, 12.0]) + + c.coords(i, [(23, 33), (43, 53), (63, 13)]) + self.assertEqual(c.coords(i), [23.0, 33.0, 43.0, 53.0, 63.0, 13.0]) + c.coords(i, 20, 30, 60, 10) self.assertEqual(c.coords(i), [20.0, 30.0, 60.0, 10.0]) self.assertEqual(c.bbox(i), (18, 8, 62, 32)) |