Message182862
It's cumbersome and burdensome because you need for every nonstandard default value:
1) define a class with __repr__();
2) instantiate a sentinel;
3) check for the sentinel in the function and replace it but an actual value.
class _ExternalAttrDefault:
def __repr__():
return '(stat.S_IRUSR|stat.S_IRUSR)<<16'
_external_attr_default = _ExternalAttrDefault()
def open(self, name, mode='r', external_attr=_external_attr_default):
if external_attr is _external_attr_default:
external_attr = (stat.S_IRUSR|stat.S_IRUSR)<<16
...
Instead of just:
def open(self, name, mode='r', external_attr=(stat.S_IRUSR|stat.S_IRUSR)<<16):
"""
Foo.open(name, mode='r', external_attr=(stat.S_IRUSR|stat.S_IRUSR)<<16)
"""
... |
|
Date |
User |
Action |
Args |
2013-02-24 09:19:56 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, barry, georg.brandl, rhettinger, terry.reedy, mark.dickinson, larry, ezio.melotti, Arfrever, r.david.murray, carsten.klein@axn-software.de |
2013-02-24 09:19:56 | serhiy.storchaka | set | messageid: <1361697596.46.0.0269710641319.issue16801@psf.upfronthosting.co.za> |
2013-02-24 09:19:56 | serhiy.storchaka | link | issue16801 messages |
2013-02-24 09:19:56 | serhiy.storchaka | create | |
|