[issue24360] improve argparse.Namespace __repr__ for invalid identifiers.
paul j3
report at bugs.python.org
Wed Jun 3 19:30:31 CEST 2015
paul j3 added the comment:
Off hand I don't see a problem with this patch (but I haven't tested it yet).
But I have a couple of cautions:
The docs say, regarding the Namespace class:
> This class is deliberately simple, just an object subclass with a readable string representation.
This patch improves the 'readable' part, but adds some complexity.
The docs also note that the user can provide their own namespace object, and by implication, a custom Namespace class with this improved '__repr__'.
The Namespace '__repr__' is mainly of value during code development, especially when trying ideas in an interactive shell. It's unlikely that you would want to show the whole namespace to your end user. So even if your final API requires funny characters, you don't need to use them during development.
----------
nosy: +paul.j3
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24360>
_______________________________________
More information about the Python-bugs-list
mailing list