Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1 | What's new in this release? |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 2 | =========================== |
| 3 | |
Guido van Rossum | 7ea639b | 1997-11-26 16:36:28 +0000 | [diff] [blame] | 4 | Below is a list of all relevant changes since the release 1.4. The |
| 5 | most recent changes (from 1.5a3 to 1.5a4 and from 1.5a4 to 1.5b1) are |
| 6 | listed in separate sections at the end. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 7 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 8 | A note on attributions: while I have sprinkled some names throughout |
Guido van Rossum | 7ea639b | 1997-11-26 16:36:28 +0000 | [diff] [blame] | 9 | here, I'm grateful to many more people who remain unnamed. You may |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 10 | find your name in the ACKS file. If you believe you deserve more |
| 11 | credit, let me know and I'll add you to the list! |
| 12 | |
| 13 | |
Guido van Rossum | 7ea639b | 1997-11-26 16:36:28 +0000 | [diff] [blame] | 14 | ====================================================================== |
| 15 | |
| 16 | From 1.4 to 1.5a3 |
| 17 | ================= |
| 18 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 19 | Security |
| 20 | -------- |
| 21 | |
| 22 | - If you are using the setuid script C wrapper (Misc/setuid-prog.c), |
| 23 | please use the new version. The old version has a huge security leak. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 24 | |
| 25 | Miscellaneous |
| 26 | ------------- |
| 27 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 28 | - Because of various (small) incompatible changes in the Python |
| 29 | bytecode interpreter, the magic number for .pyc files has changed |
| 30 | again. |
| 31 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 32 | - The default module search path is now much saner. Both on Unix and |
| 33 | Windows, it is essentially derived from the path to the executable |
| 34 | (which can be overridden by setting the environment variable |
| 35 | $PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in |
| 36 | front of the default path, like in Unix (instead of overriding the |
| 37 | default path). On Windows, the directory containing the executable is |
| 38 | added to the end of the path. |
| 39 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 40 | - A new version of python-mode.el for Emacs has been included. Also, |
| 41 | a new file ccpy-style.el has been added to configure Emacs cc-mode for |
| 42 | the preferred style in Python C sources. |
| 43 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 44 | - On Unix, when using sys.argv[0] to insert the script directory in |
| 45 | front of sys.path, expand a symbolic link. You can now install a |
| 46 | program in a private directory and have a symbolic link to it in a |
| 47 | public bin directory, and it will put the private directory in the |
| 48 | module search path. Note that the symlink is expanded in sys.path[0] |
| 49 | but not in sys.argv[0], so you can still tell the name by which you |
| 50 | were invoked. |
| 51 | |
| 52 | - It is now recommended to use ``#!/usr/bin/env python'' instead of |
| 53 | ``#!/usr/local/bin/python'' at the start of executable scripts, except |
| 54 | for CGI scripts. It has been determined that the use of /usr/bin/env |
| 55 | is more portable than that of /usr/local/bin/python -- scripts almost |
| 56 | never have to be edited when the Python interpreter lives in a |
| 57 | non-standard place. Note that this doesn't work for CGI scripts since |
| 58 | the python executable often doesn't live in the HTTP server's default |
| 59 | search path. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 60 | |
| 61 | - The silly -s command line option and the corresponding |
| 62 | PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global |
| 63 | flag in the Python/C API) are gone. |
| 64 | |
| 65 | - Most problems on 64-bit platforms should now be fixed. Andrew |
| 66 | Kuchling helped. Some uncommon extension modules are still not |
| 67 | clean (image and audio ops?). |
| 68 | |
| 69 | - Fixed a bug where multiple anonymous tuple arguments would be mixed up |
| 70 | when using the debugger or profiler (reported by Just van Rossum). |
| 71 | The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this |
| 72 | would print the wrong value when run under the debugger or profiler. |
| 73 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 74 | - The hacks that the dictionary implementation used to speed up |
| 75 | repeated lookups of the same C string were removed; these were a |
| 76 | source of subtle problems and don't seem to serve much of a purpose |
| 77 | any longer. |
| 78 | |
| 79 | - All traces of support for the long dead access statement have been |
| 80 | removed from the sources. |
| 81 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 82 | - Plugged the two-byte memory leak in the tokenizer when reading an |
| 83 | interactive EOF. |
| 84 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 85 | - There's a -O option to the interpreter that removes SET_LINENO |
| 86 | instructions and assert statements (see below); it uses and produces |
| 87 | .pyo files instead of .pyc files. The speedup is only a few percent |
| 88 | in most cases. The line numbers are still available in the .pyo file, |
| 89 | as a separate table (which is also available in .pyc files). However, |
| 90 | the removal of the SET_LINENO instructions means that the debugger |
| 91 | (pdb) can't set breakpoints on lines in -O mode. The traceback module |
| 92 | contains a function to extract a line number from the code object |
| 93 | referenced in a traceback object. In the future it should be possible |
| 94 | to write external bytecode optimizers that create better optimized |
| 95 | .pyo files, and there should be more control over optimization; |
| 96 | consider the -O option a "teaser". Without -O, the assert statement |
| 97 | actually generates code that first checks __debug__; if this variable |
| 98 | is false, the assertion is not checked. __debug__ is a built-in |
| 99 | variable whose value is initialized to track the -O flag (it's true |
| 100 | iff -O is not specified). With -O, no code is generated for assert |
| 101 | statements, nor for code of the form ``if __debug__: <something>''. |
| 102 | Sorry, no further constant folding happens. |
| 103 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 104 | |
| 105 | Performance |
| 106 | ----------- |
| 107 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 108 | - It's much faster (almost twice for pystone.py -- see |
| 109 | Tools/scripts). See the entry on string interning below. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 110 | |
| 111 | - Some speedup by using separate free lists for method objects (both |
| 112 | the C and the Python variety) and for floating point numbers. |
| 113 | |
| 114 | - Big speedup by allocating frame objects with a single malloc() call. |
| 115 | The Python/C API for frames is changed (you shouldn't be using this |
| 116 | anyway). |
| 117 | |
| 118 | - Significant speedup by inlining some common opcodes for common operand |
| 119 | types (e.g. i+i, i-i, and list[i]). Fredrik Lundh. |
| 120 | |
| 121 | - Small speedup by reordering the method tables of some common |
| 122 | objects (e.g. list.append is now first). |
| 123 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 124 | - Big optimization to the read() method of file objects. A read() |
| 125 | without arguments now attempts to use fstat to allocate a buffer of |
| 126 | the right size; for pipes and sockets, it will fall back to doubling |
| 127 | the buffer size. While that the improvement is real on all systems, |
| 128 | it is most dramatic on Windows. |
| 129 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 130 | |
| 131 | Documentation |
| 132 | ------------- |
| 133 | |
| 134 | - Many new pieces of library documentation were contributed, mostly by |
| 135 | Andrew Kuchling. Even cmath is now documented! There's also a |
| 136 | chapter of the library manual, "libundoc.tex", which provides a |
| 137 | listing of all undocumented modules, plus their status (e.g. internal, |
| 138 | obsolete, or in need of documentation). Also contributions by Sue |
| 139 | Williams, Skip Montanaro, and some module authors who succumbed to |
| 140 | pressure to document their own contributed modules :-). Note that |
| 141 | printing the documentation now kills fewer trees -- the margins have |
| 142 | been reduced. |
| 143 | |
| 144 | - I have started documenting the Python/C API. Unfortunately this project |
| 145 | hasn't been completed yet. It will be complete before the final release of |
| 146 | Python 1.5, though. At the moment, it's better to read the LaTeX source |
| 147 | than to attempt to run it through LaTeX and print the resulting dvi file. |
| 148 | |
| 149 | - The posix module (and hence os.py) now has doc strings! Thanks to Neil |
| 150 | Schemenauer. I received a few other contributions of doc strings. In most |
| 151 | other places, doc strings are still wishful thinking... |
| 152 | |
| 153 | |
| 154 | Language changes |
| 155 | ---------------- |
| 156 | |
| 157 | - Private variables with leading double underscore are now a permanent |
| 158 | feature of the language. (These were experimental in release 1.4. I have |
| 159 | favorable experience using them; I can't label them "experimental" |
| 160 | forever.) |
| 161 | |
| 162 | - There's new string literal syntax for "raw strings". Prefixing a string |
| 163 | literal with the letter r (or R) disables all escape processing in the |
| 164 | string; for example, r'\n' is a two-character string consisting of a |
| 165 | backslash followed by the letter n. This combines with all forms of string |
| 166 | quotes; it is actually useful for triple quoted doc strings which might |
| 167 | contain references to \n or \t. An embedded quote prefixed with a |
| 168 | backslash does not terminate the string, but the backslash is still |
| 169 | included in the string; for example, r'\'' is a two-character string |
| 170 | consisting of a backslash and a quote. (Raw strings are also |
| 171 | affectionately known as Robin strings, after their inventor, Robin |
| 172 | Friedrich.) |
| 173 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 174 | - There's a simple assert statement, and a new exception |
| 175 | AssertionError. For example, ``assert foo > 0'' is equivalent to ``if |
| 176 | not foo > 0: raise AssertionError''. Sorry, the text of the asserted |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 177 | condition is not available; it would be too complicated to generate |
| 178 | code for this (since the code is generated from a parse tree). |
| 179 | However, the text is displayed as part of the traceback! |
| 180 | |
| 181 | - The raise statement has a new feature: when using "raise SomeClass, |
| 182 | somevalue" where somevalue is not an instance of SomeClass, it |
| 183 | instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an |
| 184 | instance of a *derived* class of SomeClass, the exception class raised |
| 185 | is set to somevalue.__class__, and SomeClass is ignored after that. |
| 186 | |
| 187 | - Duplicate keyword arguments are now detected at compile time; |
| 188 | f(a=1,a=2) is now a syntax error. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 189 | |
| 190 | |
| 191 | Changes to builtin features |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 192 | --------------------------- |
| 193 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 194 | - There's a new exception FloatingPointError (used only by Lee Busby's |
| 195 | patches to catch floating point exceptions, at the moment). |
| 196 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 197 | - The obsolete exception ConflictError (presumably used by the long |
| 198 | obsolete access statement) has been deleted. |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 199 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 200 | - There's a new function sys.exc_info() which returns the tuple |
| 201 | (sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way. |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 202 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 203 | - There's a new variable sys.executable, pointing to the executable file |
| 204 | for the Python interpreter. |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 205 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 206 | - The sort() methods for lists no longer uses the C library qsort(); I |
| 207 | wrote my own quicksort implementation, with lots of help (in the form |
| 208 | of a kind of competition) from Tim Peters. This solves a bug in |
| 209 | dictionary comparisons on some Solaris versions when Python is built |
| 210 | with threads, and makes sorting lists even faster. |
| 211 | |
| 212 | - The semantics of comparing two dictionaries have changed, to make |
| 213 | comparison of unequal dictionaries faster. A shorter dictionary is |
| 214 | always considered smaller than a larger dictionary. For dictionaries |
| 215 | of the same size, the smallest differing element determines the |
| 216 | outcome (which yields the same results as before in this case, without |
| 217 | explicit sorting). Thanks to Aaron Watters for suggesting something |
| 218 | like this. |
| 219 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 220 | - The semantics of try-except have changed subtly so that calling a |
| 221 | function in an exception handler that itself raises and catches an |
| 222 | exception no longer overwrites the sys.exc_* variables. This also |
| 223 | alleviates the problem that objects referenced in a stack frame that |
| 224 | caught an exception are kept alive until another exception is caught |
| 225 | -- the sys.exc_* variables are restored to their previous value when |
| 226 | returning from a function that caught an exception. |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 227 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 228 | - There's a new "buffer" interface. Certain objects (e.g. strings and |
| 229 | arrays) now support the "buffer" protocol. Buffer objects are acceptable |
| 230 | whenever formerly a string was required for a write operation; mutable |
| 231 | buffer objects can be the target of a read operation using the call |
| 232 | f.readinto(buffer). A cool feature is that regular expression matching now |
| 233 | also work on array objects. Contribution by Jack Jansen. (Needs |
| 234 | documentation.) |
| 235 | |
| 236 | - String interning: dictionary lookups are faster when the lookup |
| 237 | string object is the same object as the key in the dictionary, not |
| 238 | just a string with the same value. This is done by having a pool of |
| 239 | "interned" strings. Most names generated by the interpreter are now |
| 240 | automatically interned, and there's a new built-in function intern(s) |
| 241 | that returns the interned version of a string. Interned strings are |
| 242 | not a different object type, and interning is totally optional, but by |
| 243 | interning most keys a speedup of about 15% was obtained for the |
| 244 | pystone benchmark. |
| 245 | |
| 246 | - Dictionary objects have several new methods; clear() and copy() have |
| 247 | the obvious semantics, while update(d) merges the contents of another |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 248 | dictionary d into this one, overriding existing keys. The dictionary |
| 249 | implementation file is now called dictobject.c rather than the |
| 250 | confusing mappingobject.c. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 251 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 252 | - The intrinsic function dir() is much smarter; it looks in __dict__, |
| 253 | __members__ and __methods__. |
| 254 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 255 | - The intrinsic functions int(), long() and float() can now take a |
| 256 | string argument and then do the same thing as string.atoi(), |
| 257 | string.atol(), and string.atof(). No second 'base' argument is |
| 258 | allowed, and complex() does not take a string (nobody cared enough). |
| 259 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 260 | - When a module is deleted, its globals are now deleted in two phases. |
| 261 | In the first phase, all variables whose name begins with exactly one |
| 262 | underscore are replaced by None; in the second phase, all variables |
| 263 | are deleted. This makes it possible to have global objects whose |
| 264 | destructors depend on other globals. The deletion order within each |
| 265 | phase is still random. |
| 266 | |
| 267 | - It is no longer an error for a function to be called without a |
| 268 | global variable __builtins__ -- an empty directory will be provided |
| 269 | by default. |
| 270 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 271 | - Guido's corollary to the "Don Beaudry hook": it is now possible to |
| 272 | do metaprogramming by using an instance as a base class. Not for the |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 273 | faint of heart; and undocumented as yet, but basically if a base class |
| 274 | is an instance, its class will be instantiated to create the new |
| 275 | class. Jim Fulton will love it -- it also works with instances of his |
| 276 | "extension classes", since it is triggered by the presence of a |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 277 | __class__ attribute on the purported base class. See |
| 278 | Demo/metaclasses/index.html for an explanation and see that directory |
| 279 | for examples. |
| 280 | |
| 281 | - Another change is that the Don Beaudry hook is now invoked when |
| 282 | *any* base class is special. (Up to 1.5a3, the *last* special base |
| 283 | class is used; in 1.5a4, the more rational choice of the *first* |
| 284 | special base class is used.) |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 285 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 286 | - New optional parameter to the readlines() method of file objects. |
| 287 | This indicates the number of bytes to read (the actual number of bytes |
| 288 | read will be somewhat larger due to buffering reading until the end of |
| 289 | the line). Some optimizations have also been made to speed it up (but |
| 290 | not as much as read()). |
| 291 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 292 | - Complex numbers no longer have the ".conj" pseudo attribute; use |
| 293 | z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers |
| 294 | now *do* support the __members__ and __methods__ special attributes. |
| 295 | |
| 296 | - The complex() function now looks for a __complex__() method on class |
| 297 | instances before giving up. |
| 298 | |
| 299 | - Long integers now support arbitrary shift counts, so you can now |
| 300 | write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous |
| 301 | shift count for this.) |
| 302 | |
| 303 | - The hex() and oct() functions have been changed so that for regular |
| 304 | integers, they never emit a minus sign. For example, on a 32-bit |
| 305 | machine, oct(-1) now returns '037777777777' and hex(-1) returns |
| 306 | '0xffffffff'. While this may seem inconsistent, it is much more |
| 307 | useful. (For long integers, a minus sign is used as before, to fit |
| 308 | the result in memory :-) |
| 309 | |
| 310 | - The hash() function computes better hashes for several data types, |
| 311 | including strings, floating point numbers, and complex numbers. |
| 312 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 313 | |
| 314 | New extension modules |
| 315 | --------------------- |
| 316 | |
| 317 | - New extension modules cStringIO.c and cPickle.c, written by Jim |
| 318 | Fulton and other folks at Digital Creations. These are much more |
| 319 | efficient than their Python counterparts StringIO.py and pickle.py, |
| 320 | but don't support subclassing. cPickle.c clocks up to 1000 times |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 321 | faster than pickle.py; cStringIO.c's improvement is less dramatic but |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 322 | still significant. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 323 | |
| 324 | - New extension module zlibmodule.c, interfacing to the free zlib |
| 325 | library (gzip compatible compression). There's also a module gzip.py |
| 326 | which provides a higher level interface. Written by Andrew Kuchling |
| 327 | and Jeremy Hylton. |
| 328 | |
| 329 | - New module readline; see the "miscellaneous" section above. |
| 330 | |
| 331 | - New Unix extension module resource.c, by Jeremy Hylton, provides |
| 332 | access to getrlimit(), getrusage(), setrusage(), getpagesize(), and |
| 333 | related symbolic constants. |
| 334 | |
| 335 | - New extension puremodule.c, by Barry Warsaw, which interfaces to the |
| 336 | Purify(TM) C API. See also the file Misc/PURIFY.README. It is also |
| 337 | possible to enable Purify by simply setting the PURIFY Makefile |
| 338 | variable in the Modules/Setup file. |
| 339 | |
| 340 | |
| 341 | Changes in extension modules |
| 342 | ---------------------------- |
| 343 | |
| 344 | - The struct extension module has several new features to control byte |
| 345 | order and word size. It supports reading and writing IEEE floats even |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 346 | on platforms where this is not the native format. It uses uppercase |
| 347 | format codes for unsigned integers of various sizes (always using |
| 348 | Python long ints for 'I' and 'L'), 's' with a size prefix for strings, |
| 349 | and 'p' for "Pascal strings" (with a leading length byte, included in |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 350 | the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces |
| 351 | big-endian data and '<' forces little-endian data; these also select |
| 352 | standard data sizes and disable automatic alignment (use pad bytes as |
| 353 | needed). |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 354 | |
| 355 | - The array module supports uppercase format codes for unsigned data |
| 356 | formats (like the struct module). |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 357 | |
| 358 | - The fcntl extension module now exports the needed symbolic |
| 359 | constants. (Formerly these were in FCNTL.py which was not available |
| 360 | or correct for all platforms.) |
| 361 | |
| 362 | - The extension modules dbm, gdbm and bsddb now check that the |
| 363 | database is still open before making any new calls. |
| 364 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 365 | - The dbhash module is no more. Use bsddb instead. (There's a third |
| 366 | party interface for the BSD 2.x code somewhere on the web; support for |
| 367 | bsddb will be deprecated.) |
| 368 | |
| 369 | - The gdbm module now supports a sync() method. |
| 370 | |
| 371 | - The socket module now has some new functions: getprotobyname(), and |
| 372 | the set {ntoh,hton}{s,l}(). |
| 373 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 374 | - Various modules now export their type object: socket.SocketType, |
| 375 | array.ArrayType. |
| 376 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 377 | - The socket module's accept() method now returns unknown addresses as |
| 378 | a tuple rather than raising an exception. (This can happen in |
| 379 | promiscuous mode.) Theres' also a new function getprotobyname(). |
| 380 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 381 | - The pthread support for the thread module now works on most platforms. |
| 382 | |
| 383 | - STDWIN is now officially obsolete. Support for it will eventually |
| 384 | be removed from the distribution. |
| 385 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 386 | - The binascii extension module is now hopefully fully debugged. |
| 387 | (XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never |
| 388 | received.) |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 389 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 390 | - audioop.c: added a ratecv() function; better handling of overflow in |
| 391 | add(). |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 392 | |
| 393 | - posixmodule.c: now exports the O_* flags (O_APPEND etc.). On |
| 394 | Windows, also O_TEXT and O_BINARY. The 'error' variable (the |
| 395 | exception is raises) is renamed -- its string value is now "os.error", |
| 396 | so newbies don't believe they have to import posix (or nt) to catch |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 397 | it when they see os.error reported as posix.error. The execve() |
| 398 | function now accepts any mapping object for the environment. |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 399 | |
| 400 | - A new version of the al (audio library) module for SGI was |
| 401 | contributed by Sjoerd Mullender. |
| 402 | |
| 403 | - The regex module has a new function get_syntax() which retrieves the |
| 404 | syntax setting set by set_syntax(). The code was also sanitized, |
| 405 | removing worries about unclean error handling. See also below for its |
| 406 | successor, re.py. |
| 407 | |
| 408 | - The "new" module (which creates new objects of various types) once |
| 409 | again has a fully functioning new.function() method. Dangerous as |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 410 | ever! Also, new.code() has several new arguments. |
| 411 | |
| 412 | - A problem has been fixed in the rotor module: on systems with signed |
| 413 | characters, rotor-encoded data was not portable when the key contained |
| 414 | 8-bit characters. Also, setkey() now requires its argument rather |
| 415 | than having broken code to default it. |
| 416 | |
| 417 | - The sys.builtin_module_names variable is now a tuple. Another new |
| 418 | variables in sys is sys.executable (the full path to the Python |
| 419 | binary, if known). |
| 420 | |
| 421 | - The specs for time.strftime() have undergone some revisions. It |
| 422 | appears that not all format characters are supported in the same way |
| 423 | on all platforms. Rather than reimplement it, we note these |
| 424 | differences in the documentation, and emphasize the shared set of |
| 425 | features. There's also a thorough test set (that occasionally finds |
| 426 | problems in the C library implementation, e.g. on some Linuxes), |
| 427 | thanks to Skip Montanaro. |
| 428 | |
| 429 | - The nis module seems broken when used with NIS+; unfortunately |
| 430 | nobody knows how to fix it. It should still work with old NIS. |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 431 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 432 | |
| 433 | New library modules |
| 434 | ------------------- |
| 435 | |
| 436 | - New (still experimental) Perl-style regular expression module, |
| 437 | re.py, which uses a new interface for matching as well as a new |
| 438 | syntax; the new interface avoids the thread-unsafety of the regex |
| 439 | interface. This comes with a helper extension reopmodule.c and vastly |
| 440 | rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim |
| 441 | Peters, and Andrew Kuchling. See the documentation libre.tex. In |
| 442 | 1.5, the old regex module is still fully supported; in the future, it |
| 443 | will become obsolete. |
| 444 | |
| 445 | - New module gzip.py; see zlib above. |
| 446 | |
| 447 | - New module keyword.py exports knowledge about Python's built-in |
| 448 | keywords. (New version by Ka-Ping Yee.) |
| 449 | |
| 450 | - New module pprint.py (with documentation) which supports |
| 451 | pretty-printing of lists, tuples, & dictionaries recursively. By Fred |
| 452 | Drake. |
| 453 | |
| 454 | - New module code.py. The function code.compile_command() can |
| 455 | determine whether an interactively entered command is complete or not, |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 456 | distinguishing incomplete from invalid input. (XXX Unfortunately, |
| 457 | this seems broken at this moment, and I don't have the time to fix |
| 458 | it. It's probably better to add an explicit interface to the parser |
| 459 | for this.) |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 460 | |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 461 | - There is now a library module xdrlib.py which can read and write the |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 462 | XDR data format as used by Sun RPC, for example. It uses the struct |
| 463 | module. |
| 464 | |
| 465 | |
| 466 | Changes in library modules |
| 467 | -------------------------- |
| 468 | |
| 469 | - Module codehack.py is now completely obsolete. |
| 470 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 471 | - The pickle.py module has been updated to make it compatible with the |
| 472 | new binary format that cPickle.c produces. By default it produces the |
| 473 | old all-ASCII format compatible with the old pickle.py, still much |
| 474 | faster than pickle.py; it will read both formats automatically. A few |
| 475 | other updates have been made. |
| 476 | |
| 477 | - A new helper module, copy_reg.py, is provided to register extensions |
| 478 | to the pickling code. |
| 479 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 480 | - Revamped module tokenize.py is much more accurate and has an |
| 481 | interface that makes it a breeze to write code to colorize Python |
| 482 | source code. Contributed by Ka-Ping Yee. |
| 483 | |
| 484 | - In ihooks.py, ModuleLoader.load_module() now closes the file under |
| 485 | all circumstances. |
| 486 | |
| 487 | - The tempfile.py module has a new class, TemporaryFile, which creates |
| 488 | an open temporary file that will be deleted automatically when |
| 489 | closed. This works on Windows and MacOS as well as on Unix. (Jim |
| 490 | Fulton.) |
| 491 | |
| 492 | - Changes to the cgi.py module: Most imports are now done at the |
| 493 | top of the module, which provides a speedup when using ni (Jim |
| 494 | Fulton). The problem with file upload to a Windows platform is solved |
| 495 | by using the new tempfile.TemporaryFile class; temporary files are now |
| 496 | always opened in binary mode (Jim Fulton). The cgi.escape() function |
| 497 | now takes an optional flag argument that quotes '"' to '"'. It |
| 498 | is now possible to invoke cgi.py from a command line script, to test |
| 499 | cgi scripts more easily outside an http server. There's an optional |
| 500 | limit to the size of uploads to POST (Skip Montanaro). Added a |
| 501 | 'strict_parsing' option to all parsing functions (Jim Fulton). The |
| 502 | function parse_qs() now uses urllib.unquote() on the name as well as |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 503 | the value of fields (Clarence Gardner). The FieldStorage class now |
| 504 | has a __len__() method. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 505 | |
| 506 | - httplib.py: the socket object is no longer closed; all HTTP/1.* |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 507 | responses are now accepted; and it is now thread-safe (by not using |
| 508 | the regex module). |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 509 | |
| 510 | - BaseHTTPModule.py: treat all HTTP/1.* versions the same. |
| 511 | |
| 512 | - The popen2.py module is now rewritten using a class, which makes |
| 513 | access to the standard error stream and the process id of the |
| 514 | subprocess possible. |
| 515 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 516 | - Added timezone support to the rfc822.py module, in the form of a |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 517 | getdate_tz() method and a parsedate_tz() function; also a mktime_tz(). |
| 518 | Also added recognition of some non-standard date formats, by Lars |
| 519 | Wirzenius, and RFC 850 dates (Chris Lawrence). |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 520 | |
| 521 | - mhlib.py: various enhancements, including almost compatible parsing |
| 522 | of message sequence specifiers without invoking a subprocess. Also |
| 523 | added a createmessage() method by Lars Wirzenius. |
| 524 | |
| 525 | - The StringIO.StringIO class now supports readline(nbytes). (Lars |
| 526 | Wirzenius.) (Of course, you should be using cStringIO for performance.) |
| 527 | |
| 528 | - UserDict.py supports the new dictionary methods as well. |
| 529 | |
| 530 | - Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to |
| 531 | speed it up, and replace 0 seed values by 1 to avoid degeneration. |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 532 | A bug was fixed in the test for invalid arguments. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 533 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 534 | - Module ftplib.py: added support for parsing a .netrc file (Fred |
| 535 | Drake). Also added an ntransfercmd() method to the FTP class, which |
| 536 | allows access to the expected size of a transfer when available, and a |
| 537 | parse150() function to the module which parses the corresponding 150 |
| 538 | response. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 539 | |
| 540 | - urllib.py: the ftp cache is now limited to 10 entries. Added |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 541 | quote_plus() and unquote_plus() functions which are like quote() and |
| 542 | unquote() but also replace spaces with '+' or vice versa, for |
| 543 | encoding/decoding CGI form arguments. Catch all errors from the ftp |
| 544 | module. HTTP requests now add the Host: header line. The proxy |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 545 | variable names are now mapped to lower case, for Windows. The |
| 546 | spliturl() function no longer erroneously throws away all data past |
| 547 | the first newline. The basejoin() function now intereprets "../" |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 548 | correctly. I *believe* that the problems with "exception raised in |
| 549 | __del__" under certain circumstances have been fixed (mostly by |
| 550 | changes elsewher in the interpreter). |
| 551 | |
| 552 | - In urlparse.py, there is a cache for results in urlparse.urlparse(); |
| 553 | its size limit is set to 20. Also, new URL schemes shttp, https, and |
| 554 | snews are "supported". |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 555 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 556 | - shelve.py: use cPickle and cStringIO when available. Also added |
| 557 | a sync() method, which calls the database's sync() method if there is |
| 558 | one. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 559 | |
| 560 | - The mimetools.py module now uses the available Python modules for |
| 561 | decoding quoted-printable, uuencode and base64 formats, rather than |
| 562 | creating a subprocess. |
| 563 | |
| 564 | - The python debugger (pdb.py, and its base class bdb.py) now support |
| 565 | conditional breakpoints. See the docs. |
| 566 | |
| 567 | - The modules base64.py, uu.py and quopri.py can now be used as simple |
| 568 | command line utilities. |
| 569 | |
| 570 | - Various small fixes to the nntplib.py module that I can't bother to |
| 571 | document in detail. |
| 572 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 573 | - Sjoerd Mullender's mimify.py module now supports base64 encoding and |
| 574 | includes functions to handle the funny encoding you sometimes see in mail |
| 575 | headers. It is now documented. |
| 576 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 577 | - mailbox.py: Added BabylMailbox. Improved the way the mailbox is |
| 578 | gotten from the environment. |
| 579 | |
| 580 | - Many more modules now correctly open files in binary mode when this |
| 581 | is necessary on non-Unix platforms. |
| 582 | |
| 583 | - The copying functions in the undocumented module shutil.py are |
| 584 | smarter. |
| 585 | |
| 586 | - The Writer classes in the formatter.py module now have a flush() |
| 587 | method. |
| 588 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 589 | - The sgmllib.py module accepts hyphens and periods in the middle of |
| 590 | attribute names. While this is against the SGML standard, there is |
| 591 | some HTML out there that uses this... |
| 592 | |
| 593 | - The interface for the Python bytecode disassembler module, dis.py, |
| 594 | has been enhanced quite a bit. There's now one main function, |
| 595 | dis.dis(), which takes almost any kind of object (function, module, |
| 596 | class, instance, method, code object) and disassembles it; without |
| 597 | arguments it disassembles the last frame of the last traceback. The |
| 598 | other functions have changed slightly, too. |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 599 | |
| 600 | - The imghdr.py module recognizes new image types: BMP, PNG. |
| 601 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 602 | - The string.py module has a new function replace(str, old, new, |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 603 | [maxsplit]) which does substring replacements. It is actually |
| 604 | implemented in C in the strop module. The functions [r]find() an |
| 605 | [r]index() have an optional 4th argument indicating the end of the |
| 606 | substring to search, alsoo implemented by their strop counterparts. |
| 607 | (Remember, never import strop -- import string uses strop when |
| 608 | available with zero overhead.) |
| 609 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 610 | - The string.join() function now accepts any sequence argument, not |
| 611 | just lists and tuples. |
| 612 | |
| 613 | - The string.maketrans() requires its first two arguments to be |
| 614 | present. The old version didn't require them, but there's not much |
| 615 | point without them, and the documentation suggests that they are |
| 616 | required, so we fixed the code to match the documentation. |
| 617 | |
| 618 | - The regsub.py module has a function clear_cache(), which clears its |
| 619 | internal cache of compiled regular expressions. Also, the cache now |
| 620 | takes the current syntax setting into account. (However, this module |
| 621 | is now obsolete -- use the sub() or subn() functions or methods in the |
| 622 | re module.) |
| 623 | |
| 624 | - The undocumented module Complex.py has been removed, now that Python |
| 625 | has built-in complex numbers. A similar module remains as |
| 626 | Demo/classes/Complex.py, as an example. |
| 627 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 628 | |
| 629 | Changes to the build process |
| 630 | ---------------------------- |
| 631 | |
| 632 | - The way GNU readline is configured is totally different. The |
| 633 | --with-readline configure option is gone. It is now an extension |
| 634 | module, which may be loaded dynamically. You must enable it (and |
| 635 | specify the correct linraries to link with) in the Modules/Setup file. |
| 636 | Importing the module installs some hooks which enable command line |
| 637 | editing. When the interpreter shell is invoked interactively, it |
| 638 | attempts to import the readline module; when this fails, the default |
| 639 | input mechanism is used. The hook variables are PyOS_InputHook and |
| 640 | PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with |
| 641 | ideas from William Magro.) |
| 642 | |
| 643 | - New build procedure: a single library, libpython1.5.a, is now built, |
| 644 | which contains absolutely everything except for a one-line main() |
| 645 | program (which calls Py_Main(argc, argv) to start the interpreter |
| 646 | shell). This makes life much simpler for applications that need to |
| 647 | embed Python. The serial number of the build is now included in the |
| 648 | version string (sys.version). |
| 649 | |
| 650 | - As far as I can tell, neither gcc -Wall nor the Microsoft compiler |
| 651 | emits a single warning any more when compiling Python. |
| 652 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 653 | - A number of new Makefile variables have been added for special |
| 654 | situations, e.g. LDLAST is appended to the link command. These are |
| 655 | used by editing the Makefile or passing them on the make command |
| 656 | line. |
| 657 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 658 | - A set of patches from Lee Busby has been integrated that make it |
| 659 | possible to catch floating point exceptions. Use the configure option |
| 660 | --with-fpectl to enable the patches; the extension modules fpectl and |
| 661 | fpetest provide control to enable/disable and test the feature, |
| 662 | respectively. |
| 663 | |
| 664 | - The support for shared libraries under AIX is now simpler and more |
| 665 | robust. Thanks to Vladimir Marangozov for revamping his own patches! |
| 666 | |
| 667 | - The Modules/makesetup script now reads a file Setup.local as well as |
| 668 | a file Setup. Most changes to the Setup script can be done by editing |
| 669 | Setup.local instead, which makes it easier to carry a particular setup |
| 670 | over from one release to the next. |
| 671 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 672 | - The Modules/makesetup script now copies any "include" lines it |
| 673 | encounters verbatim into the output Makefile. It also recognizes .cxx |
| 674 | and .cpp as C++ source files. |
| 675 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 676 | - The configure script is smarter about C compiler options; e.g. with |
| 677 | gcc it uses -O2 and -g when possible, and on some other platforms it |
| 678 | uses -Olimit 1500 to avoid a warning from the optimizer about the main |
| 679 | loop in ceval.c (which has more than 1000 basic blocks). |
| 680 | |
| 681 | - The configure script now detects whether malloc(0) returns a NULL |
| 682 | pointer or a valid block (of length zero). This avoids the nonsense |
| 683 | of always adding one byte to all malloc() arguments on most platforms. |
| 684 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 685 | - The configure script has a new option, --with-dec-threads, to enable |
| 686 | DEC threads on DEC Alpha platforms. Also, --with-threads is now an |
| 687 | alias for --with-thread (this was the Most Common Typo in configure |
| 688 | arguments). |
| 689 | |
| 690 | - Many changes in Doc/Makefile; amongst others, latex2html is now used |
| 691 | to generate HTML from all latex documents. |
| 692 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 693 | |
| 694 | Change to the Python/C API |
| 695 | -------------------------- |
| 696 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 697 | - Because some interfaces have changed, the PYTHON_API macro has been |
| 698 | bumped. Most extensions built for the old API version will still run, |
| 699 | but I can't guarantee this. Python prints a warning message on |
| 700 | version mismatches; it dumps core when the version mismatch causes a |
| 701 | serious problem :-) |
| 702 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 703 | - I've completed the Grand Renaming, with the help of Roger Masse and |
| 704 | Barry Warsaw. This makes reading or debugging the code much easier. |
| 705 | Many other unrelated code reorganizations have also been carried out. |
| 706 | The allobjects.h header file is gone; instead, you would have to |
| 707 | include Python.h followed by rename2.h. But you're better off running |
| 708 | Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit |
| 709 | the rename2.h; it will disappear in the next release. |
| 710 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 711 | - Various and sundry small bugs in the "abstract" interfaces have been |
| 712 | fixed. Thanks to all the (involuntary) testers of the Python 1.4 |
| 713 | version! Some new functions have been added, e.g. PySequence_List(o), |
| 714 | equivalent to list(o) in Python. |
| 715 | |
| 716 | - New API functions PyLong_FromUnsignedLong() and |
| 717 | PyLong_AsUnsignedLong(). |
| 718 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 719 | - The API functions in the file cgensupport.c are no longer |
| 720 | supported. This file has been moved to Modules and is only ever |
| 721 | compiled when the SGI specific 'gl' module is built. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 722 | |
| 723 | - PyObject_Compare() can now raise an exception. Check with |
| 724 | PyErr_Occurred(). The comparison function in an object type may also |
| 725 | raise an exception. |
| 726 | |
| 727 | - The slice interface uses an upper bound of INT_MAX when no explicit |
| 728 | upper bound is given (e.x. for a[1:]). It used to ask the object for |
| 729 | its length and do the calculations. |
| 730 | |
| 731 | - Support for multiple independent interpreters. See Doc/api.tex, |
| 732 | functions Py_NewInterpreter() and Py_EndInterpreter(). Since the |
| 733 | documentation is incomplete, also see the new Demo/pysvr example |
| 734 | (which shows how to use these in a threaded application) and the |
| 735 | source code. |
| 736 | |
| 737 | - There is now a Py_Finalize() function which "de-initializes" |
| 738 | Python. It is possible to completely restart the interpreter |
| 739 | repeatedly by calling Py_Finalize() followed by Py_Initialize(). A |
| 740 | change of functionality in Py_Initialize() means that it is now a |
| 741 | fatal error to call it while the interpreter is already initialized. |
| 742 | The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit() |
| 743 | is deprecated (it is nothing more than Py_Finalize() followed by |
| 744 | exit()). |
| 745 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 746 | - There are no known memory leaks left. While Py_Finalize() doesn't |
| 747 | free *all* allocated memory (some of it is hard to track down), |
| 748 | repeated calls to Py_Finalize() and Py_Initialize() do not create |
| 749 | unaccessible heap blocks. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 750 | |
| 751 | - There is now explicit per-thread state. (Inspired by, but not the |
| 752 | same as, Greg Stein's free threading patches.) |
| 753 | |
| 754 | - There is now better support for threading C applications. There are |
| 755 | now explicit APIs to manipulate the interpreter lock. Read the source |
| 756 | or the Demo/pysvr example; the new functions are |
| 757 | PyEval_{Acquire,Release}{Lock,Thread}(). |
| 758 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 759 | - The test macro DEBUG has changed to Py_DEBUG, to avoid interference |
| 760 | with other libraries' DEBUG macros. Likewise for any other test |
| 761 | macros that didn't yet start with Py_. |
| 762 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 763 | - New wrappers around malloc() and friends: Py_Malloc() etc. call |
| 764 | malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call |
| 765 | just malloc(). Use of these wrappers could be essential if multiple |
| 766 | memory allocators exist (e.g. when using certain DLL setups under |
| 767 | Windows). (Idea by Jim Fulton.) |
| 768 | |
| 769 | - New C API PyImport_Import() which uses whatever __import__() hook |
| 770 | that is installed for the current execution environment. By Jim |
| 771 | Fulton. |
| 772 | |
| 773 | - It is now possible for an extension module's init function to fail |
| 774 | non-fatally, by calling one of the PyErr_* functions and returning. |
| 775 | |
| 776 | - The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their |
| 777 | argument to the proper type, like the similar PyString macros already |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 778 | did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE |
| 779 | and PyList_GET_ITEM. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 780 | |
| 781 | - Some of the Py_Get* function, like Py_GetVersion() (but not yet |
| 782 | Py_GetPath()) are now declared as returning a const char *. (More |
| 783 | should follow.) |
| 784 | |
| 785 | - Changed the run-time library to check for exceptions after object |
| 786 | comparisons. PyObject_Compare() can now return an exception; use |
| 787 | PyErr_Occurred() to check (there is *no* special return value). |
| 788 | |
| 789 | - PyFile_WriteString() and Py_Flushline() now return error indicators |
| 790 | instead of clearing exceptions. This fixes an obscure bug where using |
| 791 | these would clear a pending exception, discovered by Just van Rossum. |
| 792 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 793 | - There's a new function, PyArg_ParseTupleAndKeywords(), which parses |
| 794 | an argument list including keyword arguments. Contributed by Geoff |
| 795 | Philbrick. |
| 796 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 797 | - PyArg_GetInt() is gone. |
| 798 | |
| 799 | - It's no longer necessary to include graminit.h when calling one of |
| 800 | the extended parser API functions. The three public grammar start |
| 801 | symbols are now in Python.h as Py_single_input, Py_file_input, and |
| 802 | Py_eval_input. |
| 803 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 804 | - The CObject interface has a new function, |
| 805 | PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr() |
| 806 | on the object referenced by "module.name". |
| 807 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 808 | |
| 809 | Tkinter |
| 810 | ------- |
| 811 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 812 | - On popular demand, _tkinter once again installs a hook for readline |
| 813 | that processes certain Tk events while waiting for the user to type |
| 814 | (using PyOS_InputHook). |
| 815 | |
| 816 | - A patch by Craig McPheeters plugs the most obnoxious memory leaks, |
| 817 | caused by command definitions referencing widget objects beyond their |
| 818 | lifetime. |
| 819 | |
| 820 | - New standard dialog modules: tkColorChooser.py, tkCommonDialog.py, |
| 821 | tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 822 | with the new Tk dialog scripts, and provide more "native platform" |
| 823 | style file selection dialog boxes on some platforms. Contributed by |
| 824 | Fredrik Lundh. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 825 | |
| 826 | - Tkinter.py: when the first Tk object is destroyed, it sets the |
| 827 | hiddel global _default_root to None, so that when another Tk object is |
| 828 | created it becomes the new default root. Other miscellaneous |
| 829 | changes and fixes. |
| 830 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 831 | - The Image class now has a configure method. |
| 832 | |
| 833 | - Added a bunch of new winfo options to Tkinter.py; we should now be |
| 834 | up to date with Tk 4.2. The new winfo options supported are: |
| 835 | mananger, pointerx, pointerxy, pointery, server, viewable, visualid, |
| 836 | visualsavailable. |
| 837 | |
| 838 | - The broken bind() method on Canvas objects defined in the Canvas.py |
| 839 | module has been fixed. The CanvasItem and Group classes now also have |
| 840 | an unbind() method. |
| 841 | |
| 842 | - The problem with Tkinter.py falling back to trying to import |
| 843 | "tkinter" when "_tkinter" is not found has been fixed -- it no longer |
| 844 | tries "tkinter", ever. This makes diagnosing the problem "_tkinter |
| 845 | not configured" much easier and will hopefully reduce the newsgroup |
| 846 | traffic on this topic. |
| 847 | |
| 848 | - The ScrolledText module once again supports the 'cnf' parameter, to |
| 849 | be compatible with the examples in Mark Lutz' book (I know, I know, |
| 850 | too late...) |
| 851 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 852 | - The _tkinter.c extension module has been revamped. It now support |
| 853 | Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It |
| 854 | works well under Windows and Mac (with the latest Tk ports to those |
| 855 | platforms). It also supports threading -- it is safe for one |
| 856 | (Python-created) thread to be blocked in _tkinter.mainloop() while |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 857 | other threads modify widgets. To make the changes visible, those |
| 858 | threads must use update_idletasks()method. (The patch for threading |
| 859 | in 1.5a3 was broken; in 1.5a4, it is back in a different version, |
| 860 | which requires access to the Tcl sources to get it to work -- hence it |
| 861 | is disabled by default.) |
| 862 | |
| 863 | - A bug in _tkinter.c has been fixed, where Split() with a string |
| 864 | containing an unmatched '"' could cause an exception or core dump. |
| 865 | |
| 866 | - Unfortunately, on Windows and Mac, Tk 8.0 no longer supports |
| 867 | CreateFileHandler, so _tkinter.createfilehandler is not available on |
| 868 | those platforms when using Tk 8.0 or later. I will have to rethink |
| 869 | how to interface with Tcl's lower-level event mechanism, or with its |
| 870 | channels (which are like Python's file-like objects). Jack Jansen has |
| 871 | provided a fix for the Mac, so createfilehandler *is* actually |
| 872 | supported there; maybe I can adapt his fix for Windows. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 873 | |
| 874 | |
| 875 | Tools and Demos |
| 876 | --------------- |
| 877 | |
| 878 | - A new regression test suite is provided, which tests most of the |
| 879 | standard and built-in modules. The regression test is run by invoking |
| 880 | the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass; |
| 881 | he and Roger Masse contributed most of the new tests. |
| 882 | |
| 883 | - New tool: faqwiz -- the CGI script that is used to maintain the |
| 884 | Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In |
| 885 | Tools/faqwiz. |
| 886 | |
| 887 | - New tool: webchecker -- a simple extensible web robot that, when |
| 888 | aimed at a web server, checks that server for dead links. Available |
| 889 | are a command line utility as well as a Tkinter based GUI version. In |
| 890 | Tools/webchecker. A simplified version of this program is dissected |
| 891 | in my article in O'Reilly's WWW Journal, the issue on Scripting |
| 892 | Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120). |
| 893 | Includes a parser for robots.txt files by Skip Montanaro. |
| 894 | |
| 895 | - New small tools: cvsfiles.py (prints a list of all files under CVS |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 896 | n a particular directory tree), treesync.py (a rather Guido-specific |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 897 | script to synchronize two source trees, one on Windows NT, the other |
| 898 | one on Unix under CVS but accessible from the NT box), and logmerge.py |
| 899 | (sort a collection of RCS or CVS logs by date). In Tools/scripts. |
| 900 | |
| 901 | - The freeze script now also works under Windows (NT). Another |
| 902 | feature allows the -p option to be pointed at the Python source tree |
| 903 | instead of the installation prefix. This was loosely based on part of |
| 904 | xfreeze by Sam Rushing and Bill Tutt. |
| 905 | |
| 906 | - New examples (Demo/extend) that show how to use the generic |
| 907 | extension makefile (Misc/Makefile.pre.in). |
| 908 | |
| 909 | - Tools/scripts/h2py.py now supports C++ comments. |
| 910 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 911 | - Tools/scripts/pystone.py script is upgraded to version 1.1; there |
| 912 | was a bug in version 1.0 (distributed with Python 1.4) that leaked |
| 913 | memory. Also, in 1.1, the LOOPS variable is incremented to 10000. |
| 914 | |
| 915 | - Demo/classes/Rat.py completely rewritten by Sjoerd Mullender. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 916 | |
| 917 | |
| 918 | Windows (NT and 95) |
| 919 | ------------------- |
| 920 | |
| 921 | - New project files for Developer Studio (Visual C++) 5.0 for Windows |
| 922 | NT (the old VC++ 4.2 Makefile is also still supported, but will |
| 923 | eventually be withdrawn due to its bulkiness). |
| 924 | |
| 925 | - See the note on the new module search path in the "Miscellaneous" section |
| 926 | above. |
| 927 | |
| 928 | - Support for Win32s (the 32-bit Windows API under Windows 3.1) is |
| 929 | basically withdrawn. If it still works for you, you're lucky. |
| 930 | |
| 931 | - There's a new extension module, msvcrt.c, which provides various |
| 932 | low-level operations defined in the Microsoft Visual C++ Runtime Library. |
| 933 | These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and |
| 934 | console I/O functions like kbhit(), getch() and putch(). |
| 935 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 936 | - The -u option not only sets the standard I/O streams to unbuffered |
| 937 | status, but also sets them in binary mode. (This can also be done |
| 938 | using msvcrt.setmode(), by the way.) |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 939 | |
| 940 | - The, sys.prefix and sys.exec_prefix variables point to the directory |
| 941 | where Python is installed, or to the top of the source tree, if it was run |
| 942 | from there. |
| 943 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 944 | - The various os.path modules (posixpath, ntpath, macpath) now support |
| 945 | passing more than two arguments to the join() function, so |
| 946 | os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b, |
| 947 | c)). |
| 948 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 949 | - The ntpath module (normally used as os.path) supports ~ to $HOME |
| 950 | expansion in expanduser(). |
| 951 | |
| 952 | - The freeze tool now works on Windows. |
| 953 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 954 | - See also the Tkinter category for a sad note on |
| 955 | _tkinter.createfilehandler(). |
| 956 | |
| 957 | - The truncate() method for file objects now works on Windows. |
| 958 | |
| 959 | - Py_Initialize() is no longer called when the DLL is loaded. You |
Guido van Rossum | b68b77f | 1997-10-07 19:12:50 +0000 | [diff] [blame] | 960 | must call it yourself. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 961 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 962 | - The time module's clock() function now has good precision through |
| 963 | the use of the Win32 API QueryPerformanceCounter(). |
| 964 | |
| 965 | - Mark Hammond will release Python 1.5 versions of PythonWin and his |
| 966 | other Windows specific code: the win32api extensions, COM/ActiveX |
| 967 | support, and the MFC interface. |
| 968 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 969 | |
| 970 | Mac |
| 971 | --- |
| 972 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 973 | - As always, the Macintosh port will be done by Jack Jansen. He will |
| 974 | make a separate announcement for the Mac specific source code and the |
| 975 | binary distribution(s) when these are ready. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 976 | |
| 977 | |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 978 | ====================================================================== |
| 979 | |
| 980 | |
Guido van Rossum | 7ea639b | 1997-11-26 16:36:28 +0000 | [diff] [blame] | 981 | From 1.5a3 to 1.5a4 |
| 982 | =================== |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 983 | |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 984 | - faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html> |
| 985 | feature; better install instructions; removed faqmain.py (which was an |
| 986 | older version). |
| 987 | |
| 988 | - nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian) |
| 989 | about the treatment of lines starting with '.'. Added a minimal test |
| 990 | function. |
| 991 | |
| 992 | - struct module: ignore most whitespace in format strings. |
| 993 | |
| 994 | - urllib.py: close the socket and temp file in URLopener.retrieve() so |
| 995 | that multiple retrievals using the same connection work. |
| 996 | |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 997 | - All standard exceptions are now classes by default; use -X to make |
| 998 | them strings (for backward compatibility only). |
| 999 | |
| 1000 | - There's a new standard exception hierarchy, defined in the standard |
| 1001 | library module exceptions.py (which you never need to import |
| 1002 | explicitly). See |
| 1003 | http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for |
| 1004 | more info. |
| 1005 | |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 1006 | - Three new C API functions: |
| 1007 | |
| 1008 | - int PyErr_GivenExceptionMatches(obj1, obj2) |
| 1009 | |
| 1010 | Returns 1 if obj1 and obj2 are the same object, or if obj1 is an |
| 1011 | instance of type obj2, or of a class derived from obj2 |
| 1012 | |
| 1013 | - int PyErr_ExceptionMatches(obj) |
| 1014 | |
| 1015 | Higher level wrapper around PyErr_GivenExceptionMatches() which uses |
| 1016 | PyErr_Occurred() as obj1. This will be the more commonly called |
| 1017 | function. |
| 1018 | |
| 1019 | - void PyErr_NormalizeException(typeptr, valptr, tbptr) |
| 1020 | |
| 1021 | Normalizes exceptions, and places the normalized values in the |
| 1022 | arguments. If type is not a class, this does nothing. If type is a |
| 1023 | class, then it makes sure that value is an instance of the class by: |
| 1024 | |
| 1025 | 1. if instance is of the type, or a class derived from type, it does |
| 1026 | nothing. |
| 1027 | |
| 1028 | 2. otherwise it instantiates the class, using the value as an |
| 1029 | argument. If value is None, it uses an empty arg tuple, and if |
| 1030 | the value is a tuple, it uses just that. |
| 1031 | |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 1032 | - Another new C API function: PyErr_NewException() creates a new |
| 1033 | exception class derived from Exception; when -X is given, it creates a |
| 1034 | new string exception. |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 1035 | |
| 1036 | - core interpreter: remove the distinction between tuple and list |
| 1037 | unpacking; allow an arbitrary sequence on the right hand side of any |
| 1038 | unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same |
| 1039 | thing, which should really be called UNPACK_SEQUENCE.) |
| 1040 | |
| 1041 | - classes: Allow assignments to an instance's __dict__ or __class__, |
| 1042 | so you can change ivars (including shared ivars -- shock horror) and |
| 1043 | change classes dynamically. Also make the check on read-only |
| 1044 | attributes of classes less draconic -- only the specials names |
| 1045 | __dict__, __bases__, __name__ and __{get,set,del}attr__ can't be |
| 1046 | assigned. |
| 1047 | |
| 1048 | - Two new built-in functions: issubclass() and isinstance(). Both |
| 1049 | take classes as their second arguments. The former takes a class as |
| 1050 | the first argument and returns true iff first is second, or is a |
| 1051 | subclass of second. The latter takes any object as the first argument |
| 1052 | and returns true iff first is an instance of the second, or any |
| 1053 | subclass of second. |
| 1054 | |
| 1055 | - configure: Added configuration tests for presence of alarm(), |
| 1056 | pause(), and getpwent(). |
| 1057 | |
| 1058 | - Doc/Makefile: changed latex2html targets. |
| 1059 | |
| 1060 | - classes: Reverse the search order for the Don Beaudry hook so that |
| 1061 | the first class with an applicable hook wins. Makes more sense. |
| 1062 | |
| 1063 | - Changed the checks made in Py_Initialize() and Py_Finalize(). It is |
| 1064 | now legal to call these more than once. The first call to |
| 1065 | Py_Initialize() initializes, the first call to Py_Finalize() |
| 1066 | finalizes. There's also a new API, Py_IsInitalized() which checks |
| 1067 | whether we are already initialized (in case you want to leave things |
| 1068 | as they were). |
| 1069 | |
| 1070 | - Completely disable the declarations for malloc(), realloc() and |
| 1071 | free(). Any 90's C compiler has these in header files, and the tests |
| 1072 | to decide whether to suppress the declarations kept failing on some |
| 1073 | platforms. |
| 1074 | |
| 1075 | - *Before* (instead of after) signalmodule.o is added, remove both |
| 1076 | intrcheck.o and sigcheck.o. This should get rid of warnings in ar or |
| 1077 | ld on various systems. |
| 1078 | |
| 1079 | - Added reop to PC/config.c |
| 1080 | |
| 1081 | - configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms. |
| 1082 | Removed outdated HP-UX comments from README. Added Cray T3E comments. |
| 1083 | |
| 1084 | - Various renames of statically defined functions that had name |
| 1085 | conflicts on some systems, e.g. strndup (GNU libc), join (Cray), |
| 1086 | roundup (sys/types.h). |
| 1087 | |
| 1088 | - urllib.py: Interpret three slashes in file: URL as local file (for |
| 1089 | Netscape on Windows/Mac). |
| 1090 | |
| 1091 | - copy.py: Make sure the objects returned by __getinitargs__() are |
| 1092 | kept alive (in the memo) to avoid a certain kind of nasty crash. (Not |
| 1093 | easily reproducable because it requires a later call to |
| 1094 | __getinitargs__() to return a tuple that happens to be allocated at |
| 1095 | the same address.) |
| 1096 | |
| 1097 | - Added definition of AR to toplevel Makefile. Renamed @buildno temp |
| 1098 | file to buildno1. |
| 1099 | |
| 1100 | - Moved Include/assert.h to Parser/assert.h, which seems to be the |
| 1101 | only place where it's needed. |
| 1102 | |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 1103 | - Tweaked the dictionary lookup code again for some more speed |
| 1104 | (Vladimir Marangozov). |
| 1105 | |
| 1106 | - NT build: Changed the way python15.lib is included in the other |
| 1107 | projects. Per Mark Hammond's suggestion, add it to the extra libs in |
| 1108 | Settings instead of to the project's source files. |
| 1109 | |
| 1110 | - regrtest.py: Change default verbosity so that there are only three |
| 1111 | levels left: -q, default and -v. In default mode, the name of each |
| 1112 | test is now printed. -v is the same as the old -vv. -q is more quiet |
| 1113 | than the old default mode. |
| 1114 | |
| 1115 | - Removed the old FAQ from the distribution. You now have to get it |
| 1116 | from the web! |
| 1117 | |
| 1118 | - Removed the PC/make_nt.in file from the distribution; it is no |
| 1119 | longer needed. |
| 1120 | |
| 1121 | - Changed the build sequence so that shared modules are built last. |
| 1122 | This fixes things for AIX and doesn't hurt elsewhere. |
| 1123 | |
| 1124 | - Improved test for GNU MP v1 in mpzmodule.c |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1125 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1126 | - fileobject.c: ftell() on Linux discards all buffered data; changed |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 1127 | read() code to use lseek() instead to get the same effect |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1128 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1129 | - configure.in, configure, importdl.c: NeXT sharedlib fixes |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1130 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1131 | - tupleobject.c: PyTuple_SetItem asserts refcnt==1 |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1132 | |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 1133 | - resource.c: Different strategy regarding whether to declare |
| 1134 | getrusage() and getpagesize() -- #ifdef doesn't work, Linux has |
| 1135 | conflicting decls in its headers. Choice: only declare the return |
| 1136 | type, not the argument prototype, and not on Linux. |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1137 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1138 | - importdl.c, configure*: set sharedlib extensions properly for NeXT |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1139 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1140 | - configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries |
| 1141 | fixed; moved addition of PURIFY to LINKCC to configure |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1142 | |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 1143 | - reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts |
| 1144 | added to shup up various compilers. |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1145 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1146 | - _tkinter.c: removed buggy mac #ifndef |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1147 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1148 | - Doc: various Mac documentation changes, added docs for 'ic' module |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1149 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1150 | - PC/make_nt.in: deleted |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1151 | |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 1152 | - test_time.py, test_strftime.py: tweaks to catch %Z (which may return |
| 1153 | "") |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1154 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1155 | - test_rotor.py: print b -> print `b` |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1156 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 1157 | - Tkinter.py: (tagOrId) -> (tagOrId,) |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 1158 | |
| 1159 | - Tkinter.py: the Tk class now also has a configure() method and |
| 1160 | friends (they have been moved to the Misc class to accomplish this). |
| 1161 | |
| 1162 | - dict.get(key[, default]) returns dict[key] if it exists, or default |
| 1163 | if it doesn't. The default defaults to None. This is quicker for |
| 1164 | some applications than using either has_key() or try:...except |
| 1165 | KeyError:.... |
| 1166 | |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 1167 | - Tools/webchecker/: some small changes to webchecker.py; added |
| 1168 | websucker.py (a simple web site mirroring script). |
| 1169 | |
| 1170 | - Dictionary objects now have a get() method (also in UserDict.py). |
| 1171 | dict.get(key, default) returns dict[key] if it exists and default |
| 1172 | otherwise; default defaults to None. |
| 1173 | |
| 1174 | - Tools/scripts/logmerge.py: print the author, too. |
| 1175 | |
| 1176 | - Changes to import: support for "import a.b.c" is now built in. See |
| 1177 | http://grail.cnri.reston.va.us/python/essays/packages.html |
| 1178 | for more info. Most important deviations from "ni.py": __init__.py is |
| 1179 | executed in the package's namespace instead of as a submodule; and |
| 1180 | there's no support for "__" or "__domain__". Note that "ni.py" is not |
| 1181 | changed to match this -- it is simply declared obsolete (while at the |
| 1182 | same time, it is documented...:-( ). |
| 1183 | Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py" |
| 1184 | for an example implementation of hierarchical module import written in |
| 1185 | Python). |
| 1186 | |
| 1187 | - More changes to import: the site.py module is now imported by |
| 1188 | default when Python is initialized; use -S to disable it. The site.py |
| 1189 | module extends the path with several more directories: site-packages |
| 1190 | inside the lib/python1.5/ directory, site-python in the lib/ |
| 1191 | directory, and pathnames mentioned in *.pth files found in either of |
| 1192 | those directories. See |
| 1193 | http://grail.cnri.reston.va.us/python/essays/packages.html |
| 1194 | for more info. |
| 1195 | |
| 1196 | - Changes to standard library subdirectory names: those subdirectories |
| 1197 | that are not packages have been renamed with a hypen in their name, |
| 1198 | e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3. |
| 1199 | The test suite is now a package -- to run a test, you must now use |
| 1200 | "import test.test_foo". |
| 1201 | |
| 1202 | - A completely new re.py module is provided (thanks to Andrew |
| 1203 | Kuchling) which uses Philip Hazel's "pcre" re compiler and engine. |
| 1204 | For a while, the "old" re.py (which was new in 1.5a3!) will be kept |
| 1205 | around as re1.py. The "old" regex module and underlying parser and |
| 1206 | engine are still present -- while regex is now officially obsolete, it |
| 1207 | will probably take several major release cycles before it can be |
| 1208 | removed. |
| 1209 | |
| 1210 | - The posix module now has a strerror() function which translates an |
| 1211 | error code to a string. |
| 1212 | |
| 1213 | - The emacs.py module (which was long obsolete) has been removed. |
| 1214 | |
| 1215 | - The universal makefile Misc/Makefile.pre.in now features an |
| 1216 | "install" target. By default, installed shared libraries go into |
| 1217 | $exec_prefix/lib/python$VERSION/site-packages/. |
| 1218 | |
| 1219 | - The install-sh script is installed with the other configuration |
| 1220 | specific files (in the config/ subdirectory). |
| 1221 | |
| 1222 | - It turns out whatsound.py and sndhdr.py were identical modules. |
| 1223 | Since there's also an imghdr.py file, I propose to make sndhdr.py the |
| 1224 | official one. For compatibility, whatsound.py imports * from |
| 1225 | sndhdr.py. |
| 1226 | |
| 1227 | - Class objects have a new attribute, __module__, giving the name of |
| 1228 | the module in which they were declared. This is useful for pickle and |
| 1229 | for printing the full name of a class exception. |
| 1230 | |
| 1231 | - Many extension modules no longer issue a fatal error when their |
| 1232 | initialization fails; the importing code now checks whether an error |
| 1233 | occurred during module initialization, and correctly propagates the |
| 1234 | exception to the import statement. |
| 1235 | |
| 1236 | - Most extension modules now raise class-based exceptions (except when |
| 1237 | -X is used). |
| 1238 | |
| 1239 | - Subtle changes to PyEval_{Save,Restore}Thread(): always swap the |
| 1240 | thread state -- just don't manipulate the lock if it isn't there. |
| 1241 | |
| 1242 | - Fixed a bug in Python/getopt.c that made it do the wrong thing when |
| 1243 | an option was a single '-'. Thanks to Andrew Kuchling. |
| 1244 | |
| 1245 | - New module mimetypes.py will guess a MIME type from a filename's |
| 1246 | extension. |
| 1247 | |
| 1248 | - Windows: the DLL version is now settable via a resource rather than |
| 1249 | being hardcoded. This can be used for "branding" a binary Python |
| 1250 | distribution. |
| 1251 | |
| 1252 | - urllib.py is now threadsafe -- it now uses re instead of regex, and |
| 1253 | sys.exc_info() instead of sys.exc_{type,value}. |
| 1254 | |
| 1255 | - Many other library modules that used to use |
| 1256 | sys.exc_{type,value,traceback} are now more thread-safe by virtue of |
| 1257 | using sys.exc_info(). |
| 1258 | |
| 1259 | - The functions in popen2 have an optional buffer size parameter. |
| 1260 | Also, the command argument can now be either a string (passed to the |
| 1261 | shell) or a list of arguments (passed directly to execv). |
| 1262 | |
Guido van Rossum | b68b77f | 1997-10-07 19:12:50 +0000 | [diff] [blame] | 1263 | |
| 1264 | - Alas, the thread support for _tkinter released with 1.5a3 didn't |
| 1265 | work. It's been rewritten. The bad news is that it now requires a |
| 1266 | modified version of a file in the standard Tcl distribution, which you |
| 1267 | must compile with a -I option pointing to the standard Tcl source |
| 1268 | tree. For this reason, the thread support is disabled by default. |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 1269 | |
| 1270 | - The errno extension module adds two tables: errorcode maps errno |
Guido van Rossum | 764a377 | 1997-10-08 22:49:49 +0000 | [diff] [blame] | 1271 | numbers to errno names (e.g. EINTR), and errorstr maps them to |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 1272 | message strings. (The latter is redundant because the new call |
| 1273 | posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg) |
| 1274 | |
| 1275 | - The readline extension module now provides some interfaces to |
| 1276 | internal readline routines that make it possible to write a completer |
| 1277 | in Python. An example completer, rlcompleter.py, is provided. |
| 1278 | |
| 1279 | When completing a simple identifier, it completes keywords, |
| 1280 | built-ins and globals in __main__; when completing |
| 1281 | NAME.NAME..., it evaluates (!) the expression up to the last |
| 1282 | dot and completes its attributes. |
| 1283 | |
| 1284 | It's very cool to do "import string" type "string.", hit the |
| 1285 | completion key (twice), and see the list of names defined by |
| 1286 | the string module! |
| 1287 | |
| 1288 | Tip: to use the tab key as the completion key, call |
| 1289 | |
| 1290 | readline.parse_and_bind("tab: complete") |
| 1291 | |
| 1292 | - The traceback.py module has a new function tb_lineno() by Marc-Andre |
| 1293 | Lemburg which extracts the line number from the linenumber table in |
| 1294 | the code object. Apparently the traceback object doesn't contains the |
| 1295 | right linenumber when -O is used. Rather than guessing whether -O is |
| 1296 | on or off, the module itself uses tb_lineno() unconditionally. |
| 1297 | |
| 1298 | - Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind() |
| 1299 | to tag_bind() so it works again. |
| 1300 | |
| 1301 | - The pystone script is now a standard library module. Example use: |
| 1302 | "import test.pystone; test.pystone.main()". |
| 1303 | |
| 1304 | - The import of the readline module in interactive mode is now also |
| 1305 | attempted when -i is specified. (Yes, I know, giving in to Marc-Andre |
| 1306 | Lemburg, who asked for this. :-) |
| 1307 | |
| 1308 | - rfc822.py: Entirely rewritten parseaddr() function by Sjoerd |
| 1309 | Mullender, to be closer to the standard. This fixes the getaddr() |
| 1310 | method. Unfortunately, getaddrlist() is as broken as ever, since it |
| 1311 | splits on commas without regard for RFC 822 quoting conventions. |
| 1312 | |
| 1313 | - pprint.py: correctly emit trailing "," in singleton tuples. |
| 1314 | |
| 1315 | - _tkinter.c: export names for its type objects, TkappType and |
| 1316 | TkttType. |
| 1317 | |
| 1318 | - pickle.py: use __module__ when defined; fix a particularly hard to |
| 1319 | reproduce bug that confuses the memo when temporary objects are |
| 1320 | returned by custom pickling interfaces; and a semantic change: when |
| 1321 | unpickling the instance variables of an instance, use |
| 1322 | inst.__dict__.update(value) instead of a for loop with setattr() over |
| 1323 | the value.keys(). This is more consistent (the pickling doesn't use |
| 1324 | getattr() either but pickles inst.__dict__) and avoids problems with |
| 1325 | instances that have a __setattr__ hook. But it *is* a semantic change |
| 1326 | (because the setattr hook is no longer used). So beware! |
| 1327 | |
| 1328 | - config.h is now installed (at last) in |
| 1329 | $exec_prefix/include/python1.5/. For most sites, this means that it |
| 1330 | is actually in $prefix/include/python1.5/, with all the other Python |
| 1331 | include files, since $prefix and $exec_prefix are the same by |
| 1332 | default. |
| 1333 | |
| 1334 | - The imp module now supports parts of the functionality to implement |
| 1335 | import of hierarchical module names. It now supports find_module() |
| 1336 | and load_module() for all types of modules. Docstrings have been |
Guido van Rossum | b68b77f | 1997-10-07 19:12:50 +0000 | [diff] [blame] | 1337 | added for those functions in the built-in imp module that are still |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 1338 | relevant (some old interfaces are obsolete). For a sample |
| 1339 | implementation of hierarchical module import in Python, see the new |
| 1340 | library module knee.py. |
| 1341 | |
| 1342 | - The % operator on string objects now allows arbitrary nested parens |
| 1343 | in a %(...)X style format. (Brad Howes) |
| 1344 | |
| 1345 | - Reverse the order in which Setup and Setup.local are passed to the |
| 1346 | makesetup script. This allows variable definitions in Setup.local to |
| 1347 | override definitions in Setup. (But you'll still have to edit Setup |
| 1348 | if you want to disable modules that are enabled by default, or if such |
| 1349 | modules need non-standard options.) |
| 1350 | |
| 1351 | - Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this |
| 1352 | is like PyImport_ImporModule(name) but receives the globals and locals |
| 1353 | dict and the fromlist arguments as well. (The name is a char*; the |
| 1354 | others are PyObject*s). |
| 1355 | |
| 1356 | - The 'p' format in the struct extension module alloded to above is |
| 1357 | new in 1.5a4. |
| 1358 | |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 1359 | - The types.py module now uses try-except in a few places to make it |
| 1360 | more likely that it can be imported in restricted mode. Some type |
| 1361 | names are undefined in that case, e.g. CodeType (inaccessible), |
| 1362 | FileType (not always accessible), and TracebackType and FrameType |
| 1363 | (inaccessible). |
| 1364 | |
| 1365 | - In urllib.py: added separate administration of temporary files |
| 1366 | created y URLopener.retrieve() so cleanup() can properly remove them. |
| 1367 | The old code removed everything in tempcache which was a bad idea if |
| 1368 | the user had passed a non-temp file into it. Also, in basejoin(), |
| 1369 | interpret relative paths starting in "../". This is necessary if the |
| 1370 | server uses symbolic links. |
| 1371 | |
| 1372 | - The Windows build procedure and project files are now based on |
| 1373 | Microsoft Visual C++ 5.x. The build now takes place in the PCbuild |
| 1374 | directory. It is much more robust, and properly builds separate Debug |
| 1375 | and Release versions. (The installer will be added shortly.) |
| 1376 | |
| 1377 | - Added casts and changed some return types in regexpr.c to avoid |
| 1378 | compiler warnings or errors on some platforms. |
| 1379 | |
| 1380 | - The AIX build tools for shared libraries now supports VPATH. (Donn |
| 1381 | Cave) |
| 1382 | |
| 1383 | - By default, disable the "portable" multimedia modules audioop, |
| 1384 | imageop, and rgbimg, since they don't work on 64-bit platforms. |
| 1385 | |
| 1386 | - Fixed a nasty bug in cStringIO.c when code was actually using the |
| 1387 | close() method (the destructors would try to free certain fields a |
| 1388 | second time). |
| 1389 | |
| 1390 | - For those who think they need it, there's a "user.py" module. This |
| 1391 | is *not* imported by default, but can be imported to run user-specific |
| 1392 | setup commands, ~/.pythonrc.py. |
| 1393 | |
| 1394 | - Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg, |
| 1395 | Vladimir Marangozov, and others. |
| 1396 | |
| 1397 | - Added os.altsep; this is '/' on DOS/Windows, and None on systems |
| 1398 | with a sane filename syntax. |
| 1399 | |
| 1400 | - os.py: Write out the dynamic OS choice, to avoid exec statements. |
| 1401 | Adding support for a new OS is now a bit more work, but I bet that |
| 1402 | 'dos' or 'nt' will cover most situations... |
| 1403 | |
| 1404 | - The obsolete exception AccessError is now really gone. |
| 1405 | |
| 1406 | - Tools/faqwiz/: New installation instructions show how to maintain |
| 1407 | multiple FAQs. Removed bootstrap script from end of faqwiz.py module. |
Guido van Rossum | b68b77f | 1997-10-07 19:12:50 +0000 | [diff] [blame] | 1408 | Added instructions to bootstrap script, too. Version bumped to 0.8.1. |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 1409 | Added <html>...</html> feature suggested by Skip Montanaro. Added |
| 1410 | leading text for Roulette, default to 'Hit Reload ...'. Fix typo in |
| 1411 | default SRCDIR. |
| 1412 | |
| 1413 | - Documentation for the relatively new modules "keyword" and "symbol" |
| 1414 | has been added (to the end of the section on the parser extension |
| 1415 | module). |
Guido van Rossum | b68b77f | 1997-10-07 19:12:50 +0000 | [diff] [blame] | 1416 | |
| 1417 | - In module bisect.py, but functions have two optional argument 'lo' |
| 1418 | and 'hi' which allow you to specify a subsequence of the array to |
| 1419 | operate on. |
| 1420 | |
| 1421 | - In ftplib.py, changed most methods to return their status (even when |
| 1422 | it is always "200 OK") rather than swallowing it. |
Guido van Rossum | 764a377 | 1997-10-08 22:49:49 +0000 | [diff] [blame] | 1423 | |
| 1424 | - main() now calls setlocale(LC_ALL, ""), if setlocale() and |
| 1425 | <locale.h> are defined. |
Guido van Rossum | 9a513ef | 1997-10-09 23:32:24 +0000 | [diff] [blame] | 1426 | |
| 1427 | - Changes to configure.in, the configure script, and both |
| 1428 | Makefile.pre.in files, to support SGI's SGI_ABI platform selection |
| 1429 | environment variable. |
Guido van Rossum | 7ea639b | 1997-11-26 16:36:28 +0000 | [diff] [blame] | 1430 | |
| 1431 | |
| 1432 | ====================================================================== |
| 1433 | |
| 1434 | |
| 1435 | From 1.5a4 to 1.5b1 |
| 1436 | =================== |
| 1437 | |
| 1438 | - The Windows NT/95 installer now includes full HTML of all manuals. |
| 1439 | It also has a checkbox that lets you decide whether to install the |
| 1440 | interpreter and library. The WISE installer script for the installer |
| 1441 | is included in the source tree as PC/python15.wse, and so are the |
| 1442 | icons used for Python files. The config.c file for the Windows build |
| 1443 | is now complete with the pcre module. |
| 1444 | |
| 1445 | - sys.ps1 and sys.ps2 can now arbitrary objects; their str() is |
| 1446 | evaluated for the prompt. |
| 1447 | |
| 1448 | - The reference manual is brought up to date (more or less -- it still |
| 1449 | needs work, e.g. in the area of package import). |
| 1450 | |
| 1451 | - The icons used by latex2html are now included in the Doc |
| 1452 | subdirectory (mostly so that tarring up the HTML files can be fully |
| 1453 | automated). A simple index.html is also added to Doc (it only works |
| 1454 | after you have successfully run latex2html). |
| 1455 | |
| 1456 | - For all you would-be proselytizers out there: a new version of |
| 1457 | Misc/BLURB describes Python more concisely, and Misc/comparisons |
| 1458 | compares Python to several other languages. Misc/BLURB.WINDOWS |
| 1459 | contains a blurb specifically aimed at Windows programmers (by Mark |
| 1460 | Hammond). |
| 1461 | |
| 1462 | - A new version of the Python mode for Emacs is included as |
| 1463 | Misc/python-mode.el. There are too many new features to list here. |
| 1464 | See http://www.python.org/ftp/emacs/pmdetails.html for more info. |
| 1465 | |
| 1466 | - New module fileinput makes iterating over the lines of a list of |
| 1467 | files easier. (This still needs some more thinking to make it more |
| 1468 | extensible.) |
| 1469 | |
| 1470 | - There's full OS/2 support, courtesy Jeff Rush. To build the OS/2 |
| 1471 | version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual |
| 1472 | Age C++ compiler. I expect that Jeff will also provide a binary |
| 1473 | release for this platform. |
| 1474 | |
| 1475 | - On Linux, the configure script now uses '-Xlinker -export-dynamic' |
| 1476 | instead of '-rdynamic' to link the main program so that it exports its |
| 1477 | symbols to shared libraries it loads dynamically. I hope this doesn't |
| 1478 | break on older Linux versions; it is needed for mklinux and appears to |
| 1479 | work on Linux 2.0.30. |
| 1480 | |
| 1481 | - Some Tkinter resstructuring: the geometry methods that apply to a |
| 1482 | master are now properly usable on toplevel master widgets. There's a |
| 1483 | new (internal) widget class, BaseWidget. New, longer "official" names |
| 1484 | for the geometry manager methods have been added, |
| 1485 | e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old |
| 1486 | shorter names still work, and where there's ambiguity, pack wins over |
| 1487 | place wins over grid. Also, the bind_class method now returns its |
| 1488 | value. |
| 1489 | |
| 1490 | - New, RFC-822 conformant parsing of email addresses and address lists |
| 1491 | in the rfc822 module, courtesy Ben Escoto. |
| 1492 | |
| 1493 | - New, revamped tkappinit.c with support for popular packages (PIL, |
| 1494 | TIX, BLT, TOGL). For the last three, you need to execute the Tcl |
| 1495 | command "load {} Tix" (or Blt, or Togl) to gain access to them. |
| 1496 | The Modules/Setup line for the _tkinter module has been rewritten |
| 1497 | using the cool line-breaking feature of most Bourne shells. |
| 1498 | |
| 1499 | - New socket method connect_ex() returns the error code from connect() |
| 1500 | instead of raising an exception on errors; this makes the logic |
| 1501 | required for asynchronous connects simpler and more efficient. |
| 1502 | |
| 1503 | - New "locale" module with (still experimental) interface to the |
| 1504 | standard C library locale interface, courtesy Martin von Loewis. This |
| 1505 | does not repeat my mistake in 1.5a4 of always calling |
| 1506 | setlocale(LC_ALL, ""). In fact, we've pretty much decided that |
| 1507 | Python's standard numerical formatting operations should always use |
| 1508 | the conventions for the C locale; the locale module contains utility |
| 1509 | functions to format numbers according to the user specified locale. |
| 1510 | (All this is accomplished by an explicit call to setlocale(LC_NUMERIC, |
| 1511 | "C") after locale-changing calls.) See the library manual. (Alas, the |
| 1512 | promised changes to the "re" module for locale support have not been |
| 1513 | materialized yet. If you care, volunteer!) |
| 1514 | |
| 1515 | - Memory leak plugged in Py_BuildValue when building a dictionary. |
| 1516 | |
| 1517 | - Shared modules can now live inside packages (hierarchical module |
| 1518 | namespaces). No changes to the shared module itself are needed. |
| 1519 | |
| 1520 | - Improved policy for __builtins__: this is a module in __main__ and a |
| 1521 | dictionary everywhere else. |
| 1522 | |
| 1523 | - Python no longer catches SIGHUP and SIGTERM by default. This was |
| 1524 | impossible to get right in the light of thread contexts. If you want |
| 1525 | your program to clean up when a signal happens, use the signal module |
| 1526 | to set up your own signal handler. |
| 1527 | |
| 1528 | - New Python/C API PyNumber_CoerceEx() does not return an exception |
| 1529 | when no coercion is possible. This is used to fix a problem where |
| 1530 | comparing incompatible numbers for equality would raise an exception |
| 1531 | rather than return false as in Python 1.4 -- it once again will return |
| 1532 | false. |
| 1533 | |
| 1534 | - The errno module is changed again -- the table of error messages |
| 1535 | (errorstr) is removed. Instead, you can use os.strerror(). This |
| 1536 | removes redundance and a potential locale dependency. |
| 1537 | |
| 1538 | - New module xmllib, to parse XML files. By Sjoerd Mullender. |
| 1539 | |
| 1540 | - New C API PyOS_AfterFork() is called after fork() in posixmodule.c. |
| 1541 | It resets the signal module's notion of what the current process ID |
| 1542 | and thread are, so that signal handlers will work after (and across) |
| 1543 | calls to os.fork(). |
| 1544 | |
| 1545 | - Fixed most occurrences of fatal errors due to missing thread state. |
| 1546 | |
| 1547 | - For vgrind (a flexible source pretty printer) fans, there's a simple |
| 1548 | Python definition in Misc/vgrindefs, courtesy Neale Pickett. |
| 1549 | |
| 1550 | - Fixed memory leak in exec statement. |
| 1551 | |
| 1552 | - The test.pystone module has a new function, pystones(loops=LOOPS), |
| 1553 | which returns a (benchtime, stones) tuple. The main() function now |
| 1554 | calls this and prints the report. |
| 1555 | |
| 1556 | - Package directories now *require* the presence of an __init__.py (or |
| 1557 | __init__.pyc) file before they are considered as packages. This is |
| 1558 | done to prevent accidental subdirectories with common names from |
| 1559 | overriding modules with the same name. |
| 1560 | |
| 1561 | - Fixed some strange exceptions in __del__ methods in library modules |
| 1562 | (e.g. urllib). This happens because the builtin names are already |
| 1563 | deleted by the time __del__ is called. The solution (a hack, but it |
| 1564 | works) is to set some instance variables to 0 instead of None. |
| 1565 | |
| 1566 | - The table of built-in module initializers is replaced by a pointer |
| 1567 | variable. This makes it possible to switch to a different table at |
| 1568 | run time, e.g. when a collection of modules is loaded from a shared |
| 1569 | library. (No example code of how to do this is given, but it is |
| 1570 | possible.) The table is still there of course, its name prefixed with |
| 1571 | an underscore and used to initialize the pointer. |
| 1572 | |
| 1573 | - The warning about a thread still having a frame now only happens in |
| 1574 | verbose mode. |
| 1575 | |
| 1576 | - Change the signal finialization so that it also resets the signal |
| 1577 | handlers. After this has been called, our signal handlers are no |
| 1578 | longer active! |
| 1579 | |
| 1580 | - New version of tokenize.py (by Ka-Ping Yee) recognizes raw string |
| 1581 | literals. There's now also a test fort this module. |
| 1582 | |
| 1583 | - The copy module now also uses __dict__.update(state) instead of |
| 1584 | going through individual attribute assignments, for class instances |
| 1585 | without a __setstate__ method. |
| 1586 | |
| 1587 | - New module reconvert translates old-style (regex module) regular |
| 1588 | expressions to new-style (re module, Perl-style) regular expressions. |
| 1589 | |
| 1590 | - Most modules that used to use the regex module now use the re |
| 1591 | module. The grep module has a new pgrep() function which uses |
| 1592 | Perl-style regular expressions. |
| 1593 | |
| 1594 | - The (very old, backwards compatibility) regexp.py module has been |
| 1595 | deleted. |
| 1596 | |
| 1597 | - Restricted execution (rexec): added the pcre module (support for the |
| 1598 | re module) to the list of trusted extension modules. |
| 1599 | |
| 1600 | - New version of Jim Fulton's CObject object type, adds |
| 1601 | PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs. |
| 1602 | |
| 1603 | - Some patches to Lee Busby's fpectl mods that accidentally didn't |
| 1604 | make it into 1.5a4. |
| 1605 | |
| 1606 | - In the string module, add an optional 4th argument to count(), |
| 1607 | matching find() etc. |
| 1608 | |
| 1609 | - Patch for the nntplib module by Charles Waldman to add optional user |
| 1610 | and password arguments to NNTP.__init__(), for nntp servers that need |
| 1611 | them. |
| 1612 | |
| 1613 | - The str() function for class objects now returns |
| 1614 | "modulename.classname" instead of returning the same as repr(). |
| 1615 | |
| 1616 | - The parsing of \xXX escapes no longer relies on sscanf(). |
| 1617 | |
| 1618 | - The "sharedmodules" subdirectory of the installation is renamed to |
| 1619 | "lib-dynload". (You may have to edit your Modules/Setup file to fix |
| 1620 | this in an existing installation!) |
| 1621 | |
| 1622 | - Fixed Don Beaudry's mess-up with the OPT test in the configure |
| 1623 | script. Certain SGI platforms will still issue a warning for each |
| 1624 | compile; there's not much I can do about this since the compiler's |
| 1625 | exit status doesn't indicate that I was using an obsolete option. |
| 1626 | |
| 1627 | - Fixed Barry's mess-up with {}.get(), and added test cases for it. |
| 1628 | |
| 1629 | - Shared libraries didn't quite work under AIX because of the change |
| 1630 | in status of the GNU readline interface. Fix due to by Vladimir |
| 1631 | Marangozov. |
| 1632 | |
| 1633 | |
| 1634 | ====================================================================== |