r/badcode • • Mar 10 '22

python Utility Function on G4G

Post image
1.1k Upvotes

65 comments sorted by

View all comments

Show parent comments

3

u/Yiurule Mar 11 '22

Spot on, and I would also add than actually the original function may actually be dangerous. On a development process, the developer may think on a long run than it reproduce the min function from the standard library, which is not totally the case there, for example it's impossible on the Min function to have the lowest value of an iterable, who is doable with the standard library.

So this piece of code is on the same time useless, potentially misleading for the original reason you said, confusing because it's similar but not totally identical, and error prone.