Guido van Rossum | a85d053 | 1994-01-26 17:24:14 +0000 | [diff] [blame] | 1 | ======================================= |
| 2 | ==> Release 1.0.0 (26 January 1994) <== |
| 3 | ======================================= |
| 4 | |
| 5 | As is traditional, so many things have changed that I can't pretend to |
| 6 | be complete in these release notes, but I'll try anyway :-) |
| 7 | |
| 8 | Note that the very last section is labeled "remaining bugs". |
| 9 | |
| 10 | |
| 11 | Source organization and build process |
| 12 | ------------------------------------- |
| 13 | |
| 14 | * The sources have finally been split: instead of a single src |
| 15 | subdirectory there are now separate directories Include, Parser, |
| 16 | Grammar, Objects, Python and Modules. Other directories also start |
| 17 | with a capital letter: Misc, Doc, Lib, Demo. |
| 18 | |
| 19 | * A few extensions (notably Amoeba and X support) have been moved to a |
| 20 | separate subtree Extensions, which is no longer in the core |
| 21 | distribution, but separately ftp'able as extensions.tar.Z. (The |
| 22 | distribution contains a placeholder Ext-dummy with a description of |
| 23 | the Extensions subtree as well as the most recent versions of the |
| 24 | scripts used there.) |
| 25 | |
| 26 | * A few large specialized demos (SGI video and www) have been |
| 27 | moved to a separate subdirectory Demo2, which is no longer in the core |
| 28 | distribution, but separately ftp'able as demo2.tar.Z. |
| 29 | |
| 30 | * Parts of the standard library have been moved to subdirectories: |
| 31 | there are now standard subdirectories stdwin, test, sgi and sun4. |
| 32 | |
| 33 | * The configuration process has radically changed: I now use GNU |
| 34 | autoconf. This makes it much easier to build on new Unix flavors, as |
| 35 | well as fully supporting VPATH (if your Make has it). The scripts |
| 36 | Configure.py and Addmodule.sh are no longer needed. Many source files |
| 37 | have been adapted in order to work with the symbols that the configure |
| 38 | script generated by autoconf defines (or not); the resulting source is |
| 39 | much more portable to different C compilers and operating systems, |
| 40 | even non Unix systems (a Mac port was done in an afternoon). See the |
| 41 | toplevel README file for a description of the new build process. |
| 42 | |
| 43 | * GNU readline (a slightly newer version) is now a subdirectory of the |
| 44 | Python toplevel. It is still not automatically configured (being |
| 45 | totally autoconf-unaware :-). One problem has been solved: typing |
| 46 | Control-C to a readline prompt will now work. The distribution no |
| 47 | longer contains a "super-level" directory (above the python toplevel |
| 48 | directory), and dl, dl-dld and GNU dld are no longer part of the |
| 49 | Python distribution (you can still ftp them from |
| 50 | ftp.cwi.nl:/pub/dynload). |
| 51 | |
| 52 | * The DOS functions have been taken out of posixmodule.c and moved |
| 53 | into a separate file dosmodule.c. |
| 54 | |
| 55 | * There's now a separate file version.c which contains nothing but |
| 56 | the version number. |
| 57 | |
| 58 | * The actual main program is now contained in config.c (unless NO_MAIN |
| 59 | is defined); pythonmain.c now contains a function realmain() which is |
| 60 | called from config.c's main(). |
| 61 | |
| 62 | * All files needed to use the built-in module md5 are now contained in |
| 63 | the distribution. The module has been cleaned up considerably. |
| 64 | |
| 65 | |
| 66 | Documentation |
| 67 | ------------- |
| 68 | |
| 69 | * The library manual has been split into many more small latex files, |
| 70 | so it is easier to edit Doc/lib.tex file to create a custom library |
| 71 | manual, describing only those modules supported on your system. (This |
| 72 | is not automated though.) |
| 73 | |
| 74 | * A fourth manual has been added, titled "Extending and Embedding the |
| 75 | Python Interpreter" (Doc/ext.tex), which collects information about |
| 76 | the interpreter which was previously spread over several files in the |
| 77 | misc subdirectory. |
| 78 | |
| 79 | * The entire documentation is now also available on-line for those who |
| 80 | have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL |
| 81 | "http://www.cwi.nl/~guido/Python.html". |
| 82 | |
| 83 | |
| 84 | Syntax |
| 85 | ------ |
| 86 | |
| 87 | * Strings may now be enclosed in double quotes as well as in single |
| 88 | quotes. There is no difference in interpretation. The repr() of |
| 89 | 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] | 90 | 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] | 91 | |
| 92 | * There is a new keyword 'exec'. This replaces the exec() built-in |
| 93 | function. If a function contains an exec statement, local variable |
| 94 | optimization is not performed for that particular function, thus |
| 95 | making assignment to local variables in exec statements less |
| 96 | confusing. (As a consequence, os.exec and python.exec have been |
| 97 | renamed to execv.) |
| 98 | |
| 99 | * There is a new keyword 'lambda'. An expression of the form |
| 100 | |
| 101 | lambda <parameters> : <expression> |
| 102 | |
| 103 | yields an anonymous function. This is really only syntactic sugar; |
| 104 | you can just as well define a local function using |
| 105 | |
| 106 | def some_temporary_name(<parameters>): return <expression> |
| 107 | |
| 108 | Lambda expressions are particularly useful in combination with map(), |
Guido van Rossum | 5125908 | 1994-01-26 18:20:06 +0000 | [diff] [blame] | 109 | filter() and reduce(), described below. Thanks to Amrit Prem for |
Guido van Rossum | a85d053 | 1994-01-26 17:24:14 +0000 | [diff] [blame] | 110 | submitting this code (as well as map(), filter(), reduce() and |
| 111 | xrange())! |
| 112 | |
| 113 | |
| 114 | Built-in functions |
| 115 | ------------------ |
| 116 | |
| 117 | * The built-in module containing the built-in functions is called |
| 118 | __builtin__ instead of builtin. |
| 119 | |
| 120 | * New built-in functions map(), filter() and reduce() perform standard |
| 121 | functional programming operations (though not lazily): |
| 122 | |
| 123 | - map(f, seq) returns a new sequence whose items are the items from |
| 124 | seq with f() applied to them. |
| 125 | |
| 126 | - filter(f, seq) returns a subsequence of seq consisting of those |
| 127 | items for which f() is true. |
| 128 | |
| 129 | - reduce(f, seq, initial) returns a value computed as follows: |
| 130 | acc = initial |
| 131 | for item in seq: acc = f(acc, item) |
| 132 | return acc |
| 133 | |
| 134 | * New function xrange() creates a "range object". Its arguments are |
| 135 | the same as those of range(), and when used in a for loop a range |
| 136 | objects also behaves identical. The advantage of xrange() over |
| 137 | range() is that its representation (if the range contains many |
| 138 | elements) is much more compact than that of range(). The disadvantage |
| 139 | is that the result cannot be used to initialize a list object or for |
| 140 | the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern |
| 141 | architectures, benchmarks have shown that "for i in range(...): ..." |
| 142 | actually executes *faster* than "for i in xrange(...): ...", but on |
| 143 | memory starved machines like PCs running DOS range(100000) may be just |
| 144 | too big to be represented at all... |
| 145 | |
| 146 | * Built-in function exec() has been replaced by the exec statement -- |
| 147 | see above. |
| 148 | |
| 149 | |
| 150 | The interpreter |
| 151 | --------------- |
| 152 | |
| 153 | * Syntax errors are now not printed to stderr by the parser, but |
| 154 | rather the offending line and other relevant information are packed up |
| 155 | in the SyntaxError exception argument. When the main loop catches a |
| 156 | SyntaxError exception it will print the error in the same format as |
| 157 | previously, but at the proper position in the stack traceback. |
| 158 | |
| 159 | * You can now set a maximum to the number of traceback entries |
| 160 | printed by assigning to sys.tracebacklimit. The default is 1000. |
| 161 | |
| 162 | * The version number in .pyc files has changed yet again. |
| 163 | |
| 164 | * It is now possible to have a .pyc file without a corresponding .py |
| 165 | file. (Warning: this may break existing installations if you have an |
| 166 | old .pyc file lingering around somewhere on your module search path |
| 167 | without a corresponding .py file, when there is a .py file for a |
| 168 | module of the same name further down the path -- the new interpreter |
| 169 | will find the first .pyc file and complain about it, while the old |
| 170 | interpreter would ignore it and use the .py file further down.) |
| 171 | |
| 172 | * The list sys.builtin_module_names is now sorted and also contains |
| 173 | the names of a few hardwired built-in modules (sys, __main__ and |
| 174 | __builtin__). |
| 175 | |
| 176 | * A module can now find its own name by accessing the global variable |
| 177 | __name__. Assigning to this variable essentially renames the module |
| 178 | (it should also be stored under a different key in sys.modules). |
| 179 | A neat hack follows from this: a module that wants to execute a main |
| 180 | program when called as a script no longer needs to compare |
| 181 | sys.argv[0]; it can simply do "if __name__ == '__main__': main()". |
| 182 | |
| 183 | * When an object is printed by the print statement, its implementation |
| 184 | of str() is used. This means that classes can define __str__(self) to |
| 185 | direct how their instances are printed. This is different from |
| 186 | __repr__(self), which should define an unambigous string |
| 187 | representation of the instance. (If __str__() is not defined, it |
| 188 | defaults to __repr__().) |
| 189 | |
| 190 | * Functions and code objects can now be compared meaningfully. |
| 191 | |
| 192 | * On systems supporting SunOS or SVR4 style shared libraries, dynamic |
| 193 | loading of modules using shared libraries is automatically configured. |
| 194 | Thanks to Bill Jansen and Denis Severson for contributing this change! |
| 195 | |
| 196 | |
| 197 | Built-in objects |
| 198 | ---------------- |
| 199 | |
| 200 | * File objects have acquired a new method writelines() which is the |
| 201 | reverse of readlines(). (It does not actually write lines, just a |
| 202 | list of strings, but the symmetry makes the choice of name OK.) |
| 203 | |
| 204 | |
| 205 | Built-in modules |
| 206 | ---------------- |
| 207 | |
| 208 | * Socket objects no longer support the avail() method. Use the select |
| 209 | module instead, or use this function to replace it: |
| 210 | |
| 211 | def avail(f): |
| 212 | import select |
| 213 | return f in select.select([f], [], [], 0)[0] |
| 214 | |
| 215 | * Initialization of stdwin is done differently. It actually modifies |
| 216 | sys.argv (taking out the options the X version of stdwin recognizes) |
| 217 | the first time it is imported. |
| 218 | |
| 219 | * A new built-in module parser provides a rudimentary interface to the |
| 220 | python parser. Corresponding standard library modules token and symbol |
| 221 | defines the numeric values of tokens and non-terminal symbols. |
| 222 | |
| 223 | * The posix module has aquired new functions setuid(), setgid(), |
| 224 | execve(), and exec() has been renamed to execv(). |
| 225 | |
| 226 | * The array module is extended with 8-byte object swaps, the 'i' |
| 227 | format character, and a reverse() method. The read() and write() |
| 228 | methods are renamed to fromfile() and tofile(). |
| 229 | |
| 230 | * The rotor module has freed of portability bugs. This introduces a |
| 231 | backward compatibility problem: strings encoded with the old rotor |
| 232 | module can't be decoded by the new version. |
| 233 | |
| 234 | * For select.select(), a timeout (4th) argument of None means the same |
| 235 | as leaving the timeout argument out. |
| 236 | |
| 237 | * Module strop (and hence standard library module string) has aquired |
Guido van Rossum | 5125908 | 1994-01-26 18:20:06 +0000 | [diff] [blame] | 238 | a new function: rindex(). Thanks to Amrit Prem! |
Guido van Rossum | a85d053 | 1994-01-26 17:24:14 +0000 | [diff] [blame] | 239 | |
| 240 | * Module regex defines a new function symcomp() which uses an extended |
| 241 | regular expression syntax: parenthesized subexpressions may be labeled |
| 242 | using the form "\(<labelname>...\)", and the group() method can return |
| 243 | sub-expressions by name. Thanks to Tracy Tims for these changes! |
| 244 | |
| 245 | * Multiple threads are now supported on Solaris 2. Thanks to Sjoerd |
| 246 | Mullender! |
| 247 | |
| 248 | |
| 249 | Standard library modules |
| 250 | ------------------------ |
| 251 | |
| 252 | * The library is now split in several subdirectories: all stuff using |
| 253 | stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff |
| 254 | is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all |
| 255 | test modules are in Lib/test. The default module search path will |
| 256 | include all relevant subdirectories by default. |
| 257 | |
| 258 | * Module os now knows about trying to import dos. It defines |
| 259 | functions execl(), execle(), execlp() and execvp(). |
| 260 | |
| 261 | * New module dospath (should be attacked by a DOS hacker though). |
| 262 | |
| 263 | * All modules defining classes now define __init__() constructors |
| 264 | instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE! |
| 265 | |
| 266 | * Some minor changes and bugfixes module ftplib (mostly Steve |
| 267 | Majewski's suggestions); the debug() method is renamed to |
| 268 | set_debuglevel(). |
| 269 | |
| 270 | * Some new test modules (not run automatically by testall though): |
| 271 | test_audioop, test_md5, test_rgbimg, test_select. |
| 272 | |
| 273 | * Module string now defines rindex() and rfind() in analogy of index() |
| 274 | and find(). It also defines atof() and atol() (and corresponding |
| 275 | exceptions) in analogy to atoi(). |
| 276 | |
| 277 | * Added help() functions to modules profile and pdb. |
| 278 | |
| 279 | * The wdb debugger (now in Lib/stdwin) now shows class or instance |
| 280 | variables on a double click. Thanks to Sjoerd Mullender! |
| 281 | |
| 282 | * The (undocumented) module lambda has gone -- you couldn't import it |
| 283 | any more, and it was basically more a demo than a library module... |
| 284 | |
| 285 | |
| 286 | Multimedia extensions |
| 287 | --------------------- |
| 288 | |
| 289 | * The optional built-in modules audioop and imageop are now standard |
| 290 | parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen |
| 291 | for contributing this code! |
| 292 | |
| 293 | * There's a new operation in audioop: minmax(). |
| 294 | |
| 295 | * There's a new built-in module called rgbimg which supports portable |
| 296 | efficient reading of SGI RCG image files. Thanks also to Paul |
| 297 | Haeberli for the original code! (Who will contribute a GIF reader?) |
| 298 | |
| 299 | * The module aifc is gone -- you should now always use aifc, which has |
| 300 | received a facelift. |
| 301 | |
| 302 | * There's a new module sunau., for reading Sun (and NeXT) audio files. |
| 303 | |
| 304 | * There's a new module audiodev which provides a uniform interface to |
| 305 | (SGI Indigo and Sun Sparc) audio hardware. |
| 306 | |
| 307 | * There's a new module sndhdr which recognizes various sound files by |
| 308 | looking in their header and checking for various magic words. |
| 309 | |
| 310 | |
| 311 | Optimizations |
| 312 | ------------- |
| 313 | |
| 314 | * Most optimizations below can be configured by compile-time flags. |
| 315 | Thanks to Sjoerd Mullender for submitting these optimizations! |
| 316 | |
| 317 | * Small integers (default -1..99) are shared -- i.e. if two different |
| 318 | functions compute the same value it is possible (but not |
| 319 | guaranteed!!!) that they return the same *object*. Python programs |
| 320 | can detect this but should *never* rely on it. |
| 321 | |
| 322 | * Empty tuples (which all compare equal) are shared in the same |
| 323 | manner. |
| 324 | |
| 325 | * Tuples of size up to 20 (default) are put in separate free lists |
| 326 | when deallocated. |
| 327 | |
| 328 | * There is a compile-time option to cache a string's hash function, |
| 329 | but this appeared to have a negligeable effect, and as it costs 4 |
| 330 | bytes per string it is disabled by default. |
| 331 | |
| 332 | |
| 333 | Embedding Python |
| 334 | ---------------- |
| 335 | |
| 336 | * The initialization interface has been simplified somewhat. You now |
| 337 | only call "initall()" to initialize the interpreter. |
| 338 | |
| 339 | * The previously announced renaming of externally visible identifiers |
| 340 | has not been carried out. It will happen in a later release. Sorry. |
| 341 | |
| 342 | |
| 343 | Miscellaneous bugs that have been fixed |
| 344 | --------------------------------------- |
| 345 | |
| 346 | * All known portability bugs. |
| 347 | |
| 348 | * Version 0.9.9 dumped core in <listobject>.sort() which has been |
| 349 | fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix |
| 350 | on the mailing list while I was away! |
| 351 | |
| 352 | * Core dump on a format string ending in '%', e.g. in the expression |
| 353 | '%' % None. |
| 354 | |
| 355 | * The array module yielded a bogus result for concatenation (a+b would |
| 356 | yield a+a). |
| 357 | |
| 358 | * Some serious memory leaks in strop.split() and strop.splitfields(). |
| 359 | |
| 360 | * Several problems with the nis module. |
| 361 | |
| 362 | * Subtle problem when copying a class method from another class |
| 363 | through assignment (the method could not be called). |
| 364 | |
| 365 | |
| 366 | Remaining bugs |
| 367 | -------------- |
| 368 | |
| 369 | * One problem with 64-bit machines remains -- since .pyc files are |
| 370 | portable and use only 4 bytes to represent an integer object, 64-bit |
| 371 | integer literals are silently truncated when written into a .pyc file. |
| 372 | Work-around: use eval('123456789101112'). |
| 373 | |
| 374 | * The freeze script doesn't work any more. A new and more portable |
| 375 | one can probably be cooked up using tricks from Extensions/mkext.py. |
| 376 | |
| 377 | * The dos support hasn't been tested yet. (Really Soon Now we should |
| 378 | have a PC with a working C compiler!) |
| 379 | |
| 380 | |
| 381 | --Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl> |
| 382 | URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html> |