On Tue, Jul 20, 2010 at 9:56 AM, Roshan Mathews wrote:
> I came across this in a blog post just now.
> See http://docs.python.org/library/functions.html#type
>
> >>> class Foo(object): pass
> ...
> >>> Bar = type('Bar', (object,), dict())
>
What you mentioned here is the exact mechanism of a ins
I came across this in a blog post just now.
See http://docs.python.org/library/functions.html#type
>>> class Foo(object): pass
...
>>> Bar = type('Bar', (object,), dict())
>>> f = Foo(); b = Bar()
>>> type(f), type(b)
(, )
Also see
http://docs.python.org/library/collections.html#namedtuple-facto