[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Larry Hastings
Larry Hastings added the comment: > > Also also, I remember specifically that the isinstance(type) code > > would fail builtin classes. > > Could you please find an example of this? This was during the development of the original feature. I changed the if statement for the from_builtin() call

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: And also, reading Stefan in another issue, I'm a bit worried that it may forcibly become a public API. Users tend to start using APIs before they are public, and that's especially true for python dunder attributes. Maybe we should document '__text_signature__'

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: FWIW, I think the same. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Larry Hastings
Larry Hastings added the comment: I don't think __text_signature__ should ever be a documented public API. -- ___ Python tracker ___ _

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: And also right now, inspect.signature looks for '__text_signature__' when no used-defined __init__ was found. That's also going to be changed, but again, when __text_signature__ becomes a public documented API. -- _

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-02 Thread Yury Selivanov
Yury Selivanov added the comment: For instance if __text_signature__ and __signature__ are present simultaneously which one should be used, or the use of '($' to specify bound-methods first parameters etc. -- ___ Python tracker

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-02 Thread Larry Hastings
Larry Hastings added the comment: What semantics are unsettled? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-02 Thread Yury Selivanov
Yury Selivanov added the comment: Committed. We'll likely need to modify the code again in 3.5, once we settle the exact semantics of __text_signature__. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset c19f5e4fdbe0 by Yury Selivanov in branch 'default': inspect.signature: Add (restore) support for builtin classes #20473 http://hg.python.org/cpython/rev/c19f5e4fdbe0 -- nosy: +python-dev ___ Python tracke

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-02 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, Quoting your reply from #17159: > Also also, I remember specifically that the isinstance(type) code would fail > builtin classes. Could you please find an example of this? -- ___ Python tracker

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Yury Selivanov
Yury Selivanov added the comment: Second patch attached: sig_builtincls_02.patch, with a fix, that Nick suggested. Larry, I'd like you to take a quick look at it as well, before I commit it. -- ___ Python tracker

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Yury Selivanov
Changes by Yury Selivanov : Added file: http://bugs.python.org/file33858/sig_builtincls_02.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Yury Selivanov
Yury Selivanov added the comment: 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 untouche

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Nick Coghlan
Nick Coghlan added the comment: Those are C level descriptors, so we'd have to add new fields to the structs, and that's not going to happen at this stage of the release cycle. However, there's also the fact that tp_new and tp_init are required to have the *same* signature, and those override

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Yury Selivanov
Yury Selivanov added the comment: > Stefan Krah suggests that the failure in 20473 is because that platform > builds without docstrings, and the test requires them. So that should be an > easy fix. Good news ;) OK, I'll decorate the test. > Because slots like tp_init and tp_call don't have d

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Larry Hastings
Larry Hastings added the comment: Stefan Krah suggests that the failure in 20473 is because that platform builds without docstrings, and the test requires them. So that should be an easy fix. -- ___ Python tracker

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Larry Hastings
Larry Hastings added the comment: And, I don't see how your changes to inspect.py could have caused the failures on the buildbot either. But, then, I don't see how *anything* could cause the failures on the buildbot. And your changes to inspect.py happened at (I think) roughly the same time.

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Larry Hastings
Larry Hastings added the comment: I meant to say "slots like tp_new and tp_init". But fwiw it's true of tp_call too. -- ___ Python tracker ___ _

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Larry Hastings
Larry Hastings added the comment: Because slots like tp_init and tp_call don't have docstrings. So it has to go in the class's docstring. -- ___ Python tracker ___

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Yury Selivanov
Yury Selivanov added the comment: OK, there was no unit-test for this... looking into the problem, the first questing is: why is __text_signature__ is on the '_pickle.Pickler' object, not on '_pickle.Pickler.__init__'? -- ___ Python tracker

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-02-01 Thread Yury Selivanov
Yury Selivanov added the comment: OK, I'll take a look tomorrow. Don't think it's related to #20471 though, as in there, if fails to find a signature for the 'builtin.object' (but I may be wrong). -- ___ Python tracker

[issue20473] inspect.Signature no longer handles builtin classes correctly

2014-01-31 Thread Larry Hastings
New submission from Larry Hastings: Yury: In revision 9433b380ad33 you changed inspect.Signature so that it cannot handle builtin classes. Please fix it. >>> import _pickle >>> import inspect >>> str(inspect.signature(_pickle.Pickler)) '()' >>> _pickle.Pickler.__text_signature__