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

Raymond Hettinger report at bugs.python.org
Sun Jul 1 20:52:44 EDT 2018


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

Okay, I'll mark this as on-hold until you find the relevant code.

I'm not sure why you think modifying the class definition would look weird.  That is the normal and intended place to put methods.  Likely, the only reason that you had any success at all when attaching a function to an instance was that it didn't need access to either "self" or "class".

----------
resolution:  -> later
versions: +Python 3.8 -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>
<https://bugs.python.org/issue28657>
_______________________________________


More information about the Python-bugs-list mailing list