This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author carsten.klein@axn-software.de
Recipients Arfrever, carsten.klein@axn-software.de, larry, mark.dickinson, r.david.murray, terry.reedy
Date 2012-12-29.12:59:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1356785944.9.0.710024866138.issue16801@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-12-29 12:59:04carsten.klein@axn-software.desetrecipients: + carsten.klein@axn-software.de, terry.reedy, mark.dickinson, larry, Arfrever, r.david.murray
2012-12-29 12:59:04carsten.klein@axn-software.desetmessageid: <1356785944.9.0.710024866138.issue16801@psf.upfronthosting.co.za>
2012-12-29 12:59:04carsten.klein@axn-software.delinkissue16801 messages
2012-12-29 12:59:04carsten.klein@axn-software.decreate