static class methods and data members

N

Neil Zanella

Hello,

I would like to know whether it is possible to define static class methods
and data members in Python (similar to the way it can be done in C++ or Java).
These do not seem to be mentioned in "Learning Python" by Mark Lutz and David
Ascher. It seems like they are a relatively new feature... It seems to me that
any truly OO programming language should support these so I'm sure that Python
is no exception, but how can these be defined/implemented in Python? Currently
I have Python version 2.3 installed on my system.

Thanks,

Neil
 
L

Lawrence Oluyede

In data 18 Aug 2004 14:41:46 -0700, Neil Zanella ha scritto:
It seems to me that
any truly OO programming language should support these so I'm sure that Python
is no exception, but how can these be defined/implemented in Python? Currently
I have Python version 2.3 installed on my system.

Why are you sure? I've used static methods two or three times in Python,
anyway you can gain something similar with the aid of staticmethod
http://www.python.org/2.2.1/descrintro.html#staticmethods
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top