How to get/set class attributes in Python
Kalle Anke
skromta at gmail.com
Sun Jun 12 09:56:35 EDT 2005
On Sun, 12 Jun 2005 15:35:15 +0200, John Machin wrote
(in article <42AC3A13.9020503 at lexicon.net>):
> OTOH, I beseech you to consider an attitude transplant :-)
;-)
> I.e. put your effort into writing code that allows people to do useful
> things, rather than opaque guff full of __blahblah__ that stops them
> from doing dopey or evil things they're usually smart enough or
> righteous enough not to do anyway.
I'm just trying to protect myself from myself :-) No, I'm playing around with
different ways of doing things, trying to learn Python and how do things in a
proper "pythonic" way.
In this case I'm going to have a class with some properties that are going to
be stored in a database, I don't want to read all the properties everytime I
recreate the object from the database but I still want to give the impression
that the attributes exists and is available. So my idea was to "hide" the
actual database stuff ...
> BTW, what do you think of this:
>
> sys.maxint = -12345
I don't really understand what you're meaning.
jem
More information about the Python-list
mailing list