<p>Is there a way to conveniently define a C-like structure in Python? I'm tired of writing stuff like:</p>

<pre><code>class MyStruct():
    def __init__(self, field1, field2, field3):
        self.field1 = field1
        self.field2 = field2
        self.field3 = field3
</code></pre>

How about a dictionary?
Something like this:
```
```
myStruct = {'field1': 'some val', 'field2': 'some val'}
```
```
Then you can use this to manipulate values:
```
```
print myStruct['field1']
myStruct['field2'] = 'some other values'
```
```
And the values don't have to be strings.  They can be pretty much any other object.