3 ms·
Namespaces are pervasive in Python. Virtually everything you deal with is a namespace: package, modules, classes, instances; even functions are namespaces:
by benji-york 4y ago
Namespaces are pervasive in Python. Virtually everything you deal with is a namespace: package, modules, classes, instances; even functions are namespaces:
>>> def func(ns):
... print(ns.stuff)
...
>>> func.stuff = 'honking great'
>>> func(func)
honking great