def print_commands (self, comment=''):
        """
        Print a readable list of all commands.
        Debugging aid.
        """
        print "===== Commands: %s ========"%comment 
        for i in range(1, len(self._commands)-1):
            # The first and last entry are sentinels.
            print "Command", i 
            steps = self._commands[i]
            if steps:
                for step in steps:
                    function, args = step 
                    print "  ", function.__name__, args 
        print "========================"

        Print a readable list of all commands.
        Debugging aid.
        
recipes/Python/306866_A_basic_undo_mechanism/recipe-306866.py