Carsten Klein added the comment:

The problem with this is that at the time that pydoc gets the information via 
inspect, the numbers have already been parsed as long or double and the 
original notation is no longer available.

This is due to the fact that during build of the AST node for the NUMBER type, 
the value will already be deserialized into its machine representation, which 
is either long or double.

The only way to preserve that information would be to extend the NUM_type with 
an additional 's' field which then would preserve its original notation and 
which can be retrieved from the AST.

pydoc, however, would still fail as it does not use the AST. In order to 
restore the original information, pydoc must then source the original file or 
source of the function or class method and parse it using the AST.

A much simpler approach would be to simply get the function or method source 
and extract its formal parameter list using for example a regular expression.

However, preserving the original notation in the runtime is not required and 
shouldn't be done.

----------
nosy: +carsten.kl...@axn-software.de

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16801>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to