>
> Let’s begin with some definitions.
>
> A *namespace* is a mapping from names to objects. Most namespaces are
> currently implemented as Python dictionaries, but that’s normally not
> noticeable in any way (except for performance), and it may change in the
> future. Examples of namespaces are: the set of built-in names (containing
> functions such as abs()<http://docs.python.org/2/library/functions.html#abs>,
> and built-in exception names); the global names in a module; and the local
> names in a function invocation. In a sense the set of attributes of an
> object also form a namespace. The important thing to know about namespaces
> is that there is absolutely no relation between names in different
> namespaces; for instance, two different modules may both define a function
> maximize without confusion — users of the modules must prefix it with the
> module name.
>
   The above paragraph was extracted from the description about namespaces
from the Python tutorial(Python Scopes and
Namespaces<http://docs.python.org/2/tutorial/classes.html#python-scopes-and-namespaces>).I
do not understand what is meant by "A *namespace* is a mapping from names
to objects". How I understand to be a namespace is a particular space
within which a particular name is unique.For a example within the space set
of built-in names the name "abs()" is used to denote the function which
returns the absolute value of a number and no other function(operation) can
be named abs() as a built-in function.Am I right?. But what is meant by "A
*namespace* is a mapping from names to objects"
Thanks Varuna
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to