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
662d76ee
Commit
662d76ee
authored
Jun 25, 2000
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typos and errors noticed by Skip Montanaro
parent
c3804667
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
Doc/whatsnew/whatsnew20.tex
Doc/whatsnew/whatsnew20.tex
+19
-14
No files found.
Doc/whatsnew/whatsnew20.tex
View file @
662d76ee
\documentclass
{
howto
}
\documentclass
{
howto
}
\title
{
What's New in Python 1.6
}
\title
{
What's New in Python 1.6
}
\release
{
0.0
2
}
\release
{
0.0
3
}
\author
{
A.M. Kuchling and Moshe Zadka
}
\author
{
A.M. Kuchling and Moshe Zadka
}
\authoraddress
{
\email
{
amk1@bigfoot.com
}
,
\email
{
moshez@math.huji.ac.il
}
}
\authoraddress
{
\email
{
amk1@bigfoot.com
}
,
\email
{
moshez@math.huji.ac.il
}
}
\begin{document}
\begin{document}
...
@@ -55,14 +55,15 @@ escapes can be used for characters up to U+01FF, which is represented
...
@@ -55,14 +55,15 @@ escapes can be used for characters up to U+01FF, which is represented
by
\code
{
\e
777
}
.
by
\code
{
\e
777
}
.
Unicode strings, just like regular strings, are an immutable sequence
Unicode strings, just like regular strings, are an immutable sequence
type, so they can be indexed and sliced. They also have an
type. They can be indexed and sliced, but not modified in place.
\method
{
encode(
\optional
{
\var
{
encoding
}}
)
}
method that returns an
Unicode strings have an
\method
{
encode(
\optional
{
\var
{
encoding
}}
)
}
method
8-bit string in the desired encoding. Encodings are named by strings,
that returns an 8-bit string in the desired encoding. Encodings are
such as
\code
{
'ascii'
}
,
\code
{
'utf-8'
}
,
\code
{
'iso-8859-1'
}
, or
named by strings, such as
\code
{
'ascii'
}
,
\code
{
'utf-8'
}
,
whatever. A codec API is defined for implementing and registering new
\code
{
'iso-8859-1'
}
, or whatever. A codec API is defined for
encodings that are then available throughout a Python program. If an
implementing and registering new encodings that are then available
encoding isn't specified, the default encoding is usually 7-bit ASCII,
throughout a Python program. If an encoding isn't specified, the
though it can be changed for your Python installation by calling the
default encoding is usually 7-bit ASCII, though it can be changed for
your Python installation by calling the
\function
{
sys.setdefaultencoding(
\var
{
encoding
}
)
}
function in a
\function
{
sys.setdefaultencoding(
\var
{
encoding
}
)
}
function in a
customized version of
\file
{
site.py
}
.
customized version of
\file
{
site.py
}
.
...
@@ -352,8 +353,8 @@ digit.
...
@@ -352,8 +353,8 @@ digit.
Taking the
\function
{
repr()
}
of a float now uses a different
Taking the
\function
{
repr()
}
of a float now uses a different
formatting precision than
\function
{
str()
}
.
\function
{
repr()
}
uses
formatting precision than
\function
{
str()
}
.
\function
{
repr()
}
uses
``
%.17g''
format string for C's \function{sprintf()}, while
\code
{
\%
.17g
}
format string for C's
\function
{
sprintf()
}
, while
\function
{
str()
}
uses
``
%.12g'' as before. The effect is that
\function
{
str()
}
uses
\code
{
\%
.12g
}
as before. The effect is that
\function
{
repr()
}
may occasionally show more decimal places than
\function
{
repr()
}
may occasionally show more decimal places than
\function
{
str()
}
, for numbers
\function
{
str()
}
, for numbers
For example, the number 8.1 can't be represented exactly in binary, so
For example, the number 8.1 can't be represented exactly in binary, so
...
@@ -437,14 +438,18 @@ processor, mostly by Trent Mick of ActiveState. (Confusingly, \code{sys.platfor
...
@@ -437,14 +438,18 @@ processor, mostly by Trent Mick of ActiveState. (Confusingly, \code{sys.platfor
Win64 because it seems that for ease of porting, MS Visual C++ treats code
Win64 because it seems that for ease of porting, MS Visual C++ treats code
as 32 bit.
as 32 bit.
) PythonWin also supports Windows CE; see the Python CE page at
) PythonWin also supports Windows CE; see the Python CE page at
\url
{
http://
www
.python.net/crew/mhammond/ce/
}
for more information.
\url
{
http://
starship
.python.net/crew/mhammond/ce/
}
for more information.
An attempt has been made to alleviate one of Python's warts, the
An attempt has been made to alleviate one of Python's warts, the
often-confusing
\exception
{
NameError
}
exception when code refers to a
often-confusing
\exception
{
NameError
}
exception when code refers to a
local variable before the variable has been assigned a value. For
local variable before the variable has been assigned a value. For
example, the following code raises an exception on the
\keyword
{
print
}
example, the following code raises an exception on the
\keyword
{
print
}
statement in both 1.5.2 and 1.6; in 1.5.2 a
\exception
{
NameError
}
statement in both 1.5.2 and 1.6; in 1.5.2 a
\exception
{
NameError
}
exception is raised, while 1.6 raises
\exception
{
UnboundLocalError
}
.
exception is raised, while 1.6 raises a new
\exception
{
UnboundLocalError
}
exception.
\exception
{
UnboundLocalError
}
is a subclass of
\exception
{
NameError
}
,
so any existing code that expects
\exception
{
NameError
}
to be raised
should still work.
\begin{verbatim}
\begin{verbatim}
def f():
def f():
...
@@ -483,7 +488,7 @@ This means you no longer have to remember to write code such as
...
@@ -483,7 +488,7 @@ This means you no longer have to remember to write code such as
The
\file
{
Python/importdl.c
}
file, which was a mass of
\#
ifdefs to
The
\file
{
Python/importdl.c
}
file, which was a mass of
\#
ifdefs to
support dynamic loading on many different platforms, was cleaned up
support dynamic loading on many different platforms, was cleaned up
a
re
reorganized by Greg Stein.
\file
{
importdl.c
}
is now quite small,
a
nd
reorganized by Greg Stein.
\file
{
importdl.c
}
is now quite small,
and platform-specific code has been moved into a bunch of
and platform-specific code has been moved into a bunch of
\file
{
Python/dynload
_
*.c
}
files.
\file
{
Python/dynload
_
*.c
}
files.
...
...
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