Basic Intro to Python Metaprogramming(bitshaq.com) |
Basic Intro to Python Metaprogramming(bitshaq.com) |
You don't have permission to access /2011/07/14/basic-intro-to-python-meta-programming/ on this server.
is not equivalent to what the blog post says it is to. FooBase should be defined before running this, and the blog post's equivalent make it look like this statement defines FooBase as well.
1. >>> FooBase = type("FooBase", (object,), {})
2. >>> Foo = type("Foo", (FooBase,), {'bar' : 42})
Although I am not a python expert, so you may be right... in which case, how does line one not work?