This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Arfrever, carsten.klein@axn-software.de, larry, mark.dickinson, r.david.murray, serhiy.storchaka, terry.reedy
Date 2012-12-29.16:38:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1356799134.12.0.828672643745.issue16801@psf.upfronthosting.co.za>
In-reply-to
Content
> And if os.open were supplied in os.py:
>
>     @inspect.override_string_representation('mode',
>         'os.O_CREAT | os.O_RDWR')
>     def open(file, flags, mode=0o777, *, dir_fd=None):

Other use case is a sentinel default. "foo(arg={})" looks better than "foo(arg=<object object>)" for function which use a sentinel idiom:

    _sentinel = object()
    def foo(arg=_sentinel):
        if arg is _sentinel:
            arg = {}
        ...

Sometimes full signature overwriting is needed (see for example Python implementation of operator.methodcaller() in issue16694).
History
Date User Action Args
2012-12-29 16:38:54serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, mark.dickinson, larry, Arfrever, r.david.murray, carsten.klein@axn-software.de
2012-12-29 16:38:54serhiy.storchakasetmessageid: <1356799134.12.0.828672643745.issue16801@psf.upfronthosting.co.za>
2012-12-29 16:38:54serhiy.storchakalinkissue16801 messages
2012-12-29 16:38:53serhiy.storchakacreate
Morty Proxy This is a proxified and sanitized view of the page, visit original site.