Know a great AI tool or AI news source? Submit it to AiByts
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
Item 34: Register Class Existence with Metaclasses

Read the full story

Originally published by Effective Python: 90 Specific Ways to Write Better Python by Brett Slatkin Blog on Feb 3, 2015.

Read on Effective Python: 90 Specific Ways to Write Better Python by Brett Slatkin Blog(opens in a new tab)

Comments

Sign in to join the discussion.

No comments yet — be the first to share your thoughts.