Python
Classes in Python
advanced
__new__ and __init__ play distinct roles in Python object creation. While __new__ is responsible for creating and returning a new instance, __init__ initializes that …
Teach & learn
Python, finance, fintech, AI, machine learning, and adjacent topics — structured for reuse.
Python
advanced
__new__ and __init__ play distinct roles in Python object creation. While __new__ is responsible for creating and returning a new instance, __init__ initializes that …
Python
advanced
Metaclasses are Python’s mechanism for controlling class creation itself. While classes define how objects are created, metaclasses define how classes are created. In this …
Python
intermediate
Magic Methods in Python: The Secret Sauce Behind Elegant Code Ever wondered why you can write vector1 + vector2 , if user in users …
Python
intermediate
Magic attributes, also known as dunder attributes, are special variables that Python automatically creates and attaches to modules, classes, functions, and objects. They provide …