[Zope] Base class in Python

Evan Simpson evan@digicool.com
Mon, 7 Feb 2000 18:11:10 -0600


----- Original Message -----
From: Hung Jung Lu <hungjunglu@hotmail.com>
> This is nicer than using a dictionary. At this moment
> I have to define
>
> class generic:
>     def __init__(self):
>         pass
>
> Not really bothersome, but is there a more
> straightforward way of doing it?

Sure:

class generic:
    pass

:-)

 Seriously, though, if you're just using it as a container, this isn't that
bothersome.  I once proposed a syntax on comp.lang.python which would allow
you to write:

object g:
  a = 3

instead of

g = generic()
g.a = 3

...and it was greeted with a general shrug and the killing observation that
it would require adding a new keyword.

Cheers,

Evan @ digicool