Oh, metaclass!

Looking at a friend’s python code which have tens of lines of metaclass. I thought I know __metaclass__ which is how Django implemented its database model. But then I rethink maybe I don’t know it very well.

Google showed me What are metaclasses in Python?

Oh, it’s a great answer! It’s using the “refactoring to patterns” style, telling all the magic behind it with a reasoning process. It tells you how to fish!

To me the Python3 metaclass is new, but makes a lot of sense. I’m glad I found it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.