What does x[:]=[4,5,6] mean?

Franz GEIGER fgeiger at datec.at
Sat Jun 2 13:22:25 EDT 2001


In site.py I saw
sys.path[:] = L
What does this mean? Why is the '[:]'? Why not simply
sy.path = L ?

Best regards
Franz

P.S.: The whole sequence is:

# This ensures that the initial path provided by the interpreter contains
# only absolute pathnames, even if we're running from the build directory.
L = []
for dir in sys.path:
    dir = makepath(dir)
    if dir not in L:
        L.append(dir)
sys.path[:] = L
del dir, L








More information about the Python-list mailing list