Message178474
| Author |
terry.reedy |
| Recipients |
Arfrever, larry, mark.dickinson, r.david.murray, terry.reedy |
| Date |
2012年12月29日.05:35:19 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1356759320.21.0.267234701308.issue16801@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|