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