Python includes the built in max() function. However, despite it being built in it is not a keyword. That is to say, you are allowed to do max=4
. This makes sense since the maximum of something comes up a lot. But! If you use max as a variable, then it disables use of the max function in that scope.
So if you do:
max = 4
max(1, 2)
You will get an error of int object not callable
. Again, makes sense. But is there any way to specify that you would like the max function? Like a std.max()
? This goes for all other built in functions as well.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…