Casting a custom class to a dict in python
<p>Perhaps I'm overlooking something simple, but I would like to cast an instance of a custom class as a dictionary in python (for the sake of readability), but haven't got an inkling as to how.  To explain in pseudocode, I would like to be able to do this:</p>

<pre>
class A:
   # class things...

a = A()
b = dict(a)
</pre>

<p>where I have defined what <code>b</code> will be within <code>A</code>.  Is this possible?</p>
