
Oct. 25, 2021
9:06 p.m.
On Tue, Oct 26, 2021 at 6:46 AM Mike Miller <python-ideas@mgmiller.net> wrote:
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.
Not sure I understand. Which variable is being passed twice? This example is straight from the standard library's bisect module. ChrisA