First Edition4 min read
Item 34: Register Class Existence with Metaclasses
A common use of metaclasses is to automatically register types in your program. Registration is useful for doing reverse lookups, where you need to map a simple identifier back to a corresponding class.
By Brett SlatkinEffective Python: 90 Specific Ways to Write Better Python by Brett Slatkin Blog

Read the full story
Originally published by Effective Python: 90 Specific Ways to Write Better Python by Brett Slatkin Blog on Feb 3, 2015.
Comments
Sign in to join the discussion.