Answers for "python magic methods of class __init__"

0

python magic methods of class __init__

so basically its like this
//when object is created
a=A()
//this init is called
//similarly say
class A:
 def __len__(self):
     print("dd")
a=A()
len(a)
//prints dd basically python knows that magic method __len__ is to be called for len(a)
Posted by: Guest on March-13-2022

Python Answers by Framework

Browse Popular Code Answers by Language