[issue41276] Min / Max returns different values depending on parameter order

2020-07-12 Thread Calvin Davis
Calvin Davis added the comment: You say that confusing IDLE with Python is common for beginners, do you mean to suggest that IDLE isn't a Python interpreter? I know IDLE is essentially just an IDE and distinctly different than the python shell, but I wasn't aware the differences would

[issue41276] Min / Max returns different values depending on parameter order

2020-07-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Calvin, min and max are builtin functions and part of 'Interpreter Core'. Confusing IDLE with Python is common for beginners who use IDLE. Do you think I could reduce the confusion by somehow changing the message printed at the top of Shell, before '>>>'?

[issue41276] Min / Max returns different values depending on parameter order

2020-07-10 Thread Calvin Davis
Calvin Davis added the comment: Thank you for the clarification, sorry for the report! You're awesome! -- ___ Python tracker ___

[issue41276] Min / Max returns different values depending on parameter order

2020-07-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: In your first example, `min([(-5, 2), (0, 2)])` the min() function compares the two tuples and finds that the first one is lexicographically smaller: py> (-5, 2) < (0, 2) True so (-5, 2) is considered the minimum. In the second example, using the

[issue41276] Min / Max returns different values depending on parameter order

2020-07-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is correct behaviour. What makes you think otherwise? For future bug reports, please don't post screen shots of text, copy and paste the text into the body of your bug report. Posting screenshots makes it difficult for us to copy and run your code,

[issue41276] Min / Max returns different values depending on parameter order

2020-07-10 Thread Calvin Davis
New submission from Calvin Davis : See attached image The behavior of min() (and probably max and other related functions) changes depending on the order of the parameters it sorts. In the image, I sorted two tuples, coordinate points, with the same Y value and different X values. When the