Message209940
Please review the attached patch (sig_builtins_01.patch).
Some details:
- All parsing code from Signature.from_builtin was moved
in a separate helper '_signature_fromstr'
- Signature.from_builtin calls '_signature_fromstr'. All
its validation logic is untouched.
- 'inspect.signature' was tweaked a bit: when it's certain
that the object is a class and there is no user-defined
__init__ or __new__ or its meta's __call__, it traverses
the MRO to find non-empty __text_signature__. If it finds
one -- it returns with _signature_fromstr(). If not, it checks
if __init__ is type.__init__ or object.__init__. The last
check is a bit tricky -- the only way of doing that check
(I think) is to use __qualname__.
Since the patch is non-trivial, any review/comments would
be greatly appreciated. |
|
Date |
User |
Action |
Args |
2014-02-02 02:21:23 | yselivanov | set | recipients:
+ yselivanov, ncoghlan, larry |
2014-02-02 02:21:23 | yselivanov | set | messageid: <1391307683.93.0.363103451945.issue20473@psf.upfronthosting.co.za> |
2014-02-02 02:21:23 | yselivanov | link | issue20473 messages |
2014-02-02 02:21:23 | yselivanov | create | |
|