Guido van Rossum | 061f182 | 1994-10-06 16:03:45 +0000 | [diff] [blame^] | 1 | ================================ |
| 2 | ==> Release 1.1 (6 Oct 1994) <== |
| 3 | ================================ |
| 4 | |
| 5 | This release adds several new features, improved configuration and |
| 6 | portability, and more fixed bugs than I can list here (including some |
| 7 | memory leaks). |
| 8 | |
| 9 | The source compiles and runs out of the box on more platforms than |
| 10 | ever -- including Windows NT. Makefiles or projects for a variety of |
| 11 | non-UNIX platforms are provided. |
| 12 | |
| 13 | Apology: many new features are badly documented or not at all. I had |
| 14 | the choice -- postpone the new release indefinitely, or release it |
| 15 | now, with working code but some undocumented areas... |
| 16 | |
| 17 | |
| 18 | New language features: |
| 19 | |
| 20 | - More flexible operator overloading for user-defined classes |
| 21 | (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial. |
| 22 | |
| 23 | - Classes can define methods named __getattr__, __setattr__ and |
| 24 | __delattr__ to trap attribute accesses. See end of tutorial. |
| 25 | |
| 26 | - Classes can define method __call__ so instances can be called |
| 27 | directly. See end of tutorial. |
| 28 | |
| 29 | |
| 30 | New support facilities: |
| 31 | |
| 32 | - The Makefiles (for the base interpreter as well as for extensions) |
| 33 | now support creating dynamically loadable modules if the platform |
| 34 | supports shared libraries. |
| 35 | |
| 36 | - Passing the interpreter a .pyc file as script argument will execute |
| 37 | the code in that file. (On the Mac such files can be double-clicked!) |
| 38 | |
| 39 | - New Freeze script, to create independently distributable "binaries" |
| 40 | of Python programs -- look in Demo/freeze |
| 41 | |
| 42 | - Improved h2py script (in Demo/scripts) follows #includes and |
| 43 | supports macros with one argument |
| 44 | |
| 45 | - New module compileall generates .pyc files for all modules in a |
| 46 | directory (tree) without also executing them |
| 47 | |
| 48 | - Threads should work on more platforms |
| 49 | |
| 50 | |
| 51 | New built-in modules: |
| 52 | |
| 53 | - tkinter (support for Tcl's Tk widget set) is now part of the base |
| 54 | distribution |
| 55 | |
| 56 | - signal allows catching or ignoring UNIX signals (unfortunately still |
| 57 | undocumented -- any taker?) |
| 58 | |
| 59 | - termios provides portable access to POSIX tty settings |
| 60 | |
| 61 | - curses provides an interface to the System V curses library |
| 62 | |
| 63 | - syslog provides an interface to the (BSD?) syslog daemon |
| 64 | |
| 65 | - 'new' provides interfaces to create new built-in object types |
| 66 | (e.g. modules and functions) |
| 67 | |
| 68 | - sybase provides an interface to SYBASE database |
| 69 | |
| 70 | |
| 71 | New/obsolete built-in methods: |
| 72 | |
| 73 | - callable(x) tests whether x can be called |
| 74 | |
| 75 | - sockets now have a setblocking() method |
| 76 | |
| 77 | - sockets no longer have an allowbroadcast() method |
| 78 | |
| 79 | - socket methods send() and sendto() return byte count |
| 80 | |
| 81 | |
| 82 | New standard library modules: |
| 83 | |
| 84 | - types.py defines standard names for built-in types, e.g. StringType |
| 85 | |
| 86 | - urlparse.py parses URLs according to the latest Internet draft |
| 87 | |
| 88 | - uu.py does uuencode/uudecode (not the fastest in the world, but |
| 89 | quicker than installing uuencode on a non-UNIX machine :-) |
| 90 | |
| 91 | - New, faster and more powerful profile module.py |
| 92 | |
| 93 | - mhlib.py provides interface to MH folders and messages |
| 94 | |
| 95 | |
| 96 | New facilities for extension writers (unfortunately still |
| 97 | undocumented): |
| 98 | |
| 99 | - newgetargs() supports optional arguments and improved error messages |
| 100 | |
| 101 | - O!, O& O? formats for getargs allow more versatile type checking of |
| 102 | non-standard types |
| 103 | |
| 104 | - can register pending asynchronous callback, to be called the next |
| 105 | time the Python VM begins a new instruction (Py_AddPendingCall) |
| 106 | |
| 107 | - can register cleanup routines to be called when Python exits |
| 108 | (Py_AtExit) |
| 109 | |
| 110 | - makesetup script understands C++ files in Setup file (use file.C |
| 111 | or file.cc) |
| 112 | |
| 113 | - Make variable OPT is passed on to sub-Makefiles |
| 114 | |
| 115 | - An init<module>() routine may signal an error by not entering |
| 116 | the module in the module table and raising an exception instead |
| 117 | |
| 118 | - For long module names, instead of foobarbletchmodule.c you can |
| 119 | use foobarbletch.c |
| 120 | |
| 121 | - getintvalue() and getfloatvalue() try to convert any object |
| 122 | instead of requiring an "intobject" or "floatobject" |
| 123 | |
| 124 | - All the [new]getargs() formats that retrieve an integer value |
| 125 | will now also work if a float is passed |
| 126 | |
| 127 | - C function listtuple() converts list to tuple, fast |
| 128 | |
| 129 | - You should now call sigcheck() instead of intrcheck(); |
| 130 | sigcheck() also sets an exception when it returns nonzero |
| 131 | |
| 132 | |
Guido van Rossum | 8c97365 | 1994-07-14 13:57:11 +0000 | [diff] [blame] | 133 | ==================================== |
| 134 | ==> Release 1.0.3 (14 July 1994) <== |
| 135 | ==================================== |
| 136 | |
| 137 | This release consists entirely of bug fixes to the C sources; see the |
| 138 | head of ../ChangeLog for a complete list. Most important bugs fixed: |
| 139 | |
| 140 | - Sometimes the format operator (string%expr) would drop the last |
| 141 | character of the format string |
| 142 | |
| 143 | - Tokenizer looped when last line did not end in \n |
| 144 | |
| 145 | - Bug when triple-quoted string ended in quote plus newline |
| 146 | |
| 147 | - Typo in socketmodule (listen) (== instead of =) |
| 148 | |
| 149 | - typing vars() at the >>> prompt would cause recursive output |
| 150 | |
Guido van Rossum | 5c74304 | 1994-05-04 13:10:17 +0000 | [diff] [blame] | 151 | ================================== |
| 152 | ==> Release 1.0.2 (4 May 1994) <== |
| 153 | ================================== |
| 154 | |
| 155 | Overview of the most visible changes. Bug fixes are not listed. See |
| 156 | also ChangeLog. |
| 157 | |
| 158 | Tokens |
| 159 | ------ |
| 160 | |
| 161 | * String literals follow Standard C rules: they may be continued on |
| 162 | the next line using a backslash; adjacent literals are concatenated |
| 163 | at compile time. |
| 164 | |
| 165 | * A new kind of string literals, surrounded by triple quotes (""" or |
| 166 | '''), can be continued on the next line without a backslash. |
| 167 | |
| 168 | Syntax |
| 169 | ------ |
| 170 | |
| 171 | * Function arguments may have a default value, e.g. def f(a, b=1); |
| 172 | defaults are evaluated at function definition time. This also applies |
| 173 | to lambda. |
| 174 | |
| 175 | * The try-except statement has an optional else clause, which is |
| 176 | executed when no exception occurs in the try clause. |
| 177 | |
| 178 | Interpreter |
| 179 | ----------- |
| 180 | |
| 181 | * The result of a statement-level expression is no longer printed, |
| 182 | except_ for expressions entered interactively. Consequently, the -k |
| 183 | command line option is gone. |
| 184 | |
| 185 | * The result of the last printed interactive expression is assigned to |
| 186 | the variable '_'. |
| 187 | |
| 188 | * Access to implicit global variables has been speeded up by removing |
| 189 | an always-failing dictionary lookup in the dictionary of local |
| 190 | variables (mod suggested by Steve Makewski and Tim Peters). |
| 191 | |
| 192 | * There is a new command line option, -u, to force stdout and stderr |
| 193 | to be unbuffered. |
| 194 | |
| 195 | * Incorporated Steve Majewski's mods to import.c for dynamic loading |
| 196 | under AIX. |
| 197 | |
| 198 | * Fewer chances of dumping core when trying to reload or re-import |
| 199 | static built-in, dynamically loaded built-in, or frozen modules. |
| 200 | |
| 201 | * Loops over sequences now don't ask for the sequence's length when |
| 202 | they start, but try to access items 0, 1, 2, and so on until they hit |
| 203 | an IndexError. This makes it possible to create classes that generate |
| 204 | infinite or indefinite sequences a la Steve Majewski. This affects |
| 205 | for loops, the (not) in operator, and the built-in functions filter(), |
| 206 | map(), max(), min(), reduce(). |
| 207 | |
| 208 | Changed Built-in operations |
| 209 | --------------------------- |
| 210 | |
| 211 | * The '%' operator on strings (printf-style formatting) supports a new |
| 212 | feature (adapted from a patch by Donald Beaudry) to allow |
| 213 | '%(<key>)<format>' % {...} to take values from a dictionary by name |
| 214 | instead of from a tuple by position (see also the new function |
| 215 | vars()). |
| 216 | |
| 217 | * The '%s' formatting operator is changed to accept any type and |
| 218 | convert it to a string using str(). |
| 219 | |
| 220 | * Dictionaries with more than 20,000 entries can now be created |
| 221 | (thanks to Steve Kirsch). |
| 222 | |
| 223 | New Built-in Functions |
| 224 | ---------------------- |
| 225 | |
| 226 | * vars() returns a dictionary containing the local variables; vars(m) |
| 227 | returns a dictionary containing the variables of module m. Note: |
| 228 | dir(x) is now equivalent to vars(x).keys(). |
| 229 | |
| 230 | Changed Built-in Functions |
| 231 | -------------------------- |
| 232 | |
| 233 | * open() has an optional third argument to specify the buffer size: 0 |
| 234 | for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0 |
| 235 | for default. |
| 236 | |
| 237 | * open()'s second argument is now optional; it defaults to "r". |
| 238 | |
| 239 | * apply() now checks that its second argument is indeed a tuple. |
| 240 | |
| 241 | New Built-in Modules |
| 242 | -------------------- |
| 243 | |
| 244 | Changed Built-in Modules |
| 245 | ------------------------ |
| 246 | |
| 247 | The thread module no longer supports exit_prog(). |
| 248 | |
| 249 | New Python Modules |
| 250 | ------------------ |
| 251 | |
| 252 | * Module addpack contains a standard interface to modify sys.path to |
| 253 | find optional packages (groups of related modules). |
| 254 | |
| 255 | * Module urllib contains a number of functions to access |
| 256 | World-Wide-Web files specified by their URL. |
| 257 | |
| 258 | * Module httplib implements the client side of the HTTP protocol used |
| 259 | by World-Wide-Web servers. |
| 260 | |
| 261 | * Module gopherlib implements the client side of the Gopher protocol. |
| 262 | |
| 263 | * Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF |
| 264 | style mailbox files. |
| 265 | |
| 266 | * Module random contains various random distributions, e.g. gauss(). |
| 267 | |
| 268 | * Module lockfile locks and unlocks open files using fcntl (inspired |
| 269 | by a similar module by Andy Bensky). |
| 270 | |
| 271 | * Module ntpath (by Jaap Vermeulen) implements path operations for |
| 272 | Windows/NT. |
| 273 | |
| 274 | * Module test_thread (in Lib/test) contains a small test set for the |
| 275 | thread module. |
| 276 | |
| 277 | Changed Python Modules |
| 278 | ---------------------- |
| 279 | |
| 280 | * The string module's expandvars() function is now documented and is |
| 281 | implemented in Python (using regular expressions) instead of forking |
| 282 | off a shell process. |
| 283 | |
| 284 | * Module rfc822 now supports accessing the header fields using the |
| 285 | mapping/dictionary interface, e.g. h['subject']. |
| 286 | |
| 287 | * Module pdb now makes it possible to set a break on a function |
| 288 | (syntax: break <expression>, where <expression> yields a function |
| 289 | object). |
| 290 | |
| 291 | Changed Demos |
| 292 | ------------- |
| 293 | |
| 294 | * The Demo/scripts/freeze.py script is working again (thanks to Jaap |
| 295 | Vermeulen). |
| 296 | |
| 297 | New Demos |
| 298 | --------- |
| 299 | |
| 300 | * Demo/threads/Generator.py is a proposed interface for restartable |
| 301 | functions a la Tim Peters. |
| 302 | |
| 303 | * Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a |
| 304 | directory full of HTML pages which between them contain links to all |
| 305 | the newsgroups available on your server. |
| 306 | |
| 307 | * Demo/dns contains a DNS (Domain Name Server) client. |
| 308 | |
| 309 | * Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a |
| 310 | nice enhanced Python shell!!!). |
| 311 | |
| 312 | * Demo/turing contains a Turing machine by Amrit Prem. |
| 313 | |
| 314 | Documentation |
| 315 | ------------- |
| 316 | |
| 317 | * Documented new language features mentioned above (but not all new |
| 318 | modules). |
| 319 | |
| 320 | * Added a chapter to the Tutorial describing recent additions to |
| 321 | Python. |
| 322 | |
| 323 | * Clarified some sentences in the reference manual, |
| 324 | e.g. break/continue, local/global scope, slice assignment. |
| 325 | |
| 326 | Source Structure |
| 327 | ---------------- |
| 328 | |
| 329 | * Moved Include/tokenizer.h to Parser/tokenizer.h. |
| 330 | |
| 331 | * Added Python/getopt.c for systems that don't have it. |
| 332 | |
| 333 | Emacs mode |
| 334 | ---------- |
| 335 | |
| 336 | * Indentation of continuated lines is done more intelligently; |
| 337 | consequently the variable py-continuation-offset is gone. |
| 338 | |
Guido van Rossum | 617536e | 1994-04-14 13:01:54 +0000 | [diff] [blame] | 339 | ======================================== |
| 340 | ==> Release 1.0.1 (15 February 1994) <== |
| 341 | ======================================== |
| 342 | |
| 343 | * Many portability fixes should make it painless to build Python on |
| 344 | several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows. |
| 345 | |
| 346 | * Fixed test for <stdarg.h> -- this broke on some platforms. |
| 347 | |
| 348 | * Fixed test for shared library dynalic loading -- this broke on SunOS |
| 349 | 4.x using the GNU loader. |
| 350 | |
| 351 | * Changed order and number of SVR4 networking libraries (it is now |
| 352 | -lsocket -linet -lnsl, if these libraries exist). |
| 353 | |
| 354 | * Installing the build intermediate stages with "make libainstall" now |
| 355 | also installs config.c.in, Setup and makesetup, which are used by the |
| 356 | new Extensions mechanism. |
| 357 | |
| 358 | * Improved README file contains more hints and new troubleshooting |
| 359 | section. |
| 360 | |
| 361 | * The built-in module strop now defines fast versions of three more |
| 362 | functions of the standard string module: atoi(), atol() and atof(). |
| 363 | The strop versions of atoi() and atol() support an optional second |
| 364 | argument to specify the base (default 10). NOTE: you don't have to |
| 365 | explicitly import strop to use the faster versions -- the string |
| 366 | module contains code to let versions from stop override the default |
| 367 | versions. |
| 368 | |
| 369 | * There is now a working Lib/dospath.py for those who use Python under |
| 370 | DOS (or Windows). Thanks, Jaap! |
| 371 | |
| 372 | * There is now a working Modules/dosmodule.c for DOS (or Windows) |
| 373 | system calls. |
| 374 | |
| 375 | * Lib.os.py has been reorganized (making it ready for more operating |
| 376 | systems). |
| 377 | |
| 378 | * Lib/ospath.py is now obsolete (use os.path instead). |
| 379 | |
| 380 | * Many fixes to the tutorial to make it match Python 1.0. Thanks, |
| 381 | Tim! |
| 382 | |
| 383 | * Fixed Doc/Makefile, Doc/README and various scripts there. |
| 384 | |
| 385 | * Added missing description of fdopen to Doc/libposix.tex. |
| 386 | |
| 387 | * Made cleanup() global, for the benefit of embedded applications. |
| 388 | |
| 389 | * Added parsing of addresses and dates to Lib/rfc822.py. |
| 390 | |
| 391 | * Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make |
| 392 | them usable at all. |
| 393 | |
| 394 | * New module Lib/wave.py reads RIFF (*.wav) audio files. |
| 395 | |
| 396 | * Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it |
| 397 | belongs. |
| 398 | |
| 399 | * New options and comments for Modules/makesetup (used by new |
| 400 | Extension mechanism). |
| 401 | |
| 402 | * Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc |
| 403 | and elsewhere. |
| 404 | |
| 405 | * Fixed coredump in filter(None, 'abcdefg'). |
| 406 | |
| 407 | |
Guido van Rossum | a85d053 | 1994-01-26 17:24:14 +0000 | [diff] [blame] | 408 | ======================================= |
| 409 | ==> Release 1.0.0 (26 January 1994) <== |
| 410 | ======================================= |
| 411 | |
| 412 | As is traditional, so many things have changed that I can't pretend to |
| 413 | be complete in these release notes, but I'll try anyway :-) |
| 414 | |
| 415 | Note that the very last section is labeled "remaining bugs". |
| 416 | |
| 417 | |
| 418 | Source organization and build process |
| 419 | ------------------------------------- |
| 420 | |
| 421 | * The sources have finally been split: instead of a single src |
| 422 | subdirectory there are now separate directories Include, Parser, |
| 423 | Grammar, Objects, Python and Modules. Other directories also start |
| 424 | with a capital letter: Misc, Doc, Lib, Demo. |
| 425 | |
| 426 | * A few extensions (notably Amoeba and X support) have been moved to a |
| 427 | separate subtree Extensions, which is no longer in the core |
| 428 | distribution, but separately ftp'able as extensions.tar.Z. (The |
| 429 | distribution contains a placeholder Ext-dummy with a description of |
| 430 | the Extensions subtree as well as the most recent versions of the |
| 431 | scripts used there.) |
| 432 | |
| 433 | * A few large specialized demos (SGI video and www) have been |
| 434 | moved to a separate subdirectory Demo2, which is no longer in the core |
| 435 | distribution, but separately ftp'able as demo2.tar.Z. |
| 436 | |
| 437 | * Parts of the standard library have been moved to subdirectories: |
| 438 | there are now standard subdirectories stdwin, test, sgi and sun4. |
| 439 | |
| 440 | * The configuration process has radically changed: I now use GNU |
| 441 | autoconf. This makes it much easier to build on new Unix flavors, as |
| 442 | well as fully supporting VPATH (if your Make has it). The scripts |
| 443 | Configure.py and Addmodule.sh are no longer needed. Many source files |
| 444 | have been adapted in order to work with the symbols that the configure |
| 445 | script generated by autoconf defines (or not); the resulting source is |
| 446 | much more portable to different C compilers and operating systems, |
| 447 | even non Unix systems (a Mac port was done in an afternoon). See the |
| 448 | toplevel README file for a description of the new build process. |
| 449 | |
| 450 | * GNU readline (a slightly newer version) is now a subdirectory of the |
| 451 | Python toplevel. It is still not automatically configured (being |
| 452 | totally autoconf-unaware :-). One problem has been solved: typing |
| 453 | Control-C to a readline prompt will now work. The distribution no |
| 454 | longer contains a "super-level" directory (above the python toplevel |
| 455 | directory), and dl, dl-dld and GNU dld are no longer part of the |
| 456 | Python distribution (you can still ftp them from |
| 457 | ftp.cwi.nl:/pub/dynload). |
| 458 | |
| 459 | * The DOS functions have been taken out of posixmodule.c and moved |
| 460 | into a separate file dosmodule.c. |
| 461 | |
| 462 | * There's now a separate file version.c which contains nothing but |
| 463 | the version number. |
| 464 | |
| 465 | * The actual main program is now contained in config.c (unless NO_MAIN |
| 466 | is defined); pythonmain.c now contains a function realmain() which is |
| 467 | called from config.c's main(). |
| 468 | |
| 469 | * All files needed to use the built-in module md5 are now contained in |
| 470 | the distribution. The module has been cleaned up considerably. |
| 471 | |
| 472 | |
| 473 | Documentation |
| 474 | ------------- |
| 475 | |
| 476 | * The library manual has been split into many more small latex files, |
| 477 | so it is easier to edit Doc/lib.tex file to create a custom library |
| 478 | manual, describing only those modules supported on your system. (This |
| 479 | is not automated though.) |
| 480 | |
| 481 | * A fourth manual has been added, titled "Extending and Embedding the |
| 482 | Python Interpreter" (Doc/ext.tex), which collects information about |
| 483 | the interpreter which was previously spread over several files in the |
| 484 | misc subdirectory. |
| 485 | |
| 486 | * The entire documentation is now also available on-line for those who |
| 487 | have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL |
| 488 | "http://www.cwi.nl/~guido/Python.html". |
| 489 | |
| 490 | |
| 491 | Syntax |
| 492 | ------ |
| 493 | |
| 494 | * Strings may now be enclosed in double quotes as well as in single |
| 495 | quotes. There is no difference in interpretation. The repr() of |
| 496 | string objects will use double quotes if the string contains a single |
Guido van Rossum | 5125908 | 1994-01-26 18:20:06 +0000 | [diff] [blame] | 497 | quote and no double quotes. Thanks to Amrit Prem for these changes! |
Guido van Rossum | a85d053 | 1994-01-26 17:24:14 +0000 | [diff] [blame] | 498 | |
| 499 | * There is a new keyword 'exec'. This replaces the exec() built-in |
| 500 | function. If a function contains an exec statement, local variable |
| 501 | optimization is not performed for that particular function, thus |
| 502 | making assignment to local variables in exec statements less |
| 503 | confusing. (As a consequence, os.exec and python.exec have been |
| 504 | renamed to execv.) |
| 505 | |
| 506 | * There is a new keyword 'lambda'. An expression of the form |
| 507 | |
| 508 | lambda <parameters> : <expression> |
| 509 | |
| 510 | yields an anonymous function. This is really only syntactic sugar; |
| 511 | you can just as well define a local function using |
| 512 | |
| 513 | def some_temporary_name(<parameters>): return <expression> |
| 514 | |
| 515 | Lambda expressions are particularly useful in combination with map(), |
Guido van Rossum | 5125908 | 1994-01-26 18:20:06 +0000 | [diff] [blame] | 516 | filter() and reduce(), described below. Thanks to Amrit Prem for |
Guido van Rossum | a85d053 | 1994-01-26 17:24:14 +0000 | [diff] [blame] | 517 | submitting this code (as well as map(), filter(), reduce() and |
| 518 | xrange())! |
| 519 | |
| 520 | |
| 521 | Built-in functions |
| 522 | ------------------ |
| 523 | |
| 524 | * The built-in module containing the built-in functions is called |
| 525 | __builtin__ instead of builtin. |
| 526 | |
| 527 | * New built-in functions map(), filter() and reduce() perform standard |
| 528 | functional programming operations (though not lazily): |
| 529 | |
| 530 | - map(f, seq) returns a new sequence whose items are the items from |
| 531 | seq with f() applied to them. |
| 532 | |
| 533 | - filter(f, seq) returns a subsequence of seq consisting of those |
| 534 | items for which f() is true. |
| 535 | |
| 536 | - reduce(f, seq, initial) returns a value computed as follows: |
| 537 | acc = initial |
| 538 | for item in seq: acc = f(acc, item) |
| 539 | return acc |
| 540 | |
| 541 | * New function xrange() creates a "range object". Its arguments are |
| 542 | the same as those of range(), and when used in a for loop a range |
| 543 | objects also behaves identical. The advantage of xrange() over |
| 544 | range() is that its representation (if the range contains many |
| 545 | elements) is much more compact than that of range(). The disadvantage |
| 546 | is that the result cannot be used to initialize a list object or for |
| 547 | the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern |
| 548 | architectures, benchmarks have shown that "for i in range(...): ..." |
| 549 | actually executes *faster* than "for i in xrange(...): ...", but on |
| 550 | memory starved machines like PCs running DOS range(100000) may be just |
| 551 | too big to be represented at all... |
| 552 | |
| 553 | * Built-in function exec() has been replaced by the exec statement -- |
| 554 | see above. |
| 555 | |
| 556 | |
| 557 | The interpreter |
| 558 | --------------- |
| 559 | |
| 560 | * Syntax errors are now not printed to stderr by the parser, but |
| 561 | rather the offending line and other relevant information are packed up |
| 562 | in the SyntaxError exception argument. When the main loop catches a |
| 563 | SyntaxError exception it will print the error in the same format as |
| 564 | previously, but at the proper position in the stack traceback. |
| 565 | |
| 566 | * You can now set a maximum to the number of traceback entries |
| 567 | printed by assigning to sys.tracebacklimit. The default is 1000. |
| 568 | |
| 569 | * The version number in .pyc files has changed yet again. |
| 570 | |
| 571 | * It is now possible to have a .pyc file without a corresponding .py |
| 572 | file. (Warning: this may break existing installations if you have an |
| 573 | old .pyc file lingering around somewhere on your module search path |
| 574 | without a corresponding .py file, when there is a .py file for a |
| 575 | module of the same name further down the path -- the new interpreter |
| 576 | will find the first .pyc file and complain about it, while the old |
| 577 | interpreter would ignore it and use the .py file further down.) |
| 578 | |
| 579 | * The list sys.builtin_module_names is now sorted and also contains |
| 580 | the names of a few hardwired built-in modules (sys, __main__ and |
| 581 | __builtin__). |
| 582 | |
| 583 | * A module can now find its own name by accessing the global variable |
| 584 | __name__. Assigning to this variable essentially renames the module |
| 585 | (it should also be stored under a different key in sys.modules). |
| 586 | A neat hack follows from this: a module that wants to execute a main |
| 587 | program when called as a script no longer needs to compare |
| 588 | sys.argv[0]; it can simply do "if __name__ == '__main__': main()". |
| 589 | |
| 590 | * When an object is printed by the print statement, its implementation |
| 591 | of str() is used. This means that classes can define __str__(self) to |
| 592 | direct how their instances are printed. This is different from |
| 593 | __repr__(self), which should define an unambigous string |
| 594 | representation of the instance. (If __str__() is not defined, it |
| 595 | defaults to __repr__().) |
| 596 | |
| 597 | * Functions and code objects can now be compared meaningfully. |
| 598 | |
| 599 | * On systems supporting SunOS or SVR4 style shared libraries, dynamic |
| 600 | loading of modules using shared libraries is automatically configured. |
| 601 | Thanks to Bill Jansen and Denis Severson for contributing this change! |
| 602 | |
| 603 | |
| 604 | Built-in objects |
| 605 | ---------------- |
| 606 | |
| 607 | * File objects have acquired a new method writelines() which is the |
| 608 | reverse of readlines(). (It does not actually write lines, just a |
| 609 | list of strings, but the symmetry makes the choice of name OK.) |
| 610 | |
| 611 | |
| 612 | Built-in modules |
| 613 | ---------------- |
| 614 | |
| 615 | * Socket objects no longer support the avail() method. Use the select |
| 616 | module instead, or use this function to replace it: |
| 617 | |
| 618 | def avail(f): |
| 619 | import select |
| 620 | return f in select.select([f], [], [], 0)[0] |
| 621 | |
| 622 | * Initialization of stdwin is done differently. It actually modifies |
| 623 | sys.argv (taking out the options the X version of stdwin recognizes) |
| 624 | the first time it is imported. |
| 625 | |
| 626 | * A new built-in module parser provides a rudimentary interface to the |
| 627 | python parser. Corresponding standard library modules token and symbol |
| 628 | defines the numeric values of tokens and non-terminal symbols. |
| 629 | |
| 630 | * The posix module has aquired new functions setuid(), setgid(), |
| 631 | execve(), and exec() has been renamed to execv(). |
| 632 | |
| 633 | * The array module is extended with 8-byte object swaps, the 'i' |
| 634 | format character, and a reverse() method. The read() and write() |
| 635 | methods are renamed to fromfile() and tofile(). |
| 636 | |
| 637 | * The rotor module has freed of portability bugs. This introduces a |
| 638 | backward compatibility problem: strings encoded with the old rotor |
| 639 | module can't be decoded by the new version. |
| 640 | |
| 641 | * For select.select(), a timeout (4th) argument of None means the same |
| 642 | as leaving the timeout argument out. |
| 643 | |
| 644 | * Module strop (and hence standard library module string) has aquired |
Guido van Rossum | 5125908 | 1994-01-26 18:20:06 +0000 | [diff] [blame] | 645 | a new function: rindex(). Thanks to Amrit Prem! |
Guido van Rossum | a85d053 | 1994-01-26 17:24:14 +0000 | [diff] [blame] | 646 | |
| 647 | * Module regex defines a new function symcomp() which uses an extended |
| 648 | regular expression syntax: parenthesized subexpressions may be labeled |
| 649 | using the form "\(<labelname>...\)", and the group() method can return |
| 650 | sub-expressions by name. Thanks to Tracy Tims for these changes! |
| 651 | |
| 652 | * Multiple threads are now supported on Solaris 2. Thanks to Sjoerd |
| 653 | Mullender! |
| 654 | |
| 655 | |
| 656 | Standard library modules |
| 657 | ------------------------ |
| 658 | |
| 659 | * The library is now split in several subdirectories: all stuff using |
| 660 | stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff |
| 661 | is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all |
| 662 | test modules are in Lib/test. The default module search path will |
| 663 | include all relevant subdirectories by default. |
| 664 | |
| 665 | * Module os now knows about trying to import dos. It defines |
| 666 | functions execl(), execle(), execlp() and execvp(). |
| 667 | |
| 668 | * New module dospath (should be attacked by a DOS hacker though). |
| 669 | |
| 670 | * All modules defining classes now define __init__() constructors |
| 671 | instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE! |
| 672 | |
| 673 | * Some minor changes and bugfixes module ftplib (mostly Steve |
| 674 | Majewski's suggestions); the debug() method is renamed to |
| 675 | set_debuglevel(). |
| 676 | |
| 677 | * Some new test modules (not run automatically by testall though): |
| 678 | test_audioop, test_md5, test_rgbimg, test_select. |
| 679 | |
| 680 | * Module string now defines rindex() and rfind() in analogy of index() |
| 681 | and find(). It also defines atof() and atol() (and corresponding |
| 682 | exceptions) in analogy to atoi(). |
| 683 | |
| 684 | * Added help() functions to modules profile and pdb. |
| 685 | |
| 686 | * The wdb debugger (now in Lib/stdwin) now shows class or instance |
| 687 | variables on a double click. Thanks to Sjoerd Mullender! |
| 688 | |
| 689 | * The (undocumented) module lambda has gone -- you couldn't import it |
| 690 | any more, and it was basically more a demo than a library module... |
| 691 | |
| 692 | |
| 693 | Multimedia extensions |
| 694 | --------------------- |
| 695 | |
| 696 | * The optional built-in modules audioop and imageop are now standard |
| 697 | parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen |
| 698 | for contributing this code! |
| 699 | |
| 700 | * There's a new operation in audioop: minmax(). |
| 701 | |
| 702 | * There's a new built-in module called rgbimg which supports portable |
| 703 | efficient reading of SGI RCG image files. Thanks also to Paul |
| 704 | Haeberli for the original code! (Who will contribute a GIF reader?) |
| 705 | |
| 706 | * The module aifc is gone -- you should now always use aifc, which has |
| 707 | received a facelift. |
| 708 | |
| 709 | * There's a new module sunau., for reading Sun (and NeXT) audio files. |
| 710 | |
| 711 | * There's a new module audiodev which provides a uniform interface to |
| 712 | (SGI Indigo and Sun Sparc) audio hardware. |
| 713 | |
| 714 | * There's a new module sndhdr which recognizes various sound files by |
| 715 | looking in their header and checking for various magic words. |
| 716 | |
| 717 | |
| 718 | Optimizations |
| 719 | ------------- |
| 720 | |
| 721 | * Most optimizations below can be configured by compile-time flags. |
| 722 | Thanks to Sjoerd Mullender for submitting these optimizations! |
| 723 | |
| 724 | * Small integers (default -1..99) are shared -- i.e. if two different |
| 725 | functions compute the same value it is possible (but not |
| 726 | guaranteed!!!) that they return the same *object*. Python programs |
| 727 | can detect this but should *never* rely on it. |
| 728 | |
| 729 | * Empty tuples (which all compare equal) are shared in the same |
| 730 | manner. |
| 731 | |
| 732 | * Tuples of size up to 20 (default) are put in separate free lists |
| 733 | when deallocated. |
| 734 | |
| 735 | * There is a compile-time option to cache a string's hash function, |
| 736 | but this appeared to have a negligeable effect, and as it costs 4 |
| 737 | bytes per string it is disabled by default. |
| 738 | |
| 739 | |
| 740 | Embedding Python |
| 741 | ---------------- |
| 742 | |
| 743 | * The initialization interface has been simplified somewhat. You now |
| 744 | only call "initall()" to initialize the interpreter. |
| 745 | |
| 746 | * The previously announced renaming of externally visible identifiers |
| 747 | has not been carried out. It will happen in a later release. Sorry. |
| 748 | |
| 749 | |
| 750 | Miscellaneous bugs that have been fixed |
| 751 | --------------------------------------- |
| 752 | |
| 753 | * All known portability bugs. |
| 754 | |
| 755 | * Version 0.9.9 dumped core in <listobject>.sort() which has been |
| 756 | fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix |
| 757 | on the mailing list while I was away! |
| 758 | |
| 759 | * Core dump on a format string ending in '%', e.g. in the expression |
| 760 | '%' % None. |
| 761 | |
| 762 | * The array module yielded a bogus result for concatenation (a+b would |
| 763 | yield a+a). |
| 764 | |
| 765 | * Some serious memory leaks in strop.split() and strop.splitfields(). |
| 766 | |
| 767 | * Several problems with the nis module. |
| 768 | |
| 769 | * Subtle problem when copying a class method from another class |
| 770 | through assignment (the method could not be called). |
| 771 | |
| 772 | |
| 773 | Remaining bugs |
| 774 | -------------- |
| 775 | |
| 776 | * One problem with 64-bit machines remains -- since .pyc files are |
| 777 | portable and use only 4 bytes to represent an integer object, 64-bit |
| 778 | integer literals are silently truncated when written into a .pyc file. |
| 779 | Work-around: use eval('123456789101112'). |
| 780 | |
| 781 | * The freeze script doesn't work any more. A new and more portable |
| 782 | one can probably be cooked up using tricks from Extensions/mkext.py. |
| 783 | |
| 784 | * The dos support hasn't been tested yet. (Really Soon Now we should |
| 785 | have a PC with a working C compiler!) |
| 786 | |
| 787 | |
| 788 | --Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl> |
| 789 | URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html> |