I can do max(s)
to find the max of a sequence. But suppose I want to compute max according to my own function, something like:
currmax = 0
def mymax(s):
for i in s :
#assume arity() attribute is present
currmax = i.arity() if i.arity() > currmax else currmax
Is there a clean pythonic way of doing this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…