list vs tuple

Sheila King sheila at spamcop.net
Thu Mar 29 04:58:03 CEST 2001


On Wed, 28 Mar 2001 09:40:38 -0800 (PST), "Sean 'Shaleh' Perry"
<shaleh at valinux.com> wrote in comp.lang.python in article
<mailman.985801119.10859.python-list at python.org>:

:On 28-Mar-2001 Brian Quinlan wrote:
:> I'm not sure that this is a reasonable piece of self documentation since
:> dir_list can change. It is the tuple ('/path', '/foo/bar', '/baz/bat/files')
:> that cannot change. Would you say that x = 5 documents that x cannot change?
:> 
:
:dir_list is declared as a tuple, which is as close to a const one can find in
:python.

>>> dir_list = ('/path', '/foo/bar', '/baz/bat/files')
>>> print dir_list
('/path', '/foo/bar', '/baz/bat/files')
>>> dir_list = ('/usr/bin/env', '/usr/bin', '')
>>> print dir_list
('/usr/bin/env', '/usr/bin', '')
>>> 

I don't see how dir_list is a constant?

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/




More information about the Python-list mailing list