Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b094ad07
Commit
b094ad07
authored
Jul 16, 2003
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mention list.index; more small textual changes
parent
ff750e55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
26 deletions
+30
-26
Doc/whatsnew/whatsnew23.tex
Doc/whatsnew/whatsnew23.tex
+30
-26
No files found.
Doc/whatsnew/whatsnew23.tex
View file @
b094ad07
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
% To do:
% To do:
% PYTHONINSPECT
% PYTHONINSPECT
% list.index
% file.encoding
% file.encoding
% doctest extensions
% doctest extensions
% new version of IDLE
% new version of IDLE
...
@@ -424,12 +423,12 @@ and implemented by Raymond D. Hettinger.}
...
@@ -424,12 +423,12 @@ and implemented by Raymond D. Hettinger.}
A standard package for writing logs,
\module
{
logging
}
, has been added
A standard package for writing logs,
\module
{
logging
}
, has been added
to Python 2.3. It provides a powerful and flexible mechanism for
to Python 2.3. It provides a powerful and flexible mechanism for
components to generate logging output which can then be filtered and
generating logging output which can then be filtered and processed in
processed in various ways. A standard configuration file
format can
various ways. A configuration file written in a standard
format can
be used to control the logging behavior of a program. Python
's
be used to control the logging behavior of a program. Python
standard library
includes handlers that will write log records to
includes handlers that will write log records to
standard error or to a file or socket, send them to the system log, or
standard error or to a file or socket, send them to the system log, or
even e-mail them to a particular address
, and of course
it's also
even e-mail them to a particular address
; of course,
it's also
possible to write your own handler classes.
possible to write your own handler classes.
The
\class
{
Logger
}
class is the primary class.
The
\class
{
Logger
}
class is the primary class.
...
@@ -469,7 +468,7 @@ CRITICAL:root:Critical error -- shutting down
...
@@ -469,7 +468,7 @@ CRITICAL:root:Critical error -- shutting down
In the default configuration, informational and debugging messages are
In the default configuration, informational and debugging messages are
suppressed and the output is sent to standard error. You can enable
suppressed and the output is sent to standard error. You can enable
the display of information and debugging messages by calling the
the display of information
al
and debugging messages by calling the
\method
{
setLevel()
}
method on the root logger.
\method
{
setLevel()
}
method on the root logger.
Notice the
\function
{
warning()
}
call's use of string formatting
Notice the
\function
{
warning()
}
call's use of string formatting
...
@@ -553,7 +552,7 @@ A Boolean type was added to Python 2.3. Two new constants were added
...
@@ -553,7 +552,7 @@ A Boolean type was added to Python 2.3. Two new constants were added
to the
\module
{__
builtin
__}
module,
\constant
{
True
}
and
to the
\module
{__
builtin
__}
module,
\constant
{
True
}
and
\constant
{
False
}
. (
\constant
{
True
}
and
\constant
{
False
}
. (
\constant
{
True
}
and
\constant
{
False
}
constants were added to the built-ins
\constant
{
False
}
constants were added to the built-ins
in Python 2.2.1, but the 2.2.1 versions
simply have
integer values of
in Python 2.2.1, but the 2.2.1 versions
are simply set to
integer values of
1 and 0 and aren't a different type.)
1 and 0 and aren't a different type.)
The type object for this new type is named
The type object for this new type is named
...
@@ -596,10 +595,10 @@ Python's Booleans were \emph{not} added for the sake of strict
...
@@ -596,10 +595,10 @@ Python's Booleans were \emph{not} added for the sake of strict
type-checking. A very strict language such as Pascal would also
type-checking. A very strict language such as Pascal would also
prevent you performing arithmetic with Booleans, and would require
prevent you performing arithmetic with Booleans, and would require
that the expression in an
\keyword
{
if
}
statement always evaluate to a
that the expression in an
\keyword
{
if
}
statement always evaluate to a
Boolean
. Python is not this strict, and it
never will be, as
Boolean
result. Python is not this strict and
never will be, as
\pep
{
285
}
explicitly says. This means you can still use any
\pep
{
285
}
explicitly says. This means you can still use any
expression in an
\keyword
{
if
}
statement, even ones that evaluate to a
expression in an
\keyword
{
if
}
statement, even ones that evaluate to a
list or tuple or some random object
, and t
he Boolean type is a
list or tuple or some random object
. T
he Boolean type is a
subclass of the
\class
{
int
}
class so that arithmetic using a Boolean
subclass of the
\class
{
int
}
class so that arithmetic using a Boolean
still works.
still works.
...
@@ -642,7 +641,7 @@ string.
...
@@ -642,7 +641,7 @@ string.
Python now has a flexible framework to add different processing
Python now has a flexible framework to add different processing
strategies. New error handlers can be added with
strategies. New error handlers can be added with
\function
{
codecs.register
_
error
}
. C
odecs then can access the error
\function
{
codecs.register
_
error
}
, and c
odecs then can access the error
handler with
\function
{
codecs.lookup
_
error
}
. An equivalent C API has
handler with
\function
{
codecs.lookup
_
error
}
. An equivalent C API has
been added for codecs written in C. The error handler gets the
been added for codecs written in C. The error handler gets the
necessary state information such as the string being converted, the
necessary state information such as the string being converted, the
...
@@ -680,7 +679,7 @@ Archive: /tmp/example.zip
...
@@ -680,7 +679,7 @@ Archive: /tmp/example.zip
--------
-------
--------
-------
8467
1
file
8467
1
file
amk@nyman:~
/
src
/
python
$
./python
amk@nyman:~
/
src
/
python
$
./python
Python 2.3
a0 (#1, Dec 30 2002
, 19:54:32)
Python 2.3
(#1, Aug 1 2003
, 19:54:32)
>>> import sys
>>> import sys
>>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path
>>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path
>>> import jwzthreading
>>> import jwzthreading
...
@@ -721,11 +720,11 @@ Distutils\label{section-pep301}}
...
@@ -721,11 +720,11 @@ Distutils\label{section-pep301}}
Support for the long-requested Python catalog makes its first
Support for the long-requested Python catalog makes its first
appearance in 2.3.
appearance in 2.3.
The
core component
is the new Distutils
\command
{
register
}
command.
The
heart of the catalog
is the new Distutils
\command
{
register
}
command.
Running
\code
{
python setup.py register
}
will collect the metadata
Running
\code
{
python setup.py register
}
will collect the metadata
describing a package, such as its name, version, maintainer,
describing a package, such as its name, version, maintainer,
description,
\&
c., and send it to a central catalog server. The
description,
\&
c., and send it to a central catalog server. The
catalog is available from
\url
{
http://www.python.org/pypi
}
.
resulting
catalog is available from
\url
{
http://www.python.org/pypi
}
.
To make the catalog a bit more useful, a new optional
To make the catalog a bit more useful, a new optional
\var
{
classifiers
}
keyword argument has been added to the Distutils
\var
{
classifiers
}
keyword argument has been added to the Distutils
...
@@ -845,7 +844,8 @@ Implemented by Just van~Rossum.
...
@@ -845,7 +844,8 @@ Implemented by Just van~Rossum.
Comma-separated files are a format frequently used for exporting data
Comma-separated files are a format frequently used for exporting data
from databases and spreadsheets. Python 2.3 adds a parser for
from databases and spreadsheets. Python 2.3 adds a parser for
comma-separated files.
comma-separated files.
The format is deceptively simple at first glance:
Comma-separated format is deceptively simple at first glance:
\begin{verbatim}
\begin{verbatim}
Costs,150,200,3.95
Costs,150,200,3.95
...
@@ -876,7 +876,7 @@ The field separator isn't limited to the comma and can be changed to
...
@@ -876,7 +876,7 @@ The field separator isn't limited to the comma and can be changed to
any character, and so can the quoting and line-ending characters.
any character, and so can the quoting and line-ending characters.
Different dialects of comma-separated files can be defined and
Different dialects of comma-separated files can be defined and
registered; currently there are two
, both for
Microsoft Excel.
registered; currently there are two
dialects, both used by
Microsoft Excel.
A separate
\class
{
csv.writer
}
class will generate comma-separated files
A separate
\class
{
csv.writer
}
class will generate comma-separated files
from a succession of tuples or lists, quoting strings that contain the
from a succession of tuples or lists, quoting strings that contain the
delimiter.
delimiter.
...
@@ -902,10 +902,10 @@ class.
...
@@ -902,10 +902,10 @@ class.
The solution was to invent a new pickle protocol. The
The solution was to invent a new pickle protocol. The
\function
{
pickle.dumps()
}
function has supported a text-or-binary flag
\function
{
pickle.dumps()
}
function has supported a text-or-binary flag
for a long time. In 2.3, this flag is redefined from a Boolean to an
for a long time. In 2.3, this flag is redefined from a Boolean to an
integer
;
0 is the old text-mode pickle format, 1 is the old binary
integer
:
0 is the old text-mode pickle format, 1 is the old binary
format, and now 2 is a new 2.3-specific format.
(
A new constant,
format, and now 2 is a new 2.3-specific format. A new constant,
\constant
{
pickle.HIGHEST
_
PROTOCOL
}
, can be used to select the fanciest
\constant
{
pickle.HIGHEST
_
PROTOCOL
}
, can be used to select the fanciest
protocol available.
)
protocol available.
Unpickling is no longer considered a safe operation. 2.2's
Unpickling is no longer considered a safe operation. 2.2's
\module
{
pickle
}
provided hooks for trying to prevent unsafe classes
\module
{
pickle
}
provided hooks for trying to prevent unsafe classes
...
@@ -942,7 +942,7 @@ legal Python syntax: \code{L[1:10:2]}, \code{L[:-1:1]},
...
@@ -942,7 +942,7 @@ legal Python syntax: \code{L[1:10:2]}, \code{L[:-1:1]},
\code
{
L[::-1]
}
. This was added to Python at the request of
\code
{
L[::-1]
}
. This was added to Python at the request of
the developers of Numerical Python, which uses the third argument
the developers of Numerical Python, which uses the third argument
extensively. However, Python's built-in list, tuple, and string
extensively. However, Python's built-in list, tuple, and string
sequence types have never supported this feature,
and you got
a
sequence types have never supported this feature,
raising
a
\exception
{
TypeError
}
if you tried it. Michael Hudson contributed a
\exception
{
TypeError
}
if you tried it. Michael Hudson contributed a
patch to fix this shortcoming.
patch to fix this shortcoming.
...
@@ -988,7 +988,7 @@ regular slice can be used to change the length of the sequence:
...
@@ -988,7 +988,7 @@ regular slice can be used to change the length of the sequence:
\end{verbatim}
\end{verbatim}
Extended slices aren't this flexible. When assigning to an extended
Extended slices aren't this flexible. When assigning to an extended
slice the list on the right hand side of the statement must contain
slice
,
the list on the right hand side of the statement must contain
the same number of items as the slice it is replacing:
the same number of items as the slice it is replacing:
\begin{verbatim}
\begin{verbatim}
...
@@ -1094,7 +1094,7 @@ as described in section~\ref{section-slices} of this document.
...
@@ -1094,7 +1094,7 @@ as described in section~\ref{section-slices} of this document.
\item
A new built-in function,
\function
{
sum(
\var
{
iterable
}
,
\var
{
start
}
=0)
}
,
\item
A new built-in function,
\function
{
sum(
\var
{
iterable
}
,
\var
{
start
}
=0)
}
,
adds up the numeric items in the iterable object and returns their sum.
adds up the numeric items in the iterable object and returns their sum.
\function
{
sum()
}
only accepts numbers, meaning that you can't use it
\function
{
sum()
}
only accepts numbers, meaning that you can't use it
to concatenate a bunch of strings
, for example
. (Contributed by Alex
to concatenate a bunch of strings. (Contributed by Alex
Martelli.)
Martelli.)
\item
\code
{
list.insert(
\var
{
pos
}
,
\var
{
value
}
)
}
used to
\item
\code
{
list.insert(
\var
{
pos
}
,
\var
{
value
}
)
}
used to
...
@@ -1103,6 +1103,11 @@ negative. The behaviour has now been changed to be consistent with
...
@@ -1103,6 +1103,11 @@ negative. The behaviour has now been changed to be consistent with
slice indexing, so when
\var
{
pos
}
is -1 the value will be inserted
slice indexing, so when
\var
{
pos
}
is -1 the value will be inserted
before the last element, and so forth.
before the last element, and so forth.
\item
\code
{
list.index(
\var
{
value
}
)
}
, which searches for
\var
{
value
}
within the list and returns its index, now takes optional
\var
{
start
}
and
\var
{
stop
}
arguments to limit the search to
only part of the list.
\item
Dictionaries have a new method,
\method
{
pop(
\var
{
key
}
\optional
{
,
\item
Dictionaries have a new method,
\method
{
pop(
\var
{
key
}
\optional
{
,
\var
{
default
}}
)
}
, that returns the value corresponding to
\var
{
key
}
\var
{
default
}}
)
}
, that returns the value corresponding to
\var
{
key
}
and removes that key/value pair from the dictionary. If the requested
and removes that key/value pair from the dictionary. If the requested
...
@@ -1186,8 +1191,8 @@ now trigger \exception{PendingDeprecationWarning}.
...
@@ -1186,8 +1191,8 @@ now trigger \exception{PendingDeprecationWarning}.
\item
The method resolution order used by new-style classes has
\item
The method resolution order used by new-style classes has
changed, though you'll only notice the difference if you have a really
changed, though you'll only notice the difference if you have a really
complicated inheritance hierarchy.
(
Classic classes are unaffected by
complicated inheritance hierarchy. Classic classes are unaffected by
this change.
)
Python 2.2 originally used a topological sort of a
this change. Python 2.2 originally used a topological sort of a
class's ancestors, but 2.3 now uses the C3 algorithm as described in
class's ancestors, but 2.3 now uses the C3 algorithm as described in
the paper
\ulink
{
``A Monotonic Superclass Linearization for
the paper
\ulink
{
``A Monotonic Superclass Linearization for
Dylan''
}{
http://www.webcom.com/haahr/dylan/linearization-oopsla96.html
}
.
Dylan''
}{
http://www.webcom.com/haahr/dylan/linearization-oopsla96.html
}
.
...
@@ -1261,8 +1266,7 @@ True
...
@@ -1261,8 +1266,7 @@ True
\end{verbatim}
\end{verbatim}
Note that this doesn't tell you where the substring starts; if you
Note that this doesn't tell you where the substring starts; if you
need that information, you must use the
\method
{
find()
}
method
need that information, use the
\method
{
find()
}
string method.
instead.
\item
The
\method
{
strip()
}
,
\method
{
lstrip()
}
, and
\method
{
rstrip()
}
\item
The
\method
{
strip()
}
,
\method
{
lstrip()
}
, and
\method
{
rstrip()
}
string methods now have an optional argument for specifying the
string methods now have an optional argument for specifying the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment