[issue6878] changed return type from tkinter.Canvas.coords

Alexander Belopolsky report at bugs.python.org
Thu Oct 21 19:48:15 CEST 2010


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

Searching through tkinter for map() calls reveals many other places where map object is returned instead of a list.  For example:

    def keys(self):
        """Return a list of all resource names of this widget."""
        return map(lambda x: x[0][1:], ..

    def pack_slaves(self):
        """Return a list of all slaves of this widget                                                                                                                    
        in its packing order."""
        return map(self._nametowidget, ..

    def place_slaves(self):
        """Return a list of all slaves of this widget                                                                                                                    
        in its packing order."""
        return map(self._nametowidget, ..


    def wm_colormapwindows(self, *wlist):
        ...
        Return current list of widgets if WLIST is empty."""
        return map(..

While in some cases it may be arguable that returning an iterable is more appropriate for 3.x, I believe preserving backward compatible API is more important.   API changes should also be accompanied with 2to3 fixes, so some action is required in any case.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6878>
_______________________________________


More information about the Python-bugs-list mailing list