- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Can you explain what is metaclass and inheritance in Python?
Every class is an object. It's an instance of something called a metaclass. The default metaclass is typed. You can check this using the is instance function. For example,
class Foo: pass foo = Foo() isinstance(foo, Foo) isinstance(Foo, type)
This will give the output:
True True
A metaclass is not part of an object's class hierarchy whereas base classes are. These classes are used to initialize the class and not its objects.
You can read much more in-depth about Metaclasses and inheritance on https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/
- Related Articles
- What is a metaclass in Python?
- What is Inheritance in Java? Explain with an example
- Explain Inheritance vs Instantiation for Python classes.
- Can you please explain Python dictionary memory usage?
- How we can extend multiple Python classes in inheritance?
- What is Inheritance in C#?
- Inheritance in Python
- What is SciPy in Python? Explain how it can be installed, and its applications?
- Introduction to Classes and Inheritance in Python
- Class Inheritance in Python
- What Is Doxing and How Can You Prevent It?
- What is Bloatware and how can you remove it?
- Can you explain the process of Photosynthesis?
- What is spear phishing and how can you avoid it?
- Can you store lemon pickle in aluminium utensils? Explain.

Advertisements