All pastes #632493 Raw Edit

Someone

public python v1 · immutable
#632493 ·published 2007-07-24 21:58 UTC
rendered paste body
NUMBER=100000class A(object):    passa = A()b = dict()def test1():    for x in xrange(NUMBER):        if a.__class__ is A:            pass        if b.__class__ is A:            passdef test2():    for x in xrange(NUMBER):        if isinstance(a, A):            pass        if isinstance(b, A):            pass"""timeit.py 'import shad; shad.test1()'10 loops, best of 3: 61.9 msec per looptimeit.py 'import shad; shad.test2()'10 loops, best of 3: 102 msec per loop"""