๐ง Metaprogramming
Dynamic Attribute Access
getattr, setattr, hasattr at runtime.
Attribute names aren't fixed โ you can read and write them dynamically.
class Bag: pass
b = Bag()
setattr(b, "color", "red")
print(getattr(b, "color")) # red
print(getattr(b, "missing", "n/a")) # n/a