A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-March/124765.html below:

[Python-Dev] Rough idea for adding introspection information for builtins

[Python-Dev] Rough idea for adding introspection information for builtinsSerhiy Storchaka storchaka at gmail.com
Tue Mar 19 08:37:35 CET 2013
On 19.03.13 06:45, Larry Hastings wrote:
> 4. Store a string that looks like the Python declaration of the
> signature, and parse it (Nick's suggestion).  For foo above, this would
> be "(arg,b=3,*,kwonly='a')".  Length: 23 bytes.

Strip parenthesis and it will be only 21 bytes long.

> We'd want one more mild hack: the DSL will support positional
> parameters, and inspect.Signature supports positional parameters, so
> it'd be nice to render that information.  But we can't represent that in
> Python syntax (or at least not yet!), so we can't let ast.parse see it.
> My suggestion: run it through ast.parse, and if it throws a SyntaxError
> see if the problem was a slash.  If it was, remove the slash, reprocess
> through ast.parse, and remember that all parameters are positional-only
> (and barf if there are kwonly, args, or kwargs).

It will be simpler to use some one-character separator which shouldn't 
be used unquoted in the signature. I.e. LF.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4