
Oct. 25, 2021
7:45 p.m.
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