This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Błażej Michalik, remi.lapeyre, rhettinger, tuxtimo
Date 2018-07-05.23:34:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1530833645.53.0.56676864532.issue28657@psf.upfronthosting.co.za>
In-reply-to
Content
> That method would then perform an assignment with setattr() calls: setattr(self, "do_" + command, func).

Could this have been done with:  setattr(self.__class__, "do_" + command, func)?

I'm concerned that attaching functions to the instance is fighting the Python norms and the design of the module.  It seems like a can of worms.
History
Date User Action Args
2018-07-05 23:34:05rhettingersetrecipients: + rhettinger, tuxtimo, Błażej Michalik, remi.lapeyre
2018-07-05 23:34:05rhettingersetmessageid: <1530833645.53.0.56676864532.issue28657@psf.upfronthosting.co.za>
2018-07-05 23:34:05rhettingerlinkissue28657 messages
2018-07-05 23:34:05rhettingercreate