Tips/Python 4

why can I assign value to python class object attribute while this attribute is not defined in the class

https://stackoverflow.com/questions/60684064/why-does-this-work-in-python-creating-a-instance-setting-a-non-existent-attrib Why does this work in Python? Creating a instance, setting a non existent attribute in that class, then printing that attribute I was watching a Youtube tutorial about python classes. This is the code he wrote. class Tweet : pass a = Tweet() a.message = '140 chars' print (a..

Tips/Python 2023.08.12