While investigating Ruby I came across this to create a simple Struct-like class:
Person = Struct.new(:forname, :surname)
person1 = Person.new(\'John\', \'Do
If you're using Python 2.6, try the standard library namedtuple class.
>>> from collections import namedtuple
>>> Person = namedtuple('Person', ('forename', 'surname'))
>>> person1 = Person('John', 'Doe')
>>> person2 = Person(forename='Adam', surname='Monroe')
>>> person1.forename
'John'
>>> person2.surname
'Monroe'
Edit: As per comments, there is a backport for earlier versions of Python