f.read(0)
and
f.readline(0)
now return an empty string rather than
reading an unlimited number of bytes. For the latter, omit the
argument altogether or pass a negative value.
sys.platform
, has been added. It
specifies the current platform, e.g. sunos5
or linux1
.
input()
and raw_input()
now use
the GNU readline library when it has been configured (formerly, only
interactive input to the interpreter itself was read using GNU
readline). The GNU readline library provides elaborate line editing
and history. The Python debugger (pdb
) is the first
beneficiary of this change.
globals()
and locals()
,
provide access to dictionaries containming current global and local
variables, respectively. (These augment rather than replace
vars()
, which returns the current local variables when called
without an argument, and a module's global variables when called with
an argument of type module.)
compile()
now takes a third possible
value for the kind of code to be compiled: specifying 'single'
generates code for a single interactive statement, which prints the
output of expression statements that evaluate to something else than
None
.