News for hackers. Stuff that matters.
Re:Python's Max() Is Broken by dekhn on Tuesday January 16, 2024 @05:18PM (#39019940)
I wonder what would happen if you modified the interpreter to do this by default, and then ran a comprehensive test suite across a wide range of commonly used packages.

At the very least it would be intersting to find code that calls max([]).

Re:Python's Max() Is Broken by timfi on Wednesday January 17, 2024 @05:52AM (#39026071)
Imho this is a non-issue. Python's max-function isn't limited to numerical values, but can consume iterables of anything with a defined order, i.e., things that implement the appropriate hooks in the Python data model. For such inputs, returning anything but an error (or the optionally provided default value) doesn't make much sense.
Re:Python's Max() Is Broken by hwayne on Wednesday January 17, 2024 @11:57AM (#39030304)
I think one potential downside of this is you no longer have `max(l) in l` for all lists.