[Python-au] New Python Class Features

Graeme Matthew graeme_matthew@hotmail.com
Fri, 17 Jan 2003 14:39:16 +1100


Hi all

When designing Classes does one have to set getters and setters

e.g.

class Order(object):

    def __init__ (self):
       self.__order = None

    def get_order(self):
        return self.__order

    def set_order(self, val):
        self.__order = val

    order = property(get_order, set_order)

What I am trying to determine if their is a short way as this is going to 
take ages when writing an object that has 20 properties

any advice would be welcome


thanks




_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE* 
http://join.msn.com/?page=features/virus