shadowing class attributes
what will this print
>>> class User:
... id = 1
>>> u = User()
>>> u.id = 89
>>> User.id = 98
>>> print(u.id)
89
This code will print the value 89.
Here's a step-by-step breakdown of what happens:
The User class is defined with a class att...
snowcodes.hashnode.dev2 min read