list()
converts any sequence to a new list.
Note that when the argument is a list, the return value is a fresh
copy, similar to what would be returned by a[:]
.TypeError
exception
rather than KeyError
.__del__
methods. When a __del__
method
raises an exception, a warning is written to sys.stderr
and the
exception is ignored. Formerly, such exceptions were ignored without
warning. (Propagating the exception is not an option since it it is
invoked from an object finalizer, which cannot return any kind of
status or error.) (Buglet: The new behavior, while needed in order to
debug failing __del__
methods, is occasionally annoying,
because if affects the program's standard error stream. It honors
assignments to sys.stderr
, so it can be redirected from within
a program if desired.)__file__
attribute. This attribute is not
present for built-in or frozen modules. It points to the shared
library file for dynamically loaded modules. (Buglet: this may be a
relative path and is stored in the .pyc
file on compilation.
If you manipulate the current directory with os.chdir()
or move
.pyc
files around, the value may be incorrect.)