Serhiy Storchaka added the comment: 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) """ ... ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16801> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com