Guido van Rossum | f0b69f0 | 1997-08-15 02:50:47 +0000 | [diff] [blame] | 1 | |
| 2 | |
| 3 | |
| 4 | New since 1.5a2 |
| 5 | --------------- |
| 6 | |
| 7 | The following items are only relevant if you previously used Python |
| 8 | 1.5a2: |
| 9 | |
| 10 | - The strftime test should now succeed on Windows and Mac platforms, |
| 11 | too. It still fails on some Linux platforms; I believe that this is a |
| 12 | problem in the C library on those platforms. |
| 13 | |
| 14 | |
| 15 | |
| 16 | What's new in this release? |
| 17 | --------------------------- |
| 18 | |
| 19 | I haven't kept track closely, so here are just a few highlights. For |
| 20 | the final release, I will go through all my RCS logs and distill a |
| 21 | complete list. Note that the biggest unfinished project is |
| 22 | documentation. |
| 23 | |
| 24 | XXX To be expanded: |
| 25 | |
| 26 | - Tools/webchecker |
| 27 | |
| 28 | - Lee Busby's SIGFPE mods and modules fpectl, fpetest |
| 29 | |
| 30 | - formatter.*Writer.flush |
| 31 | |
| 32 | - dis.{cmp_op, hascompare} |
| 33 | |
| 34 | - ftplib: FTP.ntransfercmd, Netrc, parse150 |
| 35 | |
| 36 | - httplib.HTTP_VERSIONS_ACCEPTED |
| 37 | |
| 38 | - new module keyword |
| 39 | |
| 40 | - imghdr recognizes bmp, png |
| 41 | |
| 42 | - mhlib, parsesequence improved |
| 43 | |
| 44 | - mimify base64 support |
| 45 | |
| 46 | - new.function revived |
| 47 | |
| 48 | - popen2.popen3 added |
| 49 | |
| 50 | - new module pprint |
| 51 | |
| 52 | - cgi.FieldStorage: __len__ added |
| 53 | |
| 54 | New exceptions: |
| 55 | FloatingPointError |
| 56 | Deleted exception: |
| 57 | ConflictError |
| 58 | |
| 59 | > audioop.ratecv |
| 60 | |
| 61 | > posix.O_APPEND |
| 62 | > posix.O_CREAT |
| 63 | > posix.O_DSYNC |
| 64 | > posix.O_EXCL |
| 65 | > posix.O_NDELAY |
| 66 | > posix.O_NOCTTY |
| 67 | > posix.O_NONBLOCK |
| 68 | > posix.O_RDONLY |
| 69 | > posix.O_RDWR |
| 70 | > posix.O_RSYNC |
| 71 | > posix.O_SYNC |
| 72 | > posix.O_TRUNC |
| 73 | > posix.O_WRONLY |
| 74 | posix.O_TEXT |
| 75 | posix.O_BINARY |
| 76 | (also in os, of course) |
| 77 | |
| 78 | > regex.get_syntax |
| 79 | |
| 80 | > socket.getprotobyname |
| 81 | |
| 82 | > strop.replace |
| 83 | Also string.replace |
| 84 | |
| 85 | - Jack's buffer interface! |
| 86 | - supported by regex module! |
| 87 | |
| 88 | - improved dir() semantics |
| 89 | |
| 90 | - posix.error, nt.error renamed to os.error |
| 91 | |
| 92 | - rfc822 getdate_tz and parsedate_tz |
| 93 | |
| 94 | - shelve.*.sync |
| 95 | |
| 96 | - shutil improved interface |
| 97 | |
| 98 | - socket.getprotobynameo |
| 99 | |
| 100 | - _xdrmodule is gone (in favor of structmodule) |
| 101 | |
| 102 | - xdrlib.Unpacker.get_buffer |
| 103 | |
| 104 | - much improved structmodule |
| 105 | |
| 106 | - Tkinter upgraded (as always) |
| 107 | |
| 108 | - new al module for SGI |
| 109 | |
| 110 | - file object readinto methods |
| 111 | |
| 112 | - tktrace??? |
| 113 | |
| 114 | Obsolete: cgensupport.[ch] are now in Modules and only linked with glmodule.c. |
| 115 | |
| 116 | - much faster file.read() and readlines() on windows |
| 117 | |
| 118 | ====================================================================== |
| 119 | |
| 120 | - PyObject_Compare() can now raise an exception. Check with |
| 121 | PyErr_Occurred(). The comparison function in an object type may also |
| 122 | raise an exception. |
| 123 | |
| 124 | - The slice interface uses an upper bound of INT_MAX when no explicit |
| 125 | upper bound is given (e.x. for a[1:]). It used to ask the object for |
| 126 | its length and do the calculations. |
| 127 | |
| 128 | - I've completed the Grand Renaming, with the help of Roger Masse and |
| 129 | Barry Warsaw. Many other unrelated code reorganizations have also |
| 130 | been carried out. |
| 131 | |
| 132 | - As far as I can tell, neither gcc -Wall nor the Microsoft compiler |
| 133 | emits a single warning any more when compiling Python. |
| 134 | |
| 135 | - It's much faster (almost twice for pystone.py -- see Tools/scripts.) |
| 136 | |
| 137 | - Unless I hear a lot of protest, private variables with leading |
| 138 | double underscore are now a permanent feature of the language. I |
| 139 | can't label them "experimental" forever. |
| 140 | |
| 141 | - New extension modules cStringIO.c and cPickle.c, written by Jim |
| 142 | Fulton and other folks at Digital Creations. These are much more |
| 143 | efficient than their Python counterparts StringIO.py and pickle.py, |
| 144 | but don't support subclassing. cPickle.c clocks up to 1000 times |
| 145 | faster than pickle.py. The pickle.py module has been updated to make |
| 146 | it compatible with the new binary format that cPickle.c produces (by |
| 147 | default it produces the old all-ASCII format compatible with the old |
| 148 | pickle.py, still much faster than pickle.py; it can read both |
| 149 | formats). A new helper module, copy_reg.py, is provided to register |
| 150 | extensions to the pickling code. (These are now identical to the |
| 151 | release 0.3 from Digital Creations.) |
| 152 | |
| 153 | - New (still experimental) Perl-style regular expression module, |
| 154 | re.py, which uses a new interface for matching as well as a new |
| 155 | syntax; the new interface avoids the thread-unsafety of the regex |
| 156 | interface. This comes with a helper extension reopmodule.c and vastly |
| 157 | rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim |
| 158 | Peters, and Andrew Kuchling. See the documentation libre.tex. In |
| 159 | 1.5, the old regex module is still fully supported; in the future, it |
| 160 | will become obsolete. |
| 161 | |
| 162 | - 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 |
| 166 | string quotes. An embedded quote prefixed with a backslash does not |
| 167 | terminate the string, but the backslash is still included in the |
| 168 | string; for example, r'\'' is a two-character string consisting of a |
| 169 | backslash and a quote. Raw strings are also affectionately known as |
| 170 | Robin strings, after their inventor, Robin Friedrich. |
| 171 | |
| 172 | - New project files for Developer Studio (Visual C++) 5.0 for Windows |
| 173 | NT (the old VC++ 4.2 Makefile is also still supported, but will |
| 174 | eventually be withdrawn due to its bulkiness). |
| 175 | |
| 176 | - New extension module zlibmodule.c, interfacing to the free zlib |
| 177 | library (gzip compatible compression). There's also a module gzip.py |
| 178 | which provides a higher level interface. Written by Andrew Kuchling |
| 179 | and Jeremy Hylton. |
| 180 | |
| 181 | - New tool: faqwiz -- the CGI script that is used to maintain the |
| 182 | Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In |
| 183 | Tools/faqwiz. |
| 184 | |
| 185 | - New tool: webchecker -- a simple extensible web robot that, when |
| 186 | aimed at a web server, checks that server for dead links. Available |
| 187 | are a command line utility as well as a Tkinter based GUI version. In |
| 188 | Tools/webchecker. A simplified version of this program is dissected |
| 189 | in my article in O'Reilly's WWW Journal, the issue on Scripting |
| 190 | Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120). |
| 191 | Includes a parser for robots.txt files by Skip Montanaro. |
| 192 | |
| 193 | - New small tools: cvsfiles.py (prints a list of all files under CVS |
| 194 | in a particular directory tree), treesync.py (a rather Guido-specific |
| 195 | script to synchronize two source trees, one on Windows NT, the other |
| 196 | one on Unix under CVS but accessible from the NT box), and logmerge.py |
| 197 | (sort a collection of RCS or CVS logs by date). In Tools/scripts. |
| 198 | |
| 199 | - The freeze script now also works under Windows (NT). Another |
| 200 | feature allows the -p option to be pointed at the Python source tree |
| 201 | instead of the installation prefix. This was loosely based on part of |
| 202 | xfreeze by Sam Rushing and Bill Tutt. |
| 203 | |
| 204 | - A new regression test suite is provided, which tests most of the |
| 205 | standard and built-in modules. The regression test is run by invoking |
| 206 | the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass; |
| 207 | he and Roger Masse contributed most of the new tests. |
| 208 | |
| 209 | - New standard dialog modules for Tkinter: tkColorChooser.py, |
| 210 | tkCommonDialog.py, tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py |
| 211 | These interface with the new Tk dialog scripts. Contributed by |
| 212 | Fredrik Lundh. |
| 213 | |
| 214 | - Tkinter.py: when the first Tk object is destroyed, it sets the |
| 215 | hiddel global _default_root to None, so that when another Tk object is |
| 216 | created it becomes the new default root. Other miscellaneous |
| 217 | changes and fixes. |
| 218 | |
| 219 | - Many new pieces of library documentation were contributed, mostly by |
| 220 | Andrew Kuchling. Even cmath is now documented! There's also a |
| 221 | chapter of the library manual, "libundoc.tex", which provides a |
| 222 | listing of all undocumented modules, plus their status (e.g. internal, |
| 223 | obsolete, or in need of documentation). Also contributions by Sue |
| 224 | Williams, Skip Montanaro, and some module authors who succumbed to |
| 225 | pressure to document their own contributed modules :-). Note that |
| 226 | printing the documentation now kills fewer trees -- the margins have |
| 227 | been reduced. |
| 228 | |
| 229 | - I have started documenting the Python/C API. Unfortunately this |
| 230 | project hasn't been completed yet. It will be complete before the |
| 231 | final release of Python 1.5, though. |
| 232 | |
| 233 | - The mimify.py module now has documentation, and includes functions |
| 234 | to handle the funny encoding you sometimes see in mail headers. |
| 235 | |
| 236 | - The default module search path is now much saner. Both on Unix and |
| 237 | Windows, it is essentially derived from the path to the executable |
| 238 | ($PYTHONHOME can be used to override). The value of $PYTHONPATH on |
| 239 | Windows is now inserted in front of the default path, like in Unix |
| 240 | (instead of overriding the default path). |
| 241 | |
| 242 | - Support for Win32S (the 32-bit Windows API under Windows 3.1) is |
| 243 | basically withdrawn. If it works for you, you're lucky. |
| 244 | |
| 245 | - On Win32 platforms (Windows NT and 95), there's a new extension |
| 246 | module, msvcrt.c, which provides various low-level operations defined |
| 247 | in the Microsoft Visual C++ Runtime Library. These include locking(), |
| 248 | setmode(), get_osfhandle(), set_osfhandle(), and console I/O functions |
| 249 | like kbhit(), getch() and putch(). |
| 250 | |
| 251 | - The way GNU readline is configured is totally different. The |
| 252 | --with-readline configure option is gone. It is now an extension |
| 253 | module, which may be loaded dynamically. You must enable it (and |
| 254 | specify the correct linraries to link with) in the Modules/Setup file. |
| 255 | Importing the module installs some hooks which enable command line |
| 256 | editing. When the interpreter shell is invoked interactively, it |
| 257 | attempts to import the readline module; when this fails, the default |
| 258 | input mechanism is used. The hook variables are PyOS_InputHook and |
| 259 | PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with |
| 260 | ideas from William Magro.) |
| 261 | |
| 262 | - New Unix extension module resource.c, by Jeremy Hylton, provides |
| 263 | access to getrlimit(), getrusage(), setrusage(), getpagesize(), and |
| 264 | related symbolic constants. |
| 265 | |
| 266 | - Support for multiple independent interpreters. See Doc/api.tex, |
| 267 | functions Py_NewInterpreter() and Py_EndInterpreter(). Since the |
| 268 | documentation is incomplete, also see the new Demo/pysvr example |
| 269 | (which shows how to use these in a threaded application) and the |
| 270 | source code. |
| 271 | |
| 272 | - There is now a Py_Finalize() function which "de-initializes" |
| 273 | Python. It is possible to completely restart the interpreter |
| 274 | repeatedly by calling Py_Finalize() followed by Py_Initialize(). A |
| 275 | change of functionality in Py_Initialize() means that it is now a |
| 276 | fatal error to call it while the interpreter is already initialized. |
| 277 | The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit() |
| 278 | is deprecated (it is nothing more than Py_Finalize() followed by |
| 279 | exit()). |
| 280 | |
| 281 | - There are no known memory leaks. While Py_Finalize() doesn't free |
| 282 | *all* allocated memory (some of it is hard to track down), repeated |
| 283 | calls to Py_Finalize() and Py_Initialize() do not create unaccessible |
| 284 | heap blocks. |
| 285 | |
| 286 | - New function sys.exc_info() returns the tuple (sys.exc_type, |
| 287 | sys.exc_value, sys.exc_traceback) in a thread-safe way. |
| 288 | |
| 289 | - The semantics of try-except have changed subtly so that calling a |
| 290 | function in an exception handler that itself raises and catches an |
| 291 | exception no longer overwrites the sys.exc_* variables. This also |
| 292 | alleviates the problem that objects referenced in a stack frame that |
| 293 | caught an exception are kept alive until another exception is caught |
| 294 | -- the sys.exc_* variables are restored to their previous value when |
| 295 | returning from a function that caught an exception. |
| 296 | |
| 297 | - There is now explicit per-thread state. (Inspired by, but not the |
| 298 | same as, Greg Stein's free threading patches.) |
| 299 | |
| 300 | - There is now better support for threading C applications. There are |
| 301 | now explicit APIs to manipulate the interpreter lock. Read the source |
| 302 | or the Demo/pysvr example; the new functions are |
| 303 | PyEval_{Acquire,Release}{Lock,Thread}(). |
| 304 | |
| 305 | - New wrappers around malloc() and friends: Py_Malloc() etc. call |
| 306 | malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call |
| 307 | just malloc(). Use of these wrappers could be essential if multiple |
| 308 | memory allocators exist (e.g. when using certain DLL setups under |
| 309 | Windows). (Idea by Jim Fulton.) |
| 310 | |
| 311 | - Numerous source cleanups. |
| 312 | |
| 313 | - There's a simple assert statement, and a new exception |
| 314 | AssertionError, and a built-in variable __debug__. For example, |
| 315 | ``assert foo > 0'' is equivalent to ``if __debug__ and not foo > 0: |
| 316 | raise AssertionError''. Sorry, the text of the asserted condition is |
| 317 | not available; it would be too generate code for this. However, the |
| 318 | text is displayed as part of the traceback! There's also a -O option |
| 319 | to the interpreter that squeezes SET_LINENO instructions, assert |
| 320 | statements and ``if __debug__'' code; it uses and produces .pyo files |
| 321 | instead of .pyc files. In the future it should be possible to write |
| 322 | external bytecode optimizers that create better optimized .pyo files. |
| 323 | |
| 324 | - New build procedure: a single library, libpython1.5.a, is now built, |
| 325 | which contains absolutely everything except for a one-line main() |
| 326 | program (which calls Py_Main(argc, argv) to start the interpreter |
| 327 | shell). This makes life much simpler for applications that need to |
| 328 | embed Python. The serial number of the build is now included in the |
| 329 | version string (sys.version). |
| 330 | |
| 331 | - New module keyword.py exports knowledge about Python's built-in |
| 332 | keywords. (New version by Ka-Ping Yee.) |
| 333 | |
| 334 | - New examples (Demo/extend) that show how to use the generic |
| 335 | extension makefile (Misc/Makefile.pre.in). |
| 336 | |
| 337 | - New module pprint.py (with documentation) which supports |
| 338 | pretty-printing of lists, tuples, & dictionaries recursively. By Fred |
| 339 | Drake. |
| 340 | |
| 341 | - New module code.py. The function code.compile_command() can |
| 342 | determine whether an interactively entered command is complete or not, |
| 343 | distinguishing incomplete from invalid input. |
| 344 | |
| 345 | - Module codehack.py is now completely obsolete. |
| 346 | |
| 347 | - Revamped module tokenize.py is much more accurate and has an |
| 348 | interface that makes it a breeze to write code to colorize Python |
| 349 | source code. Contributed by Ka-Ping Yee. |
| 350 | |
| 351 | - As always, the Macintosh port was done by Jack Jansen. See his |
| 352 | separate announcement for the Mac specific source code and the binary |
| 353 | distribution(s). |
| 354 | |
| 355 | - A set of patches from Lee Busby has been integrated that make it |
| 356 | possible to catch floating point exceptions. Use the configure option |
| 357 | --with-fpectl to enable the patches; the extension modules fpectl and |
| 358 | fpetest provide control to enable/disable and test the feature, |
| 359 | respectively. |
| 360 | |
| 361 | - New extension puremodule.c, by Barry Warsaw, which interfaces to the |
| 362 | Purify(TM) C API. See also the file Misc/PURIFY.README. It is also |
| 363 | possible to enable Purify by simply setting the PURIFY Makefile |
| 364 | variable in the Modules/Setup file. |
| 365 | |
| 366 | - The struct extension module has several new features to control byte |
| 367 | order and word size. It supports reading and writing IEEE floats even |
| 368 | on platforms where this is not the native format. |
| 369 | |
| 370 | - There is now a library module xdr.py which can read and write the |
| 371 | XDR data format as used by Sun RPC, for example. It uses the struct |
| 372 | module. |
| 373 | |
| 374 | - Tools/scripts/h2py.py now supports C++ comments. |
| 375 | |
| 376 | - The pystone.py script is upgraded to version 1.1; there was a bug in |
| 377 | version 1.0 (distributed with Python 1.4) that leaked memory. Also, |
| 378 | in 1.1, the LOOPS variable is incremented to 10000. |
| 379 | |
| 380 | - New C API PyImport_Import() which uses whatever __import__() hook |
| 381 | that is installed for the current execution environment. By Jim |
| 382 | Fulton. |
| 383 | |
| 384 | - The _tkinter.c extension module has been revamped. It now support |
| 385 | Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It |
| 386 | works well under Windows and Mac (with the latest Tk ports to those |
| 387 | platforms). It also supports threading -- it is safe for one |
| 388 | (Python-created) thread to be blocked in _tkinter.mainloop() while |
| 389 | other threads modify widgets. (To make the changes visible, those |
| 390 | threads must use update_idletasks()method.) Unfortunately, on Windows |
| 391 | and Mac, Tk 8.0 no longer supports CreateFileHandler, so |
| 392 | _tkinter.createfilehandler is not available on those platforms. I |
| 393 | will have to rethink how to interface with Tcl's lower-level event |
| 394 | mechanism, or with its channels (which are like Python's file-like |
| 395 | objects). |
| 396 | |
| 397 | - New "buffer" interface. Certain objects (e.g. strings, arrays) now |
| 398 | support the "buffer" protocol. Buffer objects are acceptable whenever |
| 399 | formerly a string was required for a write operation; mutable buffer |
| 400 | objects can be the target of a read operation using the |
| 401 | f.readinto(buffer). Contribution bty Jack Jansen. (Needs |
| 402 | documentation.) |
| 403 | |
| 404 | - In ihooks.py, ModuleLoader.load_module() now closes the file under |
| 405 | all circumstances. |
| 406 | |
| 407 | - The tempfile.py module has a new class, TemporaryFile, which creates |
| 408 | an open temporary file that will be deleted automatically when |
| 409 | closed. This works on Windows and MacOS as well as on Unix. (Jim |
| 410 | Fulton.) |
| 411 | |
| 412 | - Changes to the cgi.py module: Most imports are now done at the |
| 413 | top of the module, which provides a speedup when using ni (Jim |
| 414 | Fulton). The problem with file upload to a Windows platform is solved |
| 415 | by using the new tempfile.TemporaryFile class; temporary files are now |
| 416 | always opened in binary mode (Jim Fulton). The cgi.escape() function |
| 417 | now takes an optional flag argument that quotes '"' to '"'. It |
| 418 | is now possible to invoke cgi.py from a command line script, to test |
| 419 | cgi scripts more easily outside an http server. There's an optional |
| 420 | limit to the size of uploads to POST (Skip Montanaro). Added a |
| 421 | 'strict_parsing' option to all parsing functions (Jim Fulton). The |
| 422 | function parse_qs() now uses urllib.unquote() on the name as well as |
| 423 | the value of fields (Clarence Gardner). |
| 424 | |
| 425 | - String interning: dictionary lookups are faster when the lookup |
| 426 | string object is the same object as the key in the dictionary, not |
| 427 | just a string with the same value. This is done by having a pool of |
| 428 | "interned" strings. Most names generated by the interpreter are now |
| 429 | automatically interned, and there's a new built-in function intern(s) |
| 430 | that returns the interned version of a string. Interned strings are |
| 431 | not a different object type, and interning is totally optional, but by |
| 432 | interning most keys a speedup of about 15% was obtained for the |
| 433 | pystone benchmark. |
| 434 | |
| 435 | - httplib.py: the socket object is no longer closed; all HTTP/1.* |
| 436 | versions are now treated the same; and it is now thread-safe (by not |
| 437 | using the regex module). |
| 438 | |
| 439 | - BaseHTTPModule.py: treat all HTTP/1.* versions the same. |
| 440 | |
| 441 | - The popen2.py module is now rewritten using a class, which makes |
| 442 | access to the standard error stream and the process id of the |
| 443 | subprocess possible. |
| 444 | |
| 445 | - The support for shared libraries under AIX is now simpler and more |
| 446 | robust. Thanks to Vladimir Marangozov for revamping his own patches! |
| 447 | |
| 448 | - When a module is deleted, its globals are now deleted in two phases. |
| 449 | In the first phase, all variables whose name begins with exactly one |
| 450 | underscore are replaced by None; in the second phase, all variables |
| 451 | are deleted. This makes it possible to have global objects whose |
| 452 | destructors depend on other globals. The deletion order within each |
| 453 | phase is still random. |
| 454 | |
| 455 | - The Modules/makesetup script now reads a file Setup.local as well as |
| 456 | a file Setup. Most changes to the Setup script can be done by editing |
| 457 | Setup.local instead, which makes it easier to carry a particular setup |
| 458 | over from one release to the next. |
| 459 | |
| 460 | - It is no longer an error for a function to be called without a |
| 461 | global variable __builtins__ -- an empty directory will be provided |
| 462 | by default. |
| 463 | |
| 464 | - Some speedup by using separate free lists for method objects (both |
| 465 | the C and the Python variety) and for floating point numbers. |
| 466 | |
| 467 | - Big speedup by allocating frame objects with a single malloc() call. |
| 468 | The Python/C API for frames is changed (you shouldn't be using this |
| 469 | anyway). |
| 470 | |
| 471 | - It is now possible for an extension module's init function to fail |
| 472 | non-fatally, by calling one of the PyErr_* functions and returning. |
| 473 | |
| 474 | - The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their |
| 475 | argument to the proper type, like the similar PyString macros already |
| 476 | did. (Suggestion by Marc-Andre Lemburg.) |
| 477 | |
| 478 | - The fcntl extension module now exports the needed symbolic |
| 479 | constants. (Formerly these were in FCNTL.py which was not available |
| 480 | or correct for all platforms.) |
| 481 | |
| 482 | - Guido's corollary of the Don Beaudry hack: it is now possible to do |
| 483 | metaprogramming by using an instance as a base class. Not for the |
| 484 | faint of heart; and undocumented as yet, but basically if a base class |
| 485 | is an instance, its class will be instantiated to create the new |
| 486 | class. Jim Fulton will love it -- it also works with instances of his |
| 487 | "extension classes", since it is triggered by the presence of a |
| 488 | __class__ attribute on the purported base class. |
| 489 | |
| 490 | - Plugged the two-byte memory leak in the tokenizer when reading an |
| 491 | interactive EOF. |
| 492 | |
| 493 | - Added timezone support to the rfc822.py module; also added |
| 494 | recognition of some non-standard date formats, by Lars Wirzenius. |
| 495 | |
| 496 | - mhlib.py: various enhancements, including almost compatible parsing |
| 497 | of message sequence specifiers without invoking a subprocess. Also |
| 498 | added a createmessage() method by Lars Wirzenius. |
| 499 | |
| 500 | - The StringIO.StringIO class now supports readline(nbytes). (Lars |
| 501 | Wirzenius.) |
| 502 | |
| 503 | - Dictionary objects have several new methods; clear() and copy() have |
| 504 | the obvious semantics, while update(d) merges the contents of another |
| 505 | dictionary d into this one, overriding existing keys. BTW, the |
| 506 | dictionary implementation file is now called dictobject.c rather than |
| 507 | the confusing mappingobject.c. |
| 508 | |
| 509 | - UserDict.py supports the new dictionary methods as well. |
| 510 | |
| 511 | - The intrinsic function dir() is much smarter; it looks in __dict__, |
| 512 | __members__ and __methods__. |
| 513 | |
| 514 | - The silly -s command line option and the corresponding |
| 515 | PYTHONSUPPRESS environment variable and the Py_SuppressPrint global |
| 516 | flag are gone. |
| 517 | |
| 518 | - On Windows, -u not only sets the standard I/O streams to unbuffered |
| 519 | status, but also sets them in binary mode. |
| 520 | |
| 521 | - Some of the Py_Get* function, like Py_GetVersion() (but not yet |
| 522 | Py_GetPath()) are now declared as returning a const char *. (More |
| 523 | should follow.) |
| 524 | |
| 525 | - Speedup by inlining some common opcodes for common operand types |
| 526 | (e.g. i+i, i-i, and list[i]). Fredrik Lundh. |
| 527 | |
| 528 | - The extension modules dbm, gdbm and bsddb now check that the |
| 529 | database is still open before making any new calls. |
| 530 | |
| 531 | - Various small fixes to the nntplib.py module that I can't bother to |
| 532 | document in detail. |
| 533 | |
| 534 | - There is a cache for results in urlparse.urlparse(); its size limit |
| 535 | is set to 20 (not 2000 as it was in earlier alphas). |
| 536 | |
| 537 | - Small speedup by reordering the method tables of some common |
| 538 | objects (e.g. list.append is now first). |
| 539 | |
| 540 | - The modules base64.py, uu.py and quopri.py can now be used as simple |
| 541 | command line utilities. |
| 542 | |
| 543 | - The binascii extension module is now hopefully fully debugged. (XXX |
| 544 | Oops -- Fredril Lundh promised me a fix that I never received.) |
| 545 | |
| 546 | - The mimetools.py module now uses the available Python modules for |
| 547 | decoding quoted-printable, uuencode and base64 formats, rather than |
| 548 | creating a subprocess. |
| 549 | |
| 550 | - The python debugger (pdb.py, and its base class bdb.py) now support |
| 551 | conditional breakpoints. See the docs. |
| 552 | |
| 553 | - The configure script now detects whether malloc(0) returns a NULL |
| 554 | pointer or a valid block (of length zero). This avoids the nonsense |
| 555 | of always adding one byte to all malloc() arguments on most platforms. |
| 556 | |
| 557 | - Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to |
| 558 | speed it up, and replace 0 seed values by 1 to avoid degeneration. |
| 559 | |
| 560 | - Fix a bug where multiple anonymous tuple arguments would be mixed up |
| 561 | when using the debugger or profiler (reported by Just van Rossum). |
| 562 | The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this |
| 563 | would print the wrong value when run under the debugger or profiler. |
| 564 | |
| 565 | - Module ftplib.py: added support for parsing a .netrc file. Fred |
| 566 | Drake. |
| 567 | |
| 568 | - urllib.py: the ftp cache is now limited to 10 entries. Added |
| 569 | quote_plus() method which is like qupte() but also replaces spaces |
| 570 | with '+', for encoding CGI form arguments. Catch all errors from the |
| 571 | ftp module. HTTP requests now add the Host: header line. The proxy |
| 572 | variable names are now mapped to lower case, for Windows. |
| 573 | |
| 574 | - The posix module (and hence os.py!) now has doc strings! Thanks to |
| 575 | Neil Schemenauer. |
| 576 | |
| 577 | - shelve.py: use cPickle and cStringIO when available. |
| 578 | |
| 579 | - Various modules now export their type object: socket.SocketType, |
| 580 | array.ArrayType. |
| 581 | |
| 582 | - ntpath.py supports ~ to $HOME expansion in expanduser(). |
| 583 | |
| 584 | - The pthread support now works on most platforms. |
| 585 | |
| 586 | - New variable sys.executable points to the executable file for the |
| 587 | Python interpreter, if known. |
| 588 | |
| 589 | - On Windows, sys.prefix and sys.exec_prefix point to the directory |
| 590 | where Python is installed, or to the top of the source tree, if it was |
| 591 | run from there. |
| 592 | |
| 593 | - The sort() methods for lists no longer uses the C library qsort(); I |
| 594 | wrote my own quicksort implementation, with help from Tim Peters. |
| 595 | This solves a bug in dictionary comparisons on some Solaris versions |
| 596 | when Python is built with threads, and makes sorting lists even |
| 597 | faster. |
| 598 | |
| 599 | - STDWIN is now officially obsolete. Support for it will eventually |
| 600 | be removed from the distribution. |
| 601 | |
| 602 | - The configure script is smarter about C compiler options; e.g. with |
| 603 | gcc it uses -O2 and -g when possible, and on some other platforms it |
| 604 | uses -Olimit 1500 to avoid a warning from the optimizer about the main |
| 605 | loop in ceval.c (which has more than 1000 basic blocks). |
| 606 | |
| 607 | - Changed the run-time library to check for exceptions after object |
| 608 | comparisons. PyObject_Compare() can now return an exception; use |
| 609 | PyErr_Occurred() to check (there is *no* special return value). |
| 610 | |
| 611 | - PyFile_WriteString() and Py_Flushline() now return error indicators |
| 612 | instead of clearing exceptions. This fixes an obscure bug where using |
| 613 | these would clear a pending exception, discovered by Just van Rossum. |
| 614 | |
| 615 | - Most problems on 64-bit platforms should now be fixed. Andrew |
| 616 | Kuchling helped. Some uncommon extension modules are still not |
| 617 | clean (image and audio ops?). |
| 618 | |