All pastes #896606 Raw Edit

xif

public text v1 · immutable
·published 2008-02-08 20:12 UTC
rendered paste body
class Foo:
    def __init__(self):
        self.__len__ = lambda: 0

class Bar(object):
    def __init__(self):
        self.__len__ = lambda: 0

print len(Foo()) # old-style: works
print len(Bar()) # new-style: TypeError: object of type 'Bar' has no len()