On 2021-10-23 17:13, Chris Angelico wrote:
def bisect_right(a, x, lo=0, hi=>len(a), *, key=None):
Sounds like deferred execution could be useful, but I wanted to complain about the example above. I realize it is "just an example" but if I saw this in code, the first thing I'd do is ask for it to be changed.
Why? The same variable (or simple variant) shouldn't be passed twice in a signature, when it can be operated on inside the body of the function to get that variant. i.e.: DRY.
Probably someone will think up an exception to that, but even so, occurrence is a fraction of rare and not enough to justify this new feature.
Believe I saw better examples in the discussion, so please go with one of those. -Mike _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/CQ4A42SBBEOHP4BSJWMFH2FATLZ7IWOR/ Code of Conduct: http://python.org/psf/codeofconduct/