create an instance to use the class simply as a namespace container : Variable Scope « Function « Python Tutorial






class MyData(object):
    pass
mathObj = MyData()
mathObj.x = 4
mathObj.y = 5
mathObj.x + mathObj.y
mathObj.x * mathObj.y








10.4.Variable Scope
10.4.1.Variable Scope and Namespaces
10.4.2.Shadow variable
10.4.3.globals() and locals()
10.4.4.create an instance to use the class simply as a namespace container
10.4.5.Variable name lookup in nested function
10.4.6.Local Names Are Detected Statically
10.4.7.Variable Scope in Functions