Re:Basic Intro to Python Metaprogramming
by iandanforth on Saturday July 16, 2011 @11:26PM
(#2772437)
For me this article was written in reverse. For an intro I'd love to have had the 'code smell' example first to establish why I might care and when I might need this, and then dive into an example.
Re:Basic Intro to Python Metaprogramming
by irahul on Saturday July 16, 2011 @10:37PM
(#2772359)
>>> Foo = type("Foo", (FooBase,), {'bar' : 42})
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.
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.