I am just beggining to learn python (coming from C); I have found myself very confused regarding the way that variables belonging to a class are defined (don't care if "class type" or "instance type" yet, my question is way more basic). This far I have experimented with these code lines:
class A:
pass
A.a = 1
A.b = 2
print(A.a+A.b)
This code surprisingly returned "3" (while I expected an error), which leads me to here. I don't understand why the interpreter is able to infere the variables (which I never defined) belonging to the class "A".