Talk on Introducing Metaclasses at PyDelhi MeetupCore Python · PyDelhi
In order to develop an intuition to understand metaclasses in python, Let’s see it in this way: “Everything is an object in Python”, So is a class! and every object is created by a class, of course:
>>> class Foo(): pass >>> foo_object = Foo()
The class which creates the
>>> type(foo) __main__.Foo
That’s what we expected,
Now, as I said earlier, every class is also an object, So is
Foo, now lets see which class creates the class
>>> type(Foo) type
type! Yes, the
type class creates the
Foo class and that’s what called as a Metaclass. Metaclasses are the secret sauce which creates classes!
type is the default metaclass in Python. To dive more into Metaclasses, have a look at the presentation slides of
Tip : Interested in tasting bit more of Python? Come to PyDelhi Meetups! or if you would like to taste lot of python, then you should come to PyCon India 2016, its a premier conference in India on using and developing the Python programming language & is conducted annually by the Python developer community. It attracts the best Python programmers from across the country and abroad.
If you missed my talk or attended and liked it, then you should definitely have a look at my proposal for this talk at PyCon India 2016 or you can submit your own proposal here, the call for proposals is open ;)
Here is a picture of an another talk by Peeyush Aggarwal (@dhuadaar) on NLP.
See you in the next meetup :)