Revision 1 as of 2007-07-17 19:42:56

Clear message

x = 'abc' expect = 'abcabcabc'

class C(object):

assert expect == C()(x) # works great

E = type('E',(object,),dict(call=staticmethod(C.call)))

assert expect == E()(x) # works great, why must I

def f(x):

class G(object):

assert expect == G()(x) # works great, works as I expect

# My opportunity to make a static method has passed?

I = type('I',(C,),dict(call = staticmethod(C.f)))

try:

except TypeError,info: # I don\'t understand.

# Staticness lost?

F = type('F',(object,),dict(call=C.call))

try:

except TypeError,info: # misunderstood,


CategoryLanguage

Unable to edit the page? See the FrontPage for instructions.