@@ -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 )
0 commit comments