[New-bugs-announce] [issue28657] cmd.Cmd.get_help() implementation can't see do_*() methods added dynamically by setattr()

Błażej Michalik report at bugs.python.org
Thu Nov 10 06:14:10 EST 2016


New submission from Błażej Michalik:

The issue here seems to originate from the implementation of Cmd.get_names():

    def get_names(self):                                   
        # This method used to pull in base class attributes
        # at a time dir() didn't do it yet.                
        return dir(self.__class__)                         

Changing it to dir(self) would make dynamical adding helpstrings for commands possible.

----------
components: Library (Lib)
messages: 280502
nosy: Błażej Michalik
priority: normal
severity: normal
status: open
title: cmd.Cmd.get_help() implementation can't see do_*() methods added dynamically by setattr()
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

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


More information about the New-bugs-announce mailing list