[Tendrl-devel] About Python scopes, object namespaces etc

Rohan Kanade rkanade at redhat.com
Tue Jan 17 20:30:35 UTC 2017


Interesting read:

"Roughly speaking, namespaces are just containers for mapping names to
objects. As you might have already heard, everything in Python - literals,
lists, dictionaries, functions, classes, etc. - is an object.

Such a “name-to-object” mapping allows us to access an object by a name
that we’ve assigned to it. E.g., if we make a simple string assignment via
a_string = "Hello string", we created a reference to the "Hello string"
object, and henceforth we can access via its variable name a_string.
"

Source:
http://sebastianraschka.com/Articles/2014_python_scope_and_namespaces.html

More:
http://namespaces.readthedocs.io/en/latest

https://www.python.org/dev/peps/pep-0020/



More information about the Tendrl-devel mailing list