| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@sobolevn, maybe you could review this (at least the inspect part)? |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for working on this!
Couple of thoughts:
Other than that - I don't really have an opinion on this feature. Because I don't any real use-cases for it.
Sorry, something went wrong.
I can't find any example outside of the CPython, and it's not documented (as the __signature__ property, which is used, e.g. in the SymPy). There is an issue, which is more or less a feature request: #93865 Clearly, it might be useful for extensions.
No, I don't think so. Previously, the return annotation was just ignored and if there were parameter annotations - an exception was raised.
This solution does assume application in the stdlib modules and simple extensions (e.g. I've tested this on the gmpy2), so
Any example of using __text_signature__ property in the stdlib. In most cases, however, this will require |
Sorry, something went wrong.
|
@1st1, you are listed as an expert for the inspect module. Maybe you could review this little pr? |
Sorry, something went wrong.
Sorry, something went wrong.
|
PEP waiting for a sponsor: skirpichev/peps#2 |
Sorry, something went wrong.
… inspect.signature()
This is an alternative to python#100168.
…string" This reverts commit 3dc4125.
…hods" This reverts commit ff758ab.
…_ attribute" This reverts commit 1f3c7f3.
|
Ok, it seems nobody like to sponsor PEP, so I'm returning PR to initial shape (that address review). This is ready for review again. |
Sorry, something went wrong.
Have you posted the draft PEP on discuss.python.org? It may have been missed here... A |
Sorry, something went wrong.
Yes, that was posted in the thread, discussing this pr, there. |
Sorry, something went wrong.
|
@sobolevn, let me know if it does make sense to keep this pr open. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
But I doubt, that this is required. In fact, probably the whole method could be refactored to do first parsing the program string, then do ast transformation (RewriteSymbolics) for defaults, then do ast.unparse(), eval its output and use _signature_from_function() helper to get the final result.
specify return annotations. (A first step to something like Support return annotation in signature for Argument Clinic #76120.)
This doesn't touch public interfaces: the __text_signature__ property left undocumented (but see #93865).