You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python TA incorrectly flags this for W3301 "nested min/max", stating that we would be able to shorten the last line to:
maximum=max(5, my_list)
This is incorrect, since the python builtin max can only compare values of the same type (and cannot compare list[int] and int here). The replacement suggested by PythonTA would cause a runtime error.
W3301 should not be flagged if the parameters passed into the builtin mins/maxs are of different types.
The text was updated successfully, but these errors were encountered:
The following lines find the maximum value between a list and a single number:
Python TA incorrectly flags this for W3301 "nested min/max", stating that we would be able to shorten the last line to:
This is incorrect, since the python builtin
max
can only compare values of the same type (and cannot comparelist[int]
andint
here). The replacement suggested by PythonTA would cause a runtime error.W3301 should not be flagged if the parameters passed into the builtin
min
s/max
s are of different types.The text was updated successfully, but these errors were encountered: