Rajesh Petheeklavvya.hashnode.dev路Sep 14, 2024Use Cases for Metaclasses in PythonWhy do we even need metaclasses? Specially when we have class inheritance and multiple inheritance and constructors to granularly define what we need? Answer is yes! We need metaclass when we need to influence how a class is defined. In other words -...Discussmetaclass
Shrey Dikshantshreysblog.hashnode.dev路Sep 11, 2024馃攳Short Note on Python Metaclasses: Customizing Class Creation馃搶 Overview: Metaclasses are a powerful, advanced feature in Python that let you modify or control the behavior of classes when they are defined. This blog will introduce metaclasses and provide practical examples of where they can be useful. 馃攳 Key ...DiscussMeta
kapil Gargkapilg.hashnode.dev路Apr 19, 2024Singleton class in PythonSingleton : There is only a single instance of the given class. There are multiple ways to create Singleton class in python. Most of these deals with overriding Dunder methods. Overriding __new__ When you are writing a python class, __new__ methods c...Discuss路98 readsPython
Jason Nwakaezejaysinscars.hashnode.dev路Apr 1, 2023Understanding metaclass In PythonLet's say we define a string some_string = "I am some_string" print(some_string.__class__) As expected the result should print str as some_string is indeed a stringbut can you guess what the below result is? print(some_string.__class__.__class__) T...Discuss路2 likes路121 readsPython