Struct usages in Python
J. Cliff Dyer
jcd at sdf.lonestar.org
Wed May 28 10:39:22 EDT 2008
On Wed, 2008-05-28 at 09:31 -0400, Alok Kumar wrote:
> I am getting following error when tried as you suggested.
>
> self.event = [] #Create an empty list, bind to the name "event" under
> the "self" namespace
> self.event.append(Event()) #Create an event object and
> append to the end of the list
>
> class Event():
> ^
> SyntaxError: invalid syntax
>
He meant to say
class Event(object):
Always subclass object, unless you have a very compelling reason not to,
or you are subclassing something else.
More information about the Python-list
mailing list