[issue17424] help() should use the class signature

Ronald Oussoren report at bugs.python.org
Mon Mar 18 23:29:36 CET 2013


Ronald Oussoren added the comment:

If I read the code correctly help(pyth.__init__) won't use the __signature__ because that is an attribute of the type, not of the method itself. 

With the patch in issue17053 help should be better when __init__'s signatuer is set explicitly:


class Stock(Structure):
    __signature__ = make_signature(['name', 'shares', 'price'])
    def __init__(self, *args, **kwds):
        super(Stock, self).__init__(*args, **kwds)
    __init__.__signature__ = __signature__


Sadly enough it isn't easily possible to define a subclass of function where __signature__ is a property that returns the class attribute __signature__.

----------
nosy: +ronaldoussoren

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


More information about the Python-bugs-list mailing list