On Tue, Oct 26, 2021 at 6:46 AM Mike Miller <python-id...@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 _______________________________________________ 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/TWWVRE27AYIRUFAC5Q22ZYVMG6R5NU2V/ Code of Conduct: http://python.org/psf/codeofconduct/