This sample using 'cmd' module do not prints default variable value, 5. import cmd class x(cmd.Cmd): def do_y(self, value = 5): print value z = x() z.cmdloop() but, the following sample prints '5'. why don't the sample above prints? class x: def do_y(self, value = 5): print value z = x() z.do_y()