[Tutor] sys module - what does "It is always available" mean in the docs?
Dave Angel
davea at davea.name
Thu Aug 21 12:32:19 CEST 2014
"Flynn, Stephen (L & P - IT)" <Steve.Flynn at capita.co.uk> Wrote in
message:
> The documentation (https://docs.python.org/3/library/sys.html) for
> Python 3.4.1 says that "This module provides access to some variables
> used or maintained by the interpreter and to functions that interact
> strongly with the interpreter. It is always available."
>
> I interpreted that last sentence as "It's built in", so I made the
> assumption I didn't need to import it in order to use it.
>
The module is available, so the import statement cannot fail. In
fact it's already imported and in the cache. Last time I looked,
there were 42 modules in the cache by the time your code gets
control (see sys.modules). They're not all promised, but sys and
time are.
If sys is broken, the interpreter won't go.
--
DaveA
More information about the Tutor
mailing list