feel_energetic wrote in news:1149239221.045268.6170 @g10g2000cwb.googlegroups.com in comp.lang.python:
> Hi, > > I already knew how to define a static method of a class( using > staticmethod() ),but I find there isn't a built-in func to build a > static field ( something like staticfield() ) > can anyone help me on this? > thanks very much for your help :) > What you possibly want is just a class attribute: class MyClass( object ): static_field = 10 myInstance = MyClass() print MyClass.static_field, myInstance.static_field Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list