Message178474
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. |
|
Date |
User |
Action |
Args |
2012-12-29 05:35:20 | terry.reedy | set | recipients:
+ terry.reedy, mark.dickinson, larry, Arfrever, r.david.murray |
2012-12-29 05:35:20 | terry.reedy | set | messageid: <1356759320.21.0.267234701308.issue16801@psf.upfronthosting.co.za> |
2012-12-29 05:35:20 | terry.reedy | link | issue16801 messages |
2012-12-29 05:35:19 | terry.reedy | create | |
|