© Joannah Nanjekye 2017
Joannah NanjekyePython 2 and 3 Compatibilityhttps://doi.org/10.1007/978-1-4842-2955-2_3

3. Setting Metaclasses

Joannah Nanjekye
(1)
Kampala, Uganda
 
Metaclasses are classes or objects that define a type/class of other classes. Metaclasses can be classes, functions, or any object that supports calling an interface. There are notable differences in setting a metaclass in Python 2 and 3. This chapter discusses the concepts for maintaining compatibility when setting metaclasses.

Metaclasses at a Glance

As in other languages, Python classes are blueprints from which we create objects; however, borrowing from languages like Smalltalk, Python classes are much more interesting. Classes are also first-class objects whose class is a metaclass. ...

Get Python 2 and 3 Compatibility: With Six and Python-Future Libraries now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.