All pastes #896607 Raw Edit

xif

public python v1 · immutable
·published 2008-02-08 20:12 UTC
rendered paste body
class Foo:    def __init__(self):        self.__len__ = lambda: 0class Bar(object):    def __init__(self):        self.__len__ = lambda: 0print len(Foo()) # old-style: worksprint len(Bar()) # new-style: TypeError: object of type 'Bar' has no len()