def _get ( self , pos ) : res = None , None if pos is not None : try : res = self [ pos ] , pos except ( IndexError , KeyError ) : pass return res
python tkinter get the position of a widget
loads widget at given position ; handling invalid arguments
def _get(self, pos):
        """loads widget at given position; handling invalid arguments"""
        res = None, None
        if pos is not None:
            try:
                res = self[pos], pos
            except (IndexError, KeyError):
                pass
        return res