@@ -18,36 +18,38 @@ http://starship.python.net/crew/amk/python/writing/new-python/.
18
18
What's new in 2.0 beta 2 (since beta 1)?
19
19
========================================
20
20
21
+
21
22
Core language, builtins, and interpreter
22
23
23
24
- Add support for unbounded ints in %d,i,u,x,X,o formats; for example
24
- "%d" % 2L**64 == "18446744073709551616"
25
+ "%d" % 2L**64 == "18446744073709551616".
26
+
27
+ - Add -h and -V command line options to print the usage message and
28
+ Python version number and exit immediately.
25
29
26
- - Add -h and -V flags to print the usage message and Python version
27
- number and exit immediately.polation.
28
30
29
31
Standard library and extensions
30
32
31
- - array: reverse method of array now works. buffer_info now does
33
+ - array: reverse() method of array now works. buffer_info() now does
32
34
argument checking; it still takes no arguments.
33
35
34
- - asyncore/asynchat: included most recent version from Sam Rushing
36
+ - asyncore/asynchat: Included most recent version from Sam Rushing.
35
37
36
- - cgi: accept & or ; as separate characters when parsing form data
38
+ - cgi: Accept '&' or ';' as separator characters when parsing form data.
37
39
38
- - CGIHTTPServer: now works on Windows (and perhaps even Mac).
40
+ - CGIHTTPServer: Now works on Windows (and perhaps even Mac).
39
41
40
42
- ConfigParser: When reading the file, options spelled in upper case
41
- letters are now accessible .
43
+ letters are now correctly converted to lowercase .
42
44
43
45
- copy: Copy Unicode objects atomically.
44
46
45
- - cPickle: fails gracefully when copy_reg can't be imported
47
+ - cPickle: Fail gracefully when copy_reg can't be imported.
46
48
47
- - cStringIO: implemented readlines method.
49
+ - cStringIO: Implemented readlines() method.
48
50
49
- - dbm: Add set and setdefault methods to dbm object. Add constant
50
- library to module that names the library used. Better doc strings
51
+ - dbm: Add set() and setdefault() methods to dbm object. Add constant
52
+ ` library' to module that names the library used. Better doc strings
51
53
and argument checking. Uses configure to determine which ndbm.h
52
54
file to include; Berkeley DB's nbdm is now an option.
53
55
@@ -61,68 +63,69 @@ Standard library and extensions
61
63
found by the collector will be saved in gc.garbage. This is useful
62
64
for debugging a program that creates reference cycles.
63
65
64
- - httplib: Three changes. Restore support for set_debuglevel feature
66
+ - httplib: Three changes: Restore support for set_debuglevel feature
65
67
of HTTP class. Do not close socket on zero-length response. Do not
66
68
crash when server sends invalid content-length header.
67
69
68
- - mailbox: XXX conformance to maildir specification ???
70
+ - mailbox: Mailbox class conforms better to qmail specifications.
69
71
70
- - operator: Add contains, invert, __invert__ as aliases for
71
- __contains__, inv, and __inv__ respectively.
72
+ - operator: Add contains() , invert() , __invert__() as aliases for
73
+ __contains__() , inv() , and __inv__() respectively.
72
74
73
- - os: Add support for popen2 and popen3 on all platforms where fork
74
- exists.
75
+ - os: Add support for popen2() and popen3() on all platforms where
76
+ fork() exists. (popen4() is still in the works.)
75
77
76
- - os: (Windows only) Add startfile function that acts like double-
78
+ - os: (Windows only: ) Add startfile() function that acts like double-
77
79
clicking on a file in Explorer (or passing the file name to the
78
80
DOS "start" command).
79
81
80
- - os.path: (Windows, DOS) Treat trailing colon correctly in
82
+ - os.path: (Windows, DOS: ) Treat trailing colon correctly in
81
83
os.path.join. os.path.join("a:", "b") yields "a:b".
82
84
83
85
- pickle: Now raises ValueError when an invalid pickle that contains
84
86
a non-string repr where a string repr was expected. This behavior
85
87
matches cPickle.
86
88
87
- - posixfile: XXX remove __del__ method ???
89
+ - posixfile: Remove broken __del__() method.
88
90
89
- - py_compile: support \r in source file
91
+ - py_compile: support CR+LF line terminators in source file.
90
92
91
93
- readline: Does not immediately exit when ^C is hit when readline and
92
- threads are configured. Adds defintion of rl_library_version.
94
+ threads are configured. Adds defintion of rl_library_version. (The
95
+ latter addition requires GNU readline 2.2 or later.)
93
96
94
97
- rfc822: Domain literals returned by AddrlistClass method
95
- getdomainliteral are now properly wrapped in brackets.
98
+ getdomainliteral() are now properly wrapped in brackets.
96
99
97
100
- site: sys.setdefaultencoding() should only be called in case the
98
101
standard default encoding ("ascii") is changed. This saves quite a
99
102
few cycles during startup since the first call to
100
103
setdefaultencoding() will initialize the codec registry and the
101
104
encodings package.
102
105
103
- - socket: Support for size hint in readlines method of object returned
104
- by makefile.
106
+ - socket: Support for size hint in readlines() method of object returned
107
+ by makefile() .
105
108
106
- - sre: Added experimental expand method to match objects. Does not
109
+ - sre: Added experimental expand() method to match objects. Does not
107
110
user buffer interface on Unicode strings. Does not hang if group id
108
111
is followed by whitespace.
109
112
110
- - StringIO: size hint in readlines is now supported as documented.
113
+ - StringIO: size hint in readlines() is now supported as documented.
111
114
112
115
- struct: Check ranges for bytes and shorts.
113
116
114
117
- urllib: Improved handling of win32 proxy settings. Fixed quote and
115
- quote_plus functions so that the always encode a comma ',' .
118
+ quote_plus functions so that the always encode a comma.
116
119
117
120
- Tkinter: Image objects are now guaranteed to have unique ids. Set
118
121
event.delta to zero if Tk version doesn't support mousewheel.
119
122
Removed some debugging prints.
120
123
121
- - UserList: now implements __contains__.
124
+ - UserList: now implements __contains__() .
122
125
123
- - webbrower: On Windows, use os.startfile instead of os.popen, which
124
- works around a bug in certain versions of Norton AntiVirus that
125
- leads directly to a Blue Screen freeze.
126
+ - webbrower: On Windows, use os.startfile() instead of os.popen(),
127
+ which works around a bug in Norton AntiVirus 2000 that leads directly
128
+ to a Blue Screen freeze.
126
129
127
130
- xml: New version detection code allows PyXML to override standard
128
131
XML package if PyXML version is greater than 0.6.1.
@@ -133,6 +136,7 @@ Standard library and extensions
133
136
134
137
- XXX pyexpat: XXX
135
138
139
+
136
140
C API
137
141
138
142
- Add three new convenience functions for module initialization --
@@ -143,38 +147,47 @@ C API
143
147
removed and add #error to Python.h if NULL isn't defined after
144
148
#include of stdio.h.
145
149
146
- - Py_PROTO macros that were removed in 2.0b1 have been restored for
150
+ - Py_PROTO() macros that were removed in 2.0b1 have been restored for
147
151
backwards compatibility (at the source level) with old extensions.
148
152
149
- - XXX PyOS_sighandler_t, PyOS_getsig, PyOS_setsig
153
+ - A wrapper API was added for signal() and sigaction(). Instead of
154
+ either function, always use PyOS_getsig() to get a signal handler
155
+ and PyOS_setsig() to set one. A new convenience typedef
156
+ PyOS_sighandler_t is defined for the type of signal handlers.
150
157
151
- - Add PyString_AsStringAndSize call that provides access to the
158
+ - Add PyString_AsStringAndSize() function that provides access to the
152
159
internal data buffer and size of a string object -- or the default
153
160
encoded version of a Unicode object.
154
161
162
+ - The standard header <limits.h> is now included by Python.h (if it
163
+ exists).
164
+
165
+
155
166
Internals
156
167
157
168
- On Unix, fix code for finding Python installation directory so that
158
169
it works when argv[0] is a relative path.
159
170
160
- - Added a true unicode_internal_encode function and fixed the
161
- unicode_internal_decode function to support Unicode objects directly
171
+ - Added a true unicode_internal_encode() function and fixed the
172
+ unicode_internal_decode function() to support Unicode objects directly
162
173
rather than by generating a copy of the object.
163
174
164
175
- Several of the internal Unicode tables are much smaller now, and
165
176
the source code should be much friendlier to weaker compilers.
166
177
178
+
167
179
Build and platform-specific issues
168
180
169
181
- Better support of GNU Pth via --with-pth configure option.
170
182
171
- - Fix linker problems on Reliant UNIX
183
+ - Fix linker problems on Reliant UNIX.
172
184
173
185
- Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
174
186
Don't define MS_SYNC to be zero when it is undefined. Added missing
175
187
prototypes in posixmodule.c.
176
188
177
- - Improved support for HP-UX build
189
+ - Improved support for HP-UX build -- threads should now be correctly
190
+ configured (on HP-UX 10.20 and 11.00).
178
191
179
192
180
193
What's new in 2.0 beta 1?
@@ -289,15 +302,15 @@ from another list (or lists). The simplest form is:
289
302
[<expression> for <variable> in <sequence>]
290
303
291
304
For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
292
- This is more efficient than map() with a lambda .
305
+ This is more efficient than a for loop with a list.append() call .
293
306
294
307
You can also add a condition:
295
308
296
309
[<expression> for <variable> in <sequence> if <condition>]
297
310
298
311
For example, [w for w in words if w == w.lower()] would yield the list
299
312
of words that contain no uppercase characters. This is more efficient
300
- than filter() with a lambda .
313
+ than a for loop with an if statement and a list.append() call .
301
314
302
315
You can also have nested for loops and more than one 'if' clause. For
303
316
example, here's a function that flattens a sequence of sequences::
@@ -615,4 +628,25 @@ to ensure that Tcl/Tk can find all its files.
615
628
[This was new in 1.6] The Windows installer now installs by default in
616
629
\Python20\ on the default volume, instead of \Program Files\Python-2.0\.
617
630
631
+
632
+ Updates to the changes between 1.5.2 and 1.6
633
+ --------------------------------------------
634
+
635
+ The 1.6 NEWS file can't be changed after the release is done, so here
636
+ is some late-breaking news:
637
+
638
+ New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
639
+ and changes to getlocale() and setlocale().
640
+
641
+ The new module is now enabled per default.
642
+
643
+ It is not true that the encodings codecs cannot be used for normal
644
+ strings: the string.encode() (which is also present on 8-bit strings
645
+ !) allows using them for 8-bit strings too, e.g. to convert files from
646
+ cp1252 (Windows) to latin-1 or vice-versa.
647
+
648
+ Japanese codecs are available from Tamito KAJIYAMA:
649
+ http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
650
+
651
+
618
652
======================================================================
0 commit comments