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 | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 4 | Below is a list of all relevant changes since the release 1.4, up till |
| 5 | the release of 1.5a3. At the end is a list of changes made since |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 6 | 1.5a3 up to the release of 1.5a4. |
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 |
| 9 | here, I'm grateful to many more people who remain anonymous. You may |
| 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 | |
| 14 | Security |
| 15 | -------- |
| 16 | |
| 17 | - If you are using the setuid script C wrapper (Misc/setuid-prog.c), |
| 18 | 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] | 19 | |
| 20 | Miscellaneous |
| 21 | ------------- |
| 22 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 23 | - Because of various (small) incompatible changes in the Python |
| 24 | bytecode interpreter, the magic number for .pyc files has changed |
| 25 | again. |
| 26 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 27 | - The default module search path is now much saner. Both on Unix and |
| 28 | Windows, it is essentially derived from the path to the executable |
| 29 | (which can be overridden by setting the environment variable |
| 30 | $PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in |
| 31 | front of the default path, like in Unix (instead of overriding the |
| 32 | default path). On Windows, the directory containing the executable is |
| 33 | added to the end of the path. |
| 34 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 35 | - A new version of python-mode.el for Emacs has been included. Also, |
| 36 | a new file ccpy-style.el has been added to configure Emacs cc-mode for |
| 37 | the preferred style in Python C sources. |
| 38 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 39 | - On Unix, when using sys.argv[0] to insert the script directory in |
| 40 | front of sys.path, expand a symbolic link. You can now install a |
| 41 | program in a private directory and have a symbolic link to it in a |
| 42 | public bin directory, and it will put the private directory in the |
| 43 | module search path. Note that the symlink is expanded in sys.path[0] |
| 44 | but not in sys.argv[0], so you can still tell the name by which you |
| 45 | were invoked. |
| 46 | |
| 47 | - It is now recommended to use ``#!/usr/bin/env python'' instead of |
| 48 | ``#!/usr/local/bin/python'' at the start of executable scripts, except |
| 49 | for CGI scripts. It has been determined that the use of /usr/bin/env |
| 50 | is more portable than that of /usr/local/bin/python -- scripts almost |
| 51 | never have to be edited when the Python interpreter lives in a |
| 52 | non-standard place. Note that this doesn't work for CGI scripts since |
| 53 | the python executable often doesn't live in the HTTP server's default |
| 54 | search path. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 55 | |
| 56 | - The silly -s command line option and the corresponding |
| 57 | PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global |
| 58 | flag in the Python/C API) are gone. |
| 59 | |
| 60 | - Most problems on 64-bit platforms should now be fixed. Andrew |
| 61 | Kuchling helped. Some uncommon extension modules are still not |
| 62 | clean (image and audio ops?). |
| 63 | |
| 64 | - Fixed a bug where multiple anonymous tuple arguments would be mixed up |
| 65 | when using the debugger or profiler (reported by Just van Rossum). |
| 66 | The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this |
| 67 | would print the wrong value when run under the debugger or profiler. |
| 68 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 69 | - The hacks that the dictionary implementation used to speed up |
| 70 | repeated lookups of the same C string were removed; these were a |
| 71 | source of subtle problems and don't seem to serve much of a purpose |
| 72 | any longer. |
| 73 | |
| 74 | - All traces of support for the long dead access statement have been |
| 75 | removed from the sources. |
| 76 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 77 | - Plugged the two-byte memory leak in the tokenizer when reading an |
| 78 | interactive EOF. |
| 79 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 80 | - There's a -O option to the interpreter that removes SET_LINENO |
| 81 | instructions and assert statements (see below); it uses and produces |
| 82 | .pyo files instead of .pyc files. The speedup is only a few percent |
| 83 | in most cases. The line numbers are still available in the .pyo file, |
| 84 | as a separate table (which is also available in .pyc files). However, |
| 85 | the removal of the SET_LINENO instructions means that the debugger |
| 86 | (pdb) can't set breakpoints on lines in -O mode. The traceback module |
| 87 | contains a function to extract a line number from the code object |
| 88 | referenced in a traceback object. In the future it should be possible |
| 89 | to write external bytecode optimizers that create better optimized |
| 90 | .pyo files, and there should be more control over optimization; |
| 91 | consider the -O option a "teaser". Without -O, the assert statement |
| 92 | actually generates code that first checks __debug__; if this variable |
| 93 | is false, the assertion is not checked. __debug__ is a built-in |
| 94 | variable whose value is initialized to track the -O flag (it's true |
| 95 | iff -O is not specified). With -O, no code is generated for assert |
| 96 | statements, nor for code of the form ``if __debug__: <something>''. |
| 97 | Sorry, no further constant folding happens. |
| 98 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 99 | |
| 100 | Performance |
| 101 | ----------- |
| 102 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 103 | - It's much faster (almost twice for pystone.py -- see |
| 104 | Tools/scripts). See the entry on string interning below. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 105 | |
| 106 | - Some speedup by using separate free lists for method objects (both |
| 107 | the C and the Python variety) and for floating point numbers. |
| 108 | |
| 109 | - Big speedup by allocating frame objects with a single malloc() call. |
| 110 | The Python/C API for frames is changed (you shouldn't be using this |
| 111 | anyway). |
| 112 | |
| 113 | - Significant speedup by inlining some common opcodes for common operand |
| 114 | types (e.g. i+i, i-i, and list[i]). Fredrik Lundh. |
| 115 | |
| 116 | - Small speedup by reordering the method tables of some common |
| 117 | objects (e.g. list.append is now first). |
| 118 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 119 | - Big optimization to the read() method of file objects. A read() |
| 120 | without arguments now attempts to use fstat to allocate a buffer of |
| 121 | the right size; for pipes and sockets, it will fall back to doubling |
| 122 | the buffer size. While that the improvement is real on all systems, |
| 123 | it is most dramatic on Windows. |
| 124 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 125 | |
| 126 | Documentation |
| 127 | ------------- |
| 128 | |
| 129 | - Many new pieces of library documentation were contributed, mostly by |
| 130 | Andrew Kuchling. Even cmath is now documented! There's also a |
| 131 | chapter of the library manual, "libundoc.tex", which provides a |
| 132 | listing of all undocumented modules, plus their status (e.g. internal, |
| 133 | obsolete, or in need of documentation). Also contributions by Sue |
| 134 | Williams, Skip Montanaro, and some module authors who succumbed to |
| 135 | pressure to document their own contributed modules :-). Note that |
| 136 | printing the documentation now kills fewer trees -- the margins have |
| 137 | been reduced. |
| 138 | |
| 139 | - I have started documenting the Python/C API. Unfortunately this project |
| 140 | hasn't been completed yet. It will be complete before the final release of |
| 141 | Python 1.5, though. At the moment, it's better to read the LaTeX source |
| 142 | than to attempt to run it through LaTeX and print the resulting dvi file. |
| 143 | |
| 144 | - The posix module (and hence os.py) now has doc strings! Thanks to Neil |
| 145 | Schemenauer. I received a few other contributions of doc strings. In most |
| 146 | other places, doc strings are still wishful thinking... |
| 147 | |
| 148 | |
| 149 | Language changes |
| 150 | ---------------- |
| 151 | |
| 152 | - Private variables with leading double underscore are now a permanent |
| 153 | feature of the language. (These were experimental in release 1.4. I have |
| 154 | favorable experience using them; I can't label them "experimental" |
| 155 | forever.) |
| 156 | |
| 157 | - There's new string literal syntax for "raw strings". Prefixing a string |
| 158 | literal with the letter r (or R) disables all escape processing in the |
| 159 | string; for example, r'\n' is a two-character string consisting of a |
| 160 | backslash followed by the letter n. This combines with all forms of string |
| 161 | quotes; it is actually useful for triple quoted doc strings which might |
| 162 | contain references to \n or \t. An embedded quote prefixed with a |
| 163 | backslash does not terminate the string, but the backslash is still |
| 164 | included in the string; for example, r'\'' is a two-character string |
| 165 | consisting of a backslash and a quote. (Raw strings are also |
| 166 | affectionately known as Robin strings, after their inventor, Robin |
| 167 | Friedrich.) |
| 168 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 169 | - There's a simple assert statement, and a new exception |
| 170 | AssertionError. For example, ``assert foo > 0'' is equivalent to ``if |
| 171 | not foo > 0: raise AssertionError''. Sorry, the text of the asserted |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 172 | condition is not available; it would be too complicated to generate |
| 173 | code for this (since the code is generated from a parse tree). |
| 174 | However, the text is displayed as part of the traceback! |
| 175 | |
| 176 | - The raise statement has a new feature: when using "raise SomeClass, |
| 177 | somevalue" where somevalue is not an instance of SomeClass, it |
| 178 | instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an |
| 179 | instance of a *derived* class of SomeClass, the exception class raised |
| 180 | is set to somevalue.__class__, and SomeClass is ignored after that. |
| 181 | |
| 182 | - Duplicate keyword arguments are now detected at compile time; |
| 183 | f(a=1,a=2) is now a syntax error. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 184 | |
| 185 | |
| 186 | Changes to builtin features |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 187 | --------------------------- |
| 188 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 189 | - There's a new exception FloatingPointError (used only by Lee Busby's |
| 190 | patches to catch floating point exceptions, at the moment). |
| 191 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 192 | - The obsolete exception ConflictError (presumably used by the long |
| 193 | obsolete access statement) has been deleted. |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 194 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 195 | - There's a new function sys.exc_info() which returns the tuple |
| 196 | (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] | 197 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 198 | - There's a new variable sys.executable, pointing to the executable file |
| 199 | for the Python interpreter. |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 200 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 201 | - The sort() methods for lists no longer uses the C library qsort(); I |
| 202 | wrote my own quicksort implementation, with lots of help (in the form |
| 203 | of a kind of competition) from Tim Peters. This solves a bug in |
| 204 | dictionary comparisons on some Solaris versions when Python is built |
| 205 | with threads, and makes sorting lists even faster. |
| 206 | |
| 207 | - The semantics of comparing two dictionaries have changed, to make |
| 208 | comparison of unequal dictionaries faster. A shorter dictionary is |
| 209 | always considered smaller than a larger dictionary. For dictionaries |
| 210 | of the same size, the smallest differing element determines the |
| 211 | outcome (which yields the same results as before in this case, without |
| 212 | explicit sorting). Thanks to Aaron Watters for suggesting something |
| 213 | like this. |
| 214 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 215 | - The semantics of try-except have changed subtly so that calling a |
| 216 | function in an exception handler that itself raises and catches an |
| 217 | exception no longer overwrites the sys.exc_* variables. This also |
| 218 | alleviates the problem that objects referenced in a stack frame that |
| 219 | caught an exception are kept alive until another exception is caught |
| 220 | -- the sys.exc_* variables are restored to their previous value when |
| 221 | returning from a function that caught an exception. |
Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 222 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 223 | - There's a new "buffer" interface. Certain objects (e.g. strings and |
| 224 | arrays) now support the "buffer" protocol. Buffer objects are acceptable |
| 225 | whenever formerly a string was required for a write operation; mutable |
| 226 | buffer objects can be the target of a read operation using the call |
| 227 | f.readinto(buffer). A cool feature is that regular expression matching now |
| 228 | also work on array objects. Contribution by Jack Jansen. (Needs |
| 229 | documentation.) |
| 230 | |
| 231 | - String interning: dictionary lookups are faster when the lookup |
| 232 | string object is the same object as the key in the dictionary, not |
| 233 | just a string with the same value. This is done by having a pool of |
| 234 | "interned" strings. Most names generated by the interpreter are now |
| 235 | automatically interned, and there's a new built-in function intern(s) |
| 236 | that returns the interned version of a string. Interned strings are |
| 237 | not a different object type, and interning is totally optional, but by |
| 238 | interning most keys a speedup of about 15% was obtained for the |
| 239 | pystone benchmark. |
| 240 | |
| 241 | - Dictionary objects have several new methods; clear() and copy() have |
| 242 | the obvious semantics, while update(d) merges the contents of another |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 243 | dictionary d into this one, overriding existing keys. The dictionary |
| 244 | implementation file is now called dictobject.c rather than the |
| 245 | confusing mappingobject.c. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 246 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 247 | - The intrinsic function dir() is much smarter; it looks in __dict__, |
| 248 | __members__ and __methods__. |
| 249 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 250 | - The intrinsic functions int(), long() and float() can now take a |
| 251 | string argument and then do the same thing as string.atoi(), |
| 252 | string.atol(), and string.atof(). No second 'base' argument is |
| 253 | allowed, and complex() does not take a string (nobody cared enough). |
| 254 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 255 | - When a module is deleted, its globals are now deleted in two phases. |
| 256 | In the first phase, all variables whose name begins with exactly one |
| 257 | underscore are replaced by None; in the second phase, all variables |
| 258 | are deleted. This makes it possible to have global objects whose |
| 259 | destructors depend on other globals. The deletion order within each |
| 260 | phase is still random. |
| 261 | |
| 262 | - It is no longer an error for a function to be called without a |
| 263 | global variable __builtins__ -- an empty directory will be provided |
| 264 | by default. |
| 265 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 266 | - Guido's corollary to the "Don Beaudry hook": it is now possible to |
| 267 | 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] | 268 | faint of heart; and undocumented as yet, but basically if a base class |
| 269 | is an instance, its class will be instantiated to create the new |
| 270 | class. Jim Fulton will love it -- it also works with instances of his |
| 271 | "extension classes", since it is triggered by the presence of a |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 272 | __class__ attribute on the purported base class. See |
| 273 | Demo/metaclasses/index.html for an explanation and see that directory |
| 274 | for examples. |
| 275 | |
| 276 | - Another change is that the Don Beaudry hook is now invoked when |
| 277 | *any* base class is special. (Up to 1.5a3, the *last* special base |
| 278 | class is used; in 1.5a4, the more rational choice of the *first* |
| 279 | special base class is used.) |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 280 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 281 | - New optional parameter to the readlines() method of file objects. |
| 282 | This indicates the number of bytes to read (the actual number of bytes |
| 283 | read will be somewhat larger due to buffering reading until the end of |
| 284 | the line). Some optimizations have also been made to speed it up (but |
| 285 | not as much as read()). |
| 286 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 287 | - Complex numbers no longer have the ".conj" pseudo attribute; use |
| 288 | z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers |
| 289 | now *do* support the __members__ and __methods__ special attributes. |
| 290 | |
| 291 | - The complex() function now looks for a __complex__() method on class |
| 292 | instances before giving up. |
| 293 | |
| 294 | - Long integers now support arbitrary shift counts, so you can now |
| 295 | write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous |
| 296 | shift count for this.) |
| 297 | |
| 298 | - The hex() and oct() functions have been changed so that for regular |
| 299 | integers, they never emit a minus sign. For example, on a 32-bit |
| 300 | machine, oct(-1) now returns '037777777777' and hex(-1) returns |
| 301 | '0xffffffff'. While this may seem inconsistent, it is much more |
| 302 | useful. (For long integers, a minus sign is used as before, to fit |
| 303 | the result in memory :-) |
| 304 | |
| 305 | - The hash() function computes better hashes for several data types, |
| 306 | including strings, floating point numbers, and complex numbers. |
| 307 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 308 | |
| 309 | New extension modules |
| 310 | --------------------- |
| 311 | |
| 312 | - New extension modules cStringIO.c and cPickle.c, written by Jim |
| 313 | Fulton and other folks at Digital Creations. These are much more |
| 314 | efficient than their Python counterparts StringIO.py and pickle.py, |
| 315 | 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] | 316 | 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] | 317 | still significant. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 318 | |
| 319 | - New extension module zlibmodule.c, interfacing to the free zlib |
| 320 | library (gzip compatible compression). There's also a module gzip.py |
| 321 | which provides a higher level interface. Written by Andrew Kuchling |
| 322 | and Jeremy Hylton. |
| 323 | |
| 324 | - New module readline; see the "miscellaneous" section above. |
| 325 | |
| 326 | - New Unix extension module resource.c, by Jeremy Hylton, provides |
| 327 | access to getrlimit(), getrusage(), setrusage(), getpagesize(), and |
| 328 | related symbolic constants. |
| 329 | |
| 330 | - New extension puremodule.c, by Barry Warsaw, which interfaces to the |
| 331 | Purify(TM) C API. See also the file Misc/PURIFY.README. It is also |
| 332 | possible to enable Purify by simply setting the PURIFY Makefile |
| 333 | variable in the Modules/Setup file. |
| 334 | |
| 335 | |
| 336 | Changes in extension modules |
| 337 | ---------------------------- |
| 338 | |
| 339 | - The struct extension module has several new features to control byte |
| 340 | 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] | 341 | on platforms where this is not the native format. It uses uppercase |
| 342 | format codes for unsigned integers of various sizes (always using |
| 343 | Python long ints for 'I' and 'L'), 's' with a size prefix for strings, |
| 344 | 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] | 345 | the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces |
| 346 | big-endian data and '<' forces little-endian data; these also select |
| 347 | standard data sizes and disable automatic alignment (use pad bytes as |
| 348 | needed). |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 349 | |
| 350 | - The array module supports uppercase format codes for unsigned data |
| 351 | formats (like the struct module). |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 352 | |
| 353 | - The fcntl extension module now exports the needed symbolic |
| 354 | constants. (Formerly these were in FCNTL.py which was not available |
| 355 | or correct for all platforms.) |
| 356 | |
| 357 | - The extension modules dbm, gdbm and bsddb now check that the |
| 358 | database is still open before making any new calls. |
| 359 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 360 | - The dbhash module is no more. Use bsddb instead. (There's a third |
| 361 | party interface for the BSD 2.x code somewhere on the web; support for |
| 362 | bsddb will be deprecated.) |
| 363 | |
| 364 | - The gdbm module now supports a sync() method. |
| 365 | |
| 366 | - The socket module now has some new functions: getprotobyname(), and |
| 367 | the set {ntoh,hton}{s,l}(). |
| 368 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 369 | - Various modules now export their type object: socket.SocketType, |
| 370 | array.ArrayType. |
| 371 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 372 | - The socket module's accept() method now returns unknown addresses as |
| 373 | a tuple rather than raising an exception. (This can happen in |
| 374 | promiscuous mode.) Theres' also a new function getprotobyname(). |
| 375 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 376 | - The pthread support for the thread module now works on most platforms. |
| 377 | |
| 378 | - STDWIN is now officially obsolete. Support for it will eventually |
| 379 | be removed from the distribution. |
| 380 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 381 | - The binascii extension module is now hopefully fully debugged. |
| 382 | (XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never |
| 383 | received.) |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 384 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 385 | - audioop.c: added a ratecv() function; better handling of overflow in |
| 386 | add(). |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 387 | |
| 388 | - posixmodule.c: now exports the O_* flags (O_APPEND etc.). On |
| 389 | Windows, also O_TEXT and O_BINARY. The 'error' variable (the |
| 390 | exception is raises) is renamed -- its string value is now "os.error", |
| 391 | 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] | 392 | it when they see os.error reported as posix.error. The execve() |
| 393 | function now accepts any mapping object for the environment. |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 394 | |
| 395 | - A new version of the al (audio library) module for SGI was |
| 396 | contributed by Sjoerd Mullender. |
| 397 | |
| 398 | - The regex module has a new function get_syntax() which retrieves the |
| 399 | syntax setting set by set_syntax(). The code was also sanitized, |
| 400 | removing worries about unclean error handling. See also below for its |
| 401 | successor, re.py. |
| 402 | |
| 403 | - The "new" module (which creates new objects of various types) once |
| 404 | again has a fully functioning new.function() method. Dangerous as |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 405 | ever! Also, new.code() has several new arguments. |
| 406 | |
| 407 | - A problem has been fixed in the rotor module: on systems with signed |
| 408 | characters, rotor-encoded data was not portable when the key contained |
| 409 | 8-bit characters. Also, setkey() now requires its argument rather |
| 410 | than having broken code to default it. |
| 411 | |
| 412 | - The sys.builtin_module_names variable is now a tuple. Another new |
| 413 | variables in sys is sys.executable (the full path to the Python |
| 414 | binary, if known). |
| 415 | |
| 416 | - The specs for time.strftime() have undergone some revisions. It |
| 417 | appears that not all format characters are supported in the same way |
| 418 | on all platforms. Rather than reimplement it, we note these |
| 419 | differences in the documentation, and emphasize the shared set of |
| 420 | features. There's also a thorough test set (that occasionally finds |
| 421 | problems in the C library implementation, e.g. on some Linuxes), |
| 422 | thanks to Skip Montanaro. |
| 423 | |
| 424 | - The nis module seems broken when used with NIS+; unfortunately |
| 425 | 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] | 426 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 427 | |
| 428 | New library modules |
| 429 | ------------------- |
| 430 | |
| 431 | - New (still experimental) Perl-style regular expression module, |
| 432 | re.py, which uses a new interface for matching as well as a new |
| 433 | syntax; the new interface avoids the thread-unsafety of the regex |
| 434 | interface. This comes with a helper extension reopmodule.c and vastly |
| 435 | rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim |
| 436 | Peters, and Andrew Kuchling. See the documentation libre.tex. In |
| 437 | 1.5, the old regex module is still fully supported; in the future, it |
| 438 | will become obsolete. |
| 439 | |
| 440 | - New module gzip.py; see zlib above. |
| 441 | |
| 442 | - New module keyword.py exports knowledge about Python's built-in |
| 443 | keywords. (New version by Ka-Ping Yee.) |
| 444 | |
| 445 | - New module pprint.py (with documentation) which supports |
| 446 | pretty-printing of lists, tuples, & dictionaries recursively. By Fred |
| 447 | Drake. |
| 448 | |
| 449 | - New module code.py. The function code.compile_command() can |
| 450 | determine whether an interactively entered command is complete or not, |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 451 | distinguishing incomplete from invalid input. (XXX Unfortunately, |
| 452 | this seems broken at this moment, and I don't have the time to fix |
| 453 | it. It's probably better to add an explicit interface to the parser |
| 454 | for this.) |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 455 | |
Guido van Rossum | 522578e | 1997-08-28 03:43:21 +0000 | [diff] [blame] | 456 | - 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] | 457 | XDR data format as used by Sun RPC, for example. It uses the struct |
| 458 | module. |
| 459 | |
| 460 | |
| 461 | Changes in library modules |
| 462 | -------------------------- |
| 463 | |
| 464 | - Module codehack.py is now completely obsolete. |
| 465 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 466 | - The pickle.py module has been updated to make it compatible with the |
| 467 | new binary format that cPickle.c produces. By default it produces the |
| 468 | old all-ASCII format compatible with the old pickle.py, still much |
| 469 | faster than pickle.py; it will read both formats automatically. A few |
| 470 | other updates have been made. |
| 471 | |
| 472 | - A new helper module, copy_reg.py, is provided to register extensions |
| 473 | to the pickling code. |
| 474 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 475 | - Revamped module tokenize.py is much more accurate and has an |
| 476 | interface that makes it a breeze to write code to colorize Python |
| 477 | source code. Contributed by Ka-Ping Yee. |
| 478 | |
| 479 | - In ihooks.py, ModuleLoader.load_module() now closes the file under |
| 480 | all circumstances. |
| 481 | |
| 482 | - The tempfile.py module has a new class, TemporaryFile, which creates |
| 483 | an open temporary file that will be deleted automatically when |
| 484 | closed. This works on Windows and MacOS as well as on Unix. (Jim |
| 485 | Fulton.) |
| 486 | |
| 487 | - Changes to the cgi.py module: Most imports are now done at the |
| 488 | top of the module, which provides a speedup when using ni (Jim |
| 489 | Fulton). The problem with file upload to a Windows platform is solved |
| 490 | by using the new tempfile.TemporaryFile class; temporary files are now |
| 491 | always opened in binary mode (Jim Fulton). The cgi.escape() function |
| 492 | now takes an optional flag argument that quotes '"' to '"'. It |
| 493 | is now possible to invoke cgi.py from a command line script, to test |
| 494 | cgi scripts more easily outside an http server. There's an optional |
| 495 | limit to the size of uploads to POST (Skip Montanaro). Added a |
| 496 | 'strict_parsing' option to all parsing functions (Jim Fulton). The |
| 497 | 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] | 498 | the value of fields (Clarence Gardner). The FieldStorage class now |
| 499 | has a __len__() method. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 500 | |
| 501 | - 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] | 502 | responses are now accepted; and it is now thread-safe (by not using |
| 503 | the regex module). |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 504 | |
| 505 | - BaseHTTPModule.py: treat all HTTP/1.* versions the same. |
| 506 | |
| 507 | - The popen2.py module is now rewritten using a class, which makes |
| 508 | access to the standard error stream and the process id of the |
| 509 | subprocess possible. |
| 510 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 511 | - 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] | 512 | getdate_tz() method and a parsedate_tz() function; also a mktime_tz(). |
| 513 | Also added recognition of some non-standard date formats, by Lars |
| 514 | Wirzenius, and RFC 850 dates (Chris Lawrence). |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 515 | |
| 516 | - mhlib.py: various enhancements, including almost compatible parsing |
| 517 | of message sequence specifiers without invoking a subprocess. Also |
| 518 | added a createmessage() method by Lars Wirzenius. |
| 519 | |
| 520 | - The StringIO.StringIO class now supports readline(nbytes). (Lars |
| 521 | Wirzenius.) (Of course, you should be using cStringIO for performance.) |
| 522 | |
| 523 | - UserDict.py supports the new dictionary methods as well. |
| 524 | |
| 525 | - Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to |
| 526 | 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] | 527 | A bug was fixed in the test for invalid arguments. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 528 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 529 | - Module ftplib.py: added support for parsing a .netrc file (Fred |
| 530 | Drake). Also added an ntransfercmd() method to the FTP class, which |
| 531 | allows access to the expected size of a transfer when available, and a |
| 532 | parse150() function to the module which parses the corresponding 150 |
| 533 | response. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 534 | |
| 535 | - 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] | 536 | quote_plus() and unquote_plus() functions which are like quote() and |
| 537 | unquote() but also replace spaces with '+' or vice versa, for |
| 538 | encoding/decoding CGI form arguments. Catch all errors from the ftp |
| 539 | module. HTTP requests now add the Host: header line. The proxy |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 540 | variable names are now mapped to lower case, for Windows. The |
| 541 | spliturl() function no longer erroneously throws away all data past |
| 542 | the first newline. The basejoin() function now intereprets "../" |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 543 | correctly. I *believe* that the problems with "exception raised in |
| 544 | __del__" under certain circumstances have been fixed (mostly by |
| 545 | changes elsewher in the interpreter). |
| 546 | |
| 547 | - In urlparse.py, there is a cache for results in urlparse.urlparse(); |
| 548 | its size limit is set to 20. Also, new URL schemes shttp, https, and |
| 549 | snews are "supported". |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 550 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 551 | - shelve.py: use cPickle and cStringIO when available. Also added |
| 552 | a sync() method, which calls the database's sync() method if there is |
| 553 | one. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 554 | |
| 555 | - The mimetools.py module now uses the available Python modules for |
| 556 | decoding quoted-printable, uuencode and base64 formats, rather than |
| 557 | creating a subprocess. |
| 558 | |
| 559 | - The python debugger (pdb.py, and its base class bdb.py) now support |
| 560 | conditional breakpoints. See the docs. |
| 561 | |
| 562 | - The modules base64.py, uu.py and quopri.py can now be used as simple |
| 563 | command line utilities. |
| 564 | |
| 565 | - Various small fixes to the nntplib.py module that I can't bother to |
| 566 | document in detail. |
| 567 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 568 | - Sjoerd Mullender's mimify.py module now supports base64 encoding and |
| 569 | includes functions to handle the funny encoding you sometimes see in mail |
| 570 | headers. It is now documented. |
| 571 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 572 | - mailbox.py: Added BabylMailbox. Improved the way the mailbox is |
| 573 | gotten from the environment. |
| 574 | |
| 575 | - Many more modules now correctly open files in binary mode when this |
| 576 | is necessary on non-Unix platforms. |
| 577 | |
| 578 | - The copying functions in the undocumented module shutil.py are |
| 579 | smarter. |
| 580 | |
| 581 | - The Writer classes in the formatter.py module now have a flush() |
| 582 | method. |
| 583 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 584 | - The sgmllib.py module accepts hyphens and periods in the middle of |
| 585 | attribute names. While this is against the SGML standard, there is |
| 586 | some HTML out there that uses this... |
| 587 | |
| 588 | - The interface for the Python bytecode disassembler module, dis.py, |
| 589 | has been enhanced quite a bit. There's now one main function, |
| 590 | dis.dis(), which takes almost any kind of object (function, module, |
| 591 | class, instance, method, code object) and disassembles it; without |
| 592 | arguments it disassembles the last frame of the last traceback. The |
| 593 | other functions have changed slightly, too. |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 594 | |
| 595 | - The imghdr.py module recognizes new image types: BMP, PNG. |
| 596 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 597 | - 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] | 598 | [maxsplit]) which does substring replacements. It is actually |
| 599 | implemented in C in the strop module. The functions [r]find() an |
| 600 | [r]index() have an optional 4th argument indicating the end of the |
| 601 | substring to search, alsoo implemented by their strop counterparts. |
| 602 | (Remember, never import strop -- import string uses strop when |
| 603 | available with zero overhead.) |
| 604 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 605 | - The string.join() function now accepts any sequence argument, not |
| 606 | just lists and tuples. |
| 607 | |
| 608 | - The string.maketrans() requires its first two arguments to be |
| 609 | present. The old version didn't require them, but there's not much |
| 610 | point without them, and the documentation suggests that they are |
| 611 | required, so we fixed the code to match the documentation. |
| 612 | |
| 613 | - The regsub.py module has a function clear_cache(), which clears its |
| 614 | internal cache of compiled regular expressions. Also, the cache now |
| 615 | takes the current syntax setting into account. (However, this module |
| 616 | is now obsolete -- use the sub() or subn() functions or methods in the |
| 617 | re module.) |
| 618 | |
| 619 | - The undocumented module Complex.py has been removed, now that Python |
| 620 | has built-in complex numbers. A similar module remains as |
| 621 | Demo/classes/Complex.py, as an example. |
| 622 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 623 | |
| 624 | Changes to the build process |
| 625 | ---------------------------- |
| 626 | |
| 627 | - The way GNU readline is configured is totally different. The |
| 628 | --with-readline configure option is gone. It is now an extension |
| 629 | module, which may be loaded dynamically. You must enable it (and |
| 630 | specify the correct linraries to link with) in the Modules/Setup file. |
| 631 | Importing the module installs some hooks which enable command line |
| 632 | editing. When the interpreter shell is invoked interactively, it |
| 633 | attempts to import the readline module; when this fails, the default |
| 634 | input mechanism is used. The hook variables are PyOS_InputHook and |
| 635 | PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with |
| 636 | ideas from William Magro.) |
| 637 | |
| 638 | - New build procedure: a single library, libpython1.5.a, is now built, |
| 639 | which contains absolutely everything except for a one-line main() |
| 640 | program (which calls Py_Main(argc, argv) to start the interpreter |
| 641 | shell). This makes life much simpler for applications that need to |
| 642 | embed Python. The serial number of the build is now included in the |
| 643 | version string (sys.version). |
| 644 | |
| 645 | - As far as I can tell, neither gcc -Wall nor the Microsoft compiler |
| 646 | emits a single warning any more when compiling Python. |
| 647 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 648 | - A number of new Makefile variables have been added for special |
| 649 | situations, e.g. LDLAST is appended to the link command. These are |
| 650 | used by editing the Makefile or passing them on the make command |
| 651 | line. |
| 652 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 653 | - A set of patches from Lee Busby has been integrated that make it |
| 654 | possible to catch floating point exceptions. Use the configure option |
| 655 | --with-fpectl to enable the patches; the extension modules fpectl and |
| 656 | fpetest provide control to enable/disable and test the feature, |
| 657 | respectively. |
| 658 | |
| 659 | - The support for shared libraries under AIX is now simpler and more |
| 660 | robust. Thanks to Vladimir Marangozov for revamping his own patches! |
| 661 | |
| 662 | - The Modules/makesetup script now reads a file Setup.local as well as |
| 663 | a file Setup. Most changes to the Setup script can be done by editing |
| 664 | Setup.local instead, which makes it easier to carry a particular setup |
| 665 | over from one release to the next. |
| 666 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 667 | - The Modules/makesetup script now copies any "include" lines it |
| 668 | encounters verbatim into the output Makefile. It also recognizes .cxx |
| 669 | and .cpp as C++ source files. |
| 670 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 671 | - The configure script is smarter about C compiler options; e.g. with |
| 672 | gcc it uses -O2 and -g when possible, and on some other platforms it |
| 673 | uses -Olimit 1500 to avoid a warning from the optimizer about the main |
| 674 | loop in ceval.c (which has more than 1000 basic blocks). |
| 675 | |
| 676 | - The configure script now detects whether malloc(0) returns a NULL |
| 677 | pointer or a valid block (of length zero). This avoids the nonsense |
| 678 | of always adding one byte to all malloc() arguments on most platforms. |
| 679 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 680 | - The configure script has a new option, --with-dec-threads, to enable |
| 681 | DEC threads on DEC Alpha platforms. Also, --with-threads is now an |
| 682 | alias for --with-thread (this was the Most Common Typo in configure |
| 683 | arguments). |
| 684 | |
| 685 | - Many changes in Doc/Makefile; amongst others, latex2html is now used |
| 686 | to generate HTML from all latex documents. |
| 687 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 688 | |
| 689 | Change to the Python/C API |
| 690 | -------------------------- |
| 691 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 692 | - Because some interfaces have changed, the PYTHON_API macro has been |
| 693 | bumped. Most extensions built for the old API version will still run, |
| 694 | but I can't guarantee this. Python prints a warning message on |
| 695 | version mismatches; it dumps core when the version mismatch causes a |
| 696 | serious problem :-) |
| 697 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 698 | - I've completed the Grand Renaming, with the help of Roger Masse and |
| 699 | Barry Warsaw. This makes reading or debugging the code much easier. |
| 700 | Many other unrelated code reorganizations have also been carried out. |
| 701 | The allobjects.h header file is gone; instead, you would have to |
| 702 | include Python.h followed by rename2.h. But you're better off running |
| 703 | Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit |
| 704 | the rename2.h; it will disappear in the next release. |
| 705 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 706 | - Various and sundry small bugs in the "abstract" interfaces have been |
| 707 | fixed. Thanks to all the (involuntary) testers of the Python 1.4 |
| 708 | version! Some new functions have been added, e.g. PySequence_List(o), |
| 709 | equivalent to list(o) in Python. |
| 710 | |
| 711 | - New API functions PyLong_FromUnsignedLong() and |
| 712 | PyLong_AsUnsignedLong(). |
| 713 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 714 | - The API functions in the file cgensupport.c are no longer |
| 715 | supported. This file has been moved to Modules and is only ever |
| 716 | compiled when the SGI specific 'gl' module is built. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 717 | |
| 718 | - PyObject_Compare() can now raise an exception. Check with |
| 719 | PyErr_Occurred(). The comparison function in an object type may also |
| 720 | raise an exception. |
| 721 | |
| 722 | - The slice interface uses an upper bound of INT_MAX when no explicit |
| 723 | upper bound is given (e.x. for a[1:]). It used to ask the object for |
| 724 | its length and do the calculations. |
| 725 | |
| 726 | - Support for multiple independent interpreters. See Doc/api.tex, |
| 727 | functions Py_NewInterpreter() and Py_EndInterpreter(). Since the |
| 728 | documentation is incomplete, also see the new Demo/pysvr example |
| 729 | (which shows how to use these in a threaded application) and the |
| 730 | source code. |
| 731 | |
| 732 | - There is now a Py_Finalize() function which "de-initializes" |
| 733 | Python. It is possible to completely restart the interpreter |
| 734 | repeatedly by calling Py_Finalize() followed by Py_Initialize(). A |
| 735 | change of functionality in Py_Initialize() means that it is now a |
| 736 | fatal error to call it while the interpreter is already initialized. |
| 737 | The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit() |
| 738 | is deprecated (it is nothing more than Py_Finalize() followed by |
| 739 | exit()). |
| 740 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 741 | - There are no known memory leaks left. While Py_Finalize() doesn't |
| 742 | free *all* allocated memory (some of it is hard to track down), |
| 743 | repeated calls to Py_Finalize() and Py_Initialize() do not create |
| 744 | unaccessible heap blocks. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 745 | |
| 746 | - There is now explicit per-thread state. (Inspired by, but not the |
| 747 | same as, Greg Stein's free threading patches.) |
| 748 | |
| 749 | - There is now better support for threading C applications. There are |
| 750 | now explicit APIs to manipulate the interpreter lock. Read the source |
| 751 | or the Demo/pysvr example; the new functions are |
| 752 | PyEval_{Acquire,Release}{Lock,Thread}(). |
| 753 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 754 | - The test macro DEBUG has changed to Py_DEBUG, to avoid interference |
| 755 | with other libraries' DEBUG macros. Likewise for any other test |
| 756 | macros that didn't yet start with Py_. |
| 757 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 758 | - New wrappers around malloc() and friends: Py_Malloc() etc. call |
| 759 | malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call |
| 760 | just malloc(). Use of these wrappers could be essential if multiple |
| 761 | memory allocators exist (e.g. when using certain DLL setups under |
| 762 | Windows). (Idea by Jim Fulton.) |
| 763 | |
| 764 | - New C API PyImport_Import() which uses whatever __import__() hook |
| 765 | that is installed for the current execution environment. By Jim |
| 766 | Fulton. |
| 767 | |
| 768 | - It is now possible for an extension module's init function to fail |
| 769 | non-fatally, by calling one of the PyErr_* functions and returning. |
| 770 | |
| 771 | - The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their |
| 772 | argument to the proper type, like the similar PyString macros already |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 773 | did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE |
| 774 | and PyList_GET_ITEM. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 775 | |
| 776 | - Some of the Py_Get* function, like Py_GetVersion() (but not yet |
| 777 | Py_GetPath()) are now declared as returning a const char *. (More |
| 778 | should follow.) |
| 779 | |
| 780 | - Changed the run-time library to check for exceptions after object |
| 781 | comparisons. PyObject_Compare() can now return an exception; use |
| 782 | PyErr_Occurred() to check (there is *no* special return value). |
| 783 | |
| 784 | - PyFile_WriteString() and Py_Flushline() now return error indicators |
| 785 | instead of clearing exceptions. This fixes an obscure bug where using |
| 786 | these would clear a pending exception, discovered by Just van Rossum. |
| 787 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 788 | - There's a new function, PyArg_ParseTupleAndKeywords(), which parses |
| 789 | an argument list including keyword arguments. Contributed by Geoff |
| 790 | Philbrick. |
| 791 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 792 | - PyArg_GetInt() is gone. |
| 793 | |
| 794 | - It's no longer necessary to include graminit.h when calling one of |
| 795 | the extended parser API functions. The three public grammar start |
| 796 | symbols are now in Python.h as Py_single_input, Py_file_input, and |
| 797 | Py_eval_input. |
| 798 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 799 | - The CObject interface has a new function, |
| 800 | PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr() |
| 801 | on the object referenced by "module.name". |
| 802 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 803 | |
| 804 | Tkinter |
| 805 | ------- |
| 806 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 807 | - On popular demand, _tkinter once again installs a hook for readline |
| 808 | that processes certain Tk events while waiting for the user to type |
| 809 | (using PyOS_InputHook). |
| 810 | |
| 811 | - A patch by Craig McPheeters plugs the most obnoxious memory leaks, |
| 812 | caused by command definitions referencing widget objects beyond their |
| 813 | lifetime. |
| 814 | |
| 815 | - New standard dialog modules: tkColorChooser.py, tkCommonDialog.py, |
| 816 | tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 817 | with the new Tk dialog scripts, and provide more "native platform" |
| 818 | style file selection dialog boxes on some platforms. Contributed by |
| 819 | Fredrik Lundh. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 820 | |
| 821 | - Tkinter.py: when the first Tk object is destroyed, it sets the |
| 822 | hiddel global _default_root to None, so that when another Tk object is |
| 823 | created it becomes the new default root. Other miscellaneous |
| 824 | changes and fixes. |
| 825 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 826 | - The Image class now has a configure method. |
| 827 | |
| 828 | - Added a bunch of new winfo options to Tkinter.py; we should now be |
| 829 | up to date with Tk 4.2. The new winfo options supported are: |
| 830 | mananger, pointerx, pointerxy, pointery, server, viewable, visualid, |
| 831 | visualsavailable. |
| 832 | |
| 833 | - The broken bind() method on Canvas objects defined in the Canvas.py |
| 834 | module has been fixed. The CanvasItem and Group classes now also have |
| 835 | an unbind() method. |
| 836 | |
| 837 | - The problem with Tkinter.py falling back to trying to import |
| 838 | "tkinter" when "_tkinter" is not found has been fixed -- it no longer |
| 839 | tries "tkinter", ever. This makes diagnosing the problem "_tkinter |
| 840 | not configured" much easier and will hopefully reduce the newsgroup |
| 841 | traffic on this topic. |
| 842 | |
| 843 | - The ScrolledText module once again supports the 'cnf' parameter, to |
| 844 | be compatible with the examples in Mark Lutz' book (I know, I know, |
| 845 | too late...) |
| 846 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 847 | - The _tkinter.c extension module has been revamped. It now support |
| 848 | Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It |
| 849 | works well under Windows and Mac (with the latest Tk ports to those |
| 850 | platforms). It also supports threading -- it is safe for one |
| 851 | (Python-created) thread to be blocked in _tkinter.mainloop() while |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 852 | other threads modify widgets. To make the changes visible, those |
| 853 | threads must use update_idletasks()method. (The patch for threading |
| 854 | in 1.5a3 was broken; in 1.5a4, it is back in a different version, |
| 855 | which requires access to the Tcl sources to get it to work -- hence it |
| 856 | is disabled by default.) |
| 857 | |
| 858 | - A bug in _tkinter.c has been fixed, where Split() with a string |
| 859 | containing an unmatched '"' could cause an exception or core dump. |
| 860 | |
| 861 | - Unfortunately, on Windows and Mac, Tk 8.0 no longer supports |
| 862 | CreateFileHandler, so _tkinter.createfilehandler is not available on |
| 863 | those platforms when using Tk 8.0 or later. I will have to rethink |
| 864 | how to interface with Tcl's lower-level event mechanism, or with its |
| 865 | channels (which are like Python's file-like objects). Jack Jansen has |
| 866 | provided a fix for the Mac, so createfilehandler *is* actually |
| 867 | supported there; maybe I can adapt his fix for Windows. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 868 | |
| 869 | |
| 870 | Tools and Demos |
| 871 | --------------- |
| 872 | |
| 873 | - A new regression test suite is provided, which tests most of the |
| 874 | standard and built-in modules. The regression test is run by invoking |
| 875 | the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass; |
| 876 | he and Roger Masse contributed most of the new tests. |
| 877 | |
| 878 | - New tool: faqwiz -- the CGI script that is used to maintain the |
| 879 | Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In |
| 880 | Tools/faqwiz. |
| 881 | |
| 882 | - New tool: webchecker -- a simple extensible web robot that, when |
| 883 | aimed at a web server, checks that server for dead links. Available |
| 884 | are a command line utility as well as a Tkinter based GUI version. In |
| 885 | Tools/webchecker. A simplified version of this program is dissected |
| 886 | in my article in O'Reilly's WWW Journal, the issue on Scripting |
| 887 | Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120). |
| 888 | Includes a parser for robots.txt files by Skip Montanaro. |
| 889 | |
| 890 | - 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] | 891 | n a particular directory tree), treesync.py (a rather Guido-specific |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 892 | script to synchronize two source trees, one on Windows NT, the other |
| 893 | one on Unix under CVS but accessible from the NT box), and logmerge.py |
| 894 | (sort a collection of RCS or CVS logs by date). In Tools/scripts. |
| 895 | |
| 896 | - The freeze script now also works under Windows (NT). Another |
| 897 | feature allows the -p option to be pointed at the Python source tree |
| 898 | instead of the installation prefix. This was loosely based on part of |
| 899 | xfreeze by Sam Rushing and Bill Tutt. |
| 900 | |
| 901 | - New examples (Demo/extend) that show how to use the generic |
| 902 | extension makefile (Misc/Makefile.pre.in). |
| 903 | |
| 904 | - Tools/scripts/h2py.py now supports C++ comments. |
| 905 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 906 | - Tools/scripts/pystone.py script is upgraded to version 1.1; there |
| 907 | was a bug in version 1.0 (distributed with Python 1.4) that leaked |
| 908 | memory. Also, in 1.1, the LOOPS variable is incremented to 10000. |
| 909 | |
| 910 | - Demo/classes/Rat.py completely rewritten by Sjoerd Mullender. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 911 | |
| 912 | |
| 913 | Windows (NT and 95) |
| 914 | ------------------- |
| 915 | |
| 916 | - New project files for Developer Studio (Visual C++) 5.0 for Windows |
| 917 | NT (the old VC++ 4.2 Makefile is also still supported, but will |
| 918 | eventually be withdrawn due to its bulkiness). |
| 919 | |
| 920 | - See the note on the new module search path in the "Miscellaneous" section |
| 921 | above. |
| 922 | |
| 923 | - Support for Win32s (the 32-bit Windows API under Windows 3.1) is |
| 924 | basically withdrawn. If it still works for you, you're lucky. |
| 925 | |
| 926 | - There's a new extension module, msvcrt.c, which provides various |
| 927 | low-level operations defined in the Microsoft Visual C++ Runtime Library. |
| 928 | These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and |
| 929 | console I/O functions like kbhit(), getch() and putch(). |
| 930 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 931 | - The -u option not only sets the standard I/O streams to unbuffered |
| 932 | status, but also sets them in binary mode. (This can also be done |
| 933 | using msvcrt.setmode(), by the way.) |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 934 | |
| 935 | - The, sys.prefix and sys.exec_prefix variables point to the directory |
| 936 | where Python is installed, or to the top of the source tree, if it was run |
| 937 | from there. |
| 938 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 939 | - The various os.path modules (posixpath, ntpath, macpath) now support |
| 940 | passing more than two arguments to the join() function, so |
| 941 | os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b, |
| 942 | c)). |
| 943 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 944 | - The ntpath module (normally used as os.path) supports ~ to $HOME |
| 945 | expansion in expanduser(). |
| 946 | |
| 947 | - The freeze tool now works on Windows. |
| 948 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 949 | - See also the Tkinter category for a sad note on |
| 950 | _tkinter.createfilehandler(). |
| 951 | |
| 952 | - The truncate() method for file objects now works on Windows. |
| 953 | |
| 954 | - 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] | 955 | must call it yourself. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 956 | |
Guido van Rossum | 1f83cce | 1997-10-06 21:04:35 +0000 | [diff] [blame] | 957 | - The time module's clock() function now has good precision through |
| 958 | the use of the Win32 API QueryPerformanceCounter(). |
| 959 | |
| 960 | - Mark Hammond will release Python 1.5 versions of PythonWin and his |
| 961 | other Windows specific code: the win32api extensions, COM/ActiveX |
| 962 | support, and the MFC interface. |
| 963 | |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 964 | |
| 965 | Mac |
| 966 | --- |
| 967 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 968 | - As always, the Macintosh port will be done by Jack Jansen. He will |
| 969 | make a separate announcement for the Mac specific source code and the |
| 970 | binary distribution(s) when these are ready. |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 971 | |
| 972 | |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 973 | ====================================================================== |
| 974 | |
| 975 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 976 | Fixed after 1.5a3 was released |
| 977 | ------------------------------ |
Guido van Rossum | 6100033 | 1997-08-15 04:39:58 +0000 | [diff] [blame] | 978 | |
Guido van Rossum | 2da391f | 1997-08-18 21:17:32 +0000 | [diff] [blame] | 979 | The following changes have been made to the source base after the |
Guido van Rossum | 92664b8 | 1997-10-07 00:12:43 +0000 | [diff] [blame] | 980 | release of 1.5a3. They still need to be sorted. They also need to be |
| 981 | merged into their respective categories for the final release, but |
| 982 | it's useful to have them separately during the alpha test cycle. |
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 |
| 1271 | numbers to errno names (e.g. EINTR), and errorcode maps them to |
| 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. |