Skip to content

Commit 5468f4f

Browse files
committed
Merged revisions 86697 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86697 | alexander.belopolsky | 2010-11-22 14:40:51 -0500 (Mon, 22 Nov 2010) | 1 line Issue #6878: Fixed return type of tkinter methods documented to return lists. ........
1 parent 72d5a9d commit 5468f4f

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

Lib/tkinter/__init__.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ def trace_vdelete(self, mode, cbname):
216216
self._master.deletecommand(cbname)
217217
def trace_vinfo(self):
218218
"""Return all trace callback information."""
219-
return map(self._tk.split, self._tk.splitlist(
220-
self._tk.call("trace", "vinfo", self._name)))
219+
return [self._tk.split(x) for x in self._tk.splitlist(
220+
self._tk.call("trace", "vinfo", self._name))]
221221
def __eq__(self, other):
222222
"""Comparison for equality (==).
223223
@@ -855,7 +855,7 @@ def winfo_visualsavailable(self, includeids=0):
855855
includeids and 'includeids' or None))
856856
if isinstance(data, str):
857857
data = [self.tk.split(data)]
858-
return map(self.__winfo_parseitem, data)
858+
return [self.__winfo_parseitem(x) for x in data]
859859
def __winfo_parseitem(self, t):
860860
"""Internal function."""
861861
return t[:1] + tuple(map(self.__winfo_getint, t[1:]))
@@ -1200,8 +1200,8 @@ def __setitem__(self, key, value):
12001200
self.configure({key: value})
12011201
def keys(self):
12021202
"""Return a list of all resource names of this widget."""
1203-
return map(lambda x: x[0][1:],
1204-
self.tk.split(self.tk.call(self._w, 'configure')))
1203+
return [x[0][1:] for x in
1204+
self.tk.split(self.tk.call(self._w, 'configure'))]
12051205
def __str__(self):
12061206
"""Return the window path name of this widget."""
12071207
return self._w
@@ -1223,18 +1223,18 @@ def pack_propagate(self, flag=_noarg_):
12231223
def pack_slaves(self):
12241224
"""Return a list of all slaves of this widget
12251225
in its packing order."""
1226-
return map(self._nametowidget,
1227-
self.tk.splitlist(
1228-
self.tk.call('pack', 'slaves', self._w)))
1226+
return [self._nametowidget(x) for x in
1227+
self.tk.splitlist(
1228+
self.tk.call('pack', 'slaves', self._w))]
12291229
slaves = pack_slaves
12301230
# Place method that applies to the master
12311231
def place_slaves(self):
12321232
"""Return a list of all slaves of this widget
12331233
in its packing order."""
1234-
return map(self._nametowidget,
1235-
self.tk.splitlist(
1234+
return [self._nametowidget(x) for x in
1235+
self.tk.splitlist(
12361236
self.tk.call(
1237-
'place', 'slaves', self._w)))
1237+
'place', 'slaves', self._w))]
12381238
# Grid methods that apply to the master
12391239
def grid_bbox(self, column=None, row=None, col2=None, row2=None):
12401240
"""Return a tuple of integer coordinates for the bounding
@@ -1338,9 +1338,9 @@ def grid_slaves(self, row=None, column=None):
13381338
args = args + ('-row', row)
13391339
if column is not None:
13401340
args = args + ('-column', column)
1341-
return map(self._nametowidget,
1342-
self.tk.splitlist(self.tk.call(
1343-
('grid', 'slaves', self._w) + args)))
1341+
return [self._nametowidget(x) for x in
1342+
self.tk.splitlist(self.tk.call(
1343+
('grid', 'slaves', self._w) + args))]
13441344

13451345
# Support for the "event" command, new in Tk 4.2.
13461346
# By Case Roole.
@@ -1452,7 +1452,7 @@ def wm_colormapwindows(self, *wlist):
14521452
if len(wlist) > 1:
14531453
wlist = (wlist,) # Tk needs a list of windows here
14541454
args = ('wm', 'colormapwindows', self._w) + wlist
1455-
return map(self._nametowidget, self.tk.call(args))
1455+
return [self._nametowidget(x) for x in self.tk.call(args)]
14561456
colormapwindows = wm_colormapwindows
14571457
def wm_command(self, value=None):
14581458
"""Store VALUE in WM_COMMAND property. It is the command
@@ -2115,9 +2115,9 @@ def canvasy(self, screeny, gridspacing=None):
21152115
def coords(self, *args):
21162116
"""Return a list of coordinates for the item given in ARGS."""
21172117
# XXX Should use _flatten on args
2118-
return map(getdouble,
2118+
return [getdouble(x) for x in
21192119
self.tk.splitlist(
2120-
self.tk.call((self._w, 'coords') + args)))
2120+
self.tk.call((self._w, 'coords') + args))]
21212121
def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={})
21222122
"""Internal function."""
21232123
args = _flatten(args)

Lib/tkinter/tix.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ def info(self, option=None):
253253
return self.tk.call('tixForm', 'info', self._w, option)
254254

255255
def slaves(self):
256-
return map(self._nametowidget,
257-
self.tk.splitlist(
256+
return [self._nametowidget(x) for x in
257+
self.tk.splitlist(
258258
self.tk.call(
259-
'tixForm', 'slaves', self._w)))
259+
'tixForm', 'slaves', self._w))]
260260

261261

262262

Lib/turtle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ def _pointlist(self, item):
752752
[(0.0, 9.9999999999999982), (0.0, -9.9999999999999982),
753753
(9.9999999999999982, 0.0)]
754754
>>> """
755-
cl = list(self.cv.coords(item))
755+
cl = self.cv.coords(item)
756756
pl = [(cl[i], -cl[i+1]) for i in range(0, len(cl), 2)]
757757
return pl
758758

0 commit comments

Comments
 (0)