Adding static typing to Python

gbreed at cix.compulink.co.uk gbreed at cix.compulink.co.uk
Tue Feb 19 05:57:59 EST 2002


Courageous wrote:

> Well, one has been able to roll one's own version of this for a long
> time; simply override getattr and settatr and on a per instance basis
> do what you need to do. Basically, it's all syntactic sugar. For the
> C++ "family" of language, it's quite an innovation, however, as this
> is the first time one has been able to use an attribute but get a method
> as a consequence.
> 
> I don't know if 2.2 offered anything like this. It's not obvious in
> the documenation. The docs are in sorry shape, though.

I haven't worked out 2.2 either.  But Jython does present Java's getters 
and setters as attributes.  See 
<http://www.jython.org/docs/properties.html>.


                          Graham



More information about the Python-list mailing list