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