Terry J. Reedy added the comment:
If you wish to pursue this, I suggest starting with 'the simplest thing that
works' for the text cases at hand. They all involve 'mode' and you have not
presented and I cannot think of other cases. So somewhere in the signature
generation code:
if function name in <set> and parameter_name == 'mode':
replace_decimal_with_octal(parameter_default)
If more generality is really needed, pick a new reserved attribute for
functions and set it at the time of definition.
def open(file, flag='r', mode=0o666):
open.__param_rep__ = {'mode': 'octal'} #or whatever is chosen
I suppose the advantage of adding the syntactic sugar of a decorator, after
getting the above to work, is that the doc could be hidden away in the inspect
model, where is would be easily ignored.\
Still, this does seem like a lot of 'noise' for a small bit of extra 'signal'
increment.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16801>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com