Commit 7cb5ed42 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Update comparisons_chained.py

parent 6e5bb0bc
# expected: fail
class C(object):
def __init__(self, n):
self.n = n
def __lt__(self, rhs):
print "lt"
return self.n < rhs.n
def __le__(self, rhs):
print "le"
return self.n <= rhs.n
def f(n):
print "f(%d)" % n
return n
return C(n)
# f(3) shouldn't get called:
f(1) <= f(2) < f(1) < f(3)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment