blob: e06974e09da06613488b308a0ebcb7848bf11b5f [file] [log] [blame]
Guido van Rossuma7925f11994-01-26 10:20:16 +00001Python history
2--------------
3
4This file contains the release messages for previous Python releases
5(slightly edited to adapt them to the format of this file). As you
6read on you go back to the dark ages of Python's history.
7
Guido van Rossumaa253861994-10-06 17:18:57 +00008
9====================================
10==> Release 1.0.3 (14 July 1994) <==
11====================================
12
13This release consists entirely of bug fixes to the C sources; see the
14head of ../ChangeLog for a complete list. Most important bugs fixed:
15
16- Sometimes the format operator (string%expr) would drop the last
17character of the format string
18
19- Tokenizer looped when last line did not end in \n
20
21- Bug when triple-quoted string ended in quote plus newline
22
23- Typo in socketmodule (listen) (== instead of =)
24
25- typing vars() at the >>> prompt would cause recursive output
26
27
28==================================
29==> Release 1.0.2 (4 May 1994) <==
30==================================
31
32Overview of the most visible changes. Bug fixes are not listed. See
33also ChangeLog.
34
35Tokens
36------
37
38* String literals follow Standard C rules: they may be continued on
39the next line using a backslash; adjacent literals are concatenated
40at compile time.
41
42* A new kind of string literals, surrounded by triple quotes (""" or
43'''), can be continued on the next line without a backslash.
44
45Syntax
46------
47
48* Function arguments may have a default value, e.g. def f(a, b=1);
49defaults are evaluated at function definition time. This also applies
50to lambda.
51
52* The try-except statement has an optional else clause, which is
53executed when no exception occurs in the try clause.
54
55Interpreter
56-----------
57
58* The result of a statement-level expression is no longer printed,
59except_ for expressions entered interactively. Consequently, the -k
60command line option is gone.
61
62* The result of the last printed interactive expression is assigned to
63the variable '_'.
64
65* Access to implicit global variables has been speeded up by removing
66an always-failing dictionary lookup in the dictionary of local
67variables (mod suggested by Steve Makewski and Tim Peters).
68
69* There is a new command line option, -u, to force stdout and stderr
70to be unbuffered.
71
72* Incorporated Steve Majewski's mods to import.c for dynamic loading
73under AIX.
74
75* Fewer chances of dumping core when trying to reload or re-import
76static built-in, dynamically loaded built-in, or frozen modules.
77
78* Loops over sequences now don't ask for the sequence's length when
79they start, but try to access items 0, 1, 2, and so on until they hit
80an IndexError. This makes it possible to create classes that generate
81infinite or indefinite sequences a la Steve Majewski. This affects
82for loops, the (not) in operator, and the built-in functions filter(),
83map(), max(), min(), reduce().
84
85Changed Built-in operations
86---------------------------
87
88* The '%' operator on strings (printf-style formatting) supports a new
89feature (adapted from a patch by Donald Beaudry) to allow
90'%(<key>)<format>' % {...} to take values from a dictionary by name
91instead of from a tuple by position (see also the new function
92vars()).
93
94* The '%s' formatting operator is changed to accept any type and
95convert it to a string using str().
96
97* Dictionaries with more than 20,000 entries can now be created
98(thanks to Steve Kirsch).
99
100New Built-in Functions
101----------------------
102
103* vars() returns a dictionary containing the local variables; vars(m)
104returns a dictionary containing the variables of module m. Note:
105dir(x) is now equivalent to vars(x).keys().
106
107Changed Built-in Functions
108--------------------------
109
110* open() has an optional third argument to specify the buffer size: 0
111for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
112for default.
113
114* open()'s second argument is now optional; it defaults to "r".
115
116* apply() now checks that its second argument is indeed a tuple.
117
118New Built-in Modules
119--------------------
120
121Changed Built-in Modules
122------------------------
123
124The thread module no longer supports exit_prog().
125
126New Python Modules
127------------------
128
129* Module addpack contains a standard interface to modify sys.path to
130find optional packages (groups of related modules).
131
132* Module urllib contains a number of functions to access
133World-Wide-Web files specified by their URL.
134
135* Module httplib implements the client side of the HTTP protocol used
136by World-Wide-Web servers.
137
138* Module gopherlib implements the client side of the Gopher protocol.
139
140* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
141style mailbox files.
142
143* Module random contains various random distributions, e.g. gauss().
144
145* Module lockfile locks and unlocks open files using fcntl (inspired
146by a similar module by Andy Bensky).
147
148* Module ntpath (by Jaap Vermeulen) implements path operations for
149Windows/NT.
150
151* Module test_thread (in Lib/test) contains a small test set for the
152thread module.
153
154Changed Python Modules
155----------------------
156
157* The string module's expandvars() function is now documented and is
158implemented in Python (using regular expressions) instead of forking
159off a shell process.
160
161* Module rfc822 now supports accessing the header fields using the
162mapping/dictionary interface, e.g. h['subject'].
163
164* Module pdb now makes it possible to set a break on a function
165(syntax: break <expression>, where <expression> yields a function
166object).
167
168Changed Demos
169-------------
170
171* The Demo/scripts/freeze.py script is working again (thanks to Jaap
172Vermeulen).
173
174New Demos
175---------
176
177* Demo/threads/Generator.py is a proposed interface for restartable
178functions a la Tim Peters.
179
180* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
181directory full of HTML pages which between them contain links to all
182the newsgroups available on your server.
183
184* Demo/dns contains a DNS (Domain Name Server) client.
185
186* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
187nice enhanced Python shell!!!).
188
189* Demo/turing contains a Turing machine by Amrit Prem.
190
191Documentation
192-------------
193
194* Documented new language features mentioned above (but not all new
195modules).
196
197* Added a chapter to the Tutorial describing recent additions to
198Python.
199
200* Clarified some sentences in the reference manual,
201e.g. break/continue, local/global scope, slice assignment.
202
203Source Structure
204----------------
205
206* Moved Include/tokenizer.h to Parser/tokenizer.h.
207
208* Added Python/getopt.c for systems that don't have it.
209
210Emacs mode
211----------
212
213* Indentation of continuated lines is done more intelligently;
214consequently the variable py-continuation-offset is gone.
215
216========================================
217==> Release 1.0.1 (15 February 1994) <==
218========================================
219
220* Many portability fixes should make it painless to build Python on
221several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
222
223* Fixed test for <stdarg.h> -- this broke on some platforms.
224
225* Fixed test for shared library dynalic loading -- this broke on SunOS
2264.x using the GNU loader.
227
228* Changed order and number of SVR4 networking libraries (it is now
229-lsocket -linet -lnsl, if these libraries exist).
230
231* Installing the build intermediate stages with "make libainstall" now
232also installs config.c.in, Setup and makesetup, which are used by the
233new Extensions mechanism.
234
235* Improved README file contains more hints and new troubleshooting
236section.
237
238* The built-in module strop now defines fast versions of three more
239functions of the standard string module: atoi(), atol() and atof().
240The strop versions of atoi() and atol() support an optional second
241argument to specify the base (default 10). NOTE: you don't have to
242explicitly import strop to use the faster versions -- the string
243module contains code to let versions from stop override the default
244versions.
245
246* There is now a working Lib/dospath.py for those who use Python under
247DOS (or Windows). Thanks, Jaap!
248
249* There is now a working Modules/dosmodule.c for DOS (or Windows)
250system calls.
251
252* Lib.os.py has been reorganized (making it ready for more operating
253systems).
254
255* Lib/ospath.py is now obsolete (use os.path instead).
256
257* Many fixes to the tutorial to make it match Python 1.0. Thanks,
258Tim!
259
260* Fixed Doc/Makefile, Doc/README and various scripts there.
261
262* Added missing description of fdopen to Doc/libposix.tex.
263
264* Made cleanup() global, for the benefit of embedded applications.
265
266* Added parsing of addresses and dates to Lib/rfc822.py.
267
268* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
269them usable at all.
270
271* New module Lib/wave.py reads RIFF (*.wav) audio files.
272
273* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
274belongs.
275
276* New options and comments for Modules/makesetup (used by new
277Extension mechanism).
278
279* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
280and elsewhere.
281
282* Fixed coredump in filter(None, 'abcdefg').
283
284
285=======================================
286==> Release 1.0.0 (26 January 1994) <==
287=======================================
288
289As is traditional, so many things have changed that I can't pretend to
290be complete in these release notes, but I'll try anyway :-)
291
292Note that the very last section is labeled "remaining bugs".
293
294
295Source organization and build process
296-------------------------------------
297
298* The sources have finally been split: instead of a single src
299subdirectory there are now separate directories Include, Parser,
300Grammar, Objects, Python and Modules. Other directories also start
301with a capital letter: Misc, Doc, Lib, Demo.
302
303* A few extensions (notably Amoeba and X support) have been moved to a
304separate subtree Extensions, which is no longer in the core
305distribution, but separately ftp'able as extensions.tar.Z. (The
306distribution contains a placeholder Ext-dummy with a description of
307the Extensions subtree as well as the most recent versions of the
308scripts used there.)
309
310* A few large specialized demos (SGI video and www) have been
311moved to a separate subdirectory Demo2, which is no longer in the core
312distribution, but separately ftp'able as demo2.tar.Z.
313
314* Parts of the standard library have been moved to subdirectories:
315there are now standard subdirectories stdwin, test, sgi and sun4.
316
317* The configuration process has radically changed: I now use GNU
318autoconf. This makes it much easier to build on new Unix flavors, as
319well as fully supporting VPATH (if your Make has it). The scripts
320Configure.py and Addmodule.sh are no longer needed. Many source files
321have been adapted in order to work with the symbols that the configure
322script generated by autoconf defines (or not); the resulting source is
323much more portable to different C compilers and operating systems,
324even non Unix systems (a Mac port was done in an afternoon). See the
325toplevel README file for a description of the new build process.
326
327* GNU readline (a slightly newer version) is now a subdirectory of the
328Python toplevel. It is still not automatically configured (being
329totally autoconf-unaware :-). One problem has been solved: typing
330Control-C to a readline prompt will now work. The distribution no
331longer contains a "super-level" directory (above the python toplevel
332directory), and dl, dl-dld and GNU dld are no longer part of the
333Python distribution (you can still ftp them from
334ftp.cwi.nl:/pub/dynload).
335
336* The DOS functions have been taken out of posixmodule.c and moved
337into a separate file dosmodule.c.
338
339* There's now a separate file version.c which contains nothing but
340the version number.
341
342* The actual main program is now contained in config.c (unless NO_MAIN
343is defined); pythonmain.c now contains a function realmain() which is
344called from config.c's main().
345
346* All files needed to use the built-in module md5 are now contained in
347the distribution. The module has been cleaned up considerably.
348
349
350Documentation
351-------------
352
353* The library manual has been split into many more small latex files,
354so it is easier to edit Doc/lib.tex file to create a custom library
355manual, describing only those modules supported on your system. (This
356is not automated though.)
357
358* A fourth manual has been added, titled "Extending and Embedding the
359Python Interpreter" (Doc/ext.tex), which collects information about
360the interpreter which was previously spread over several files in the
361misc subdirectory.
362
363* The entire documentation is now also available on-line for those who
364have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
365"http://www.cwi.nl/~guido/Python.html".
366
367
368Syntax
369------
370
371* Strings may now be enclosed in double quotes as well as in single
372quotes. There is no difference in interpretation. The repr() of
373string objects will use double quotes if the string contains a single
374quote and no double quotes. Thanks to Amrit Prem for these changes!
375
376* There is a new keyword 'exec'. This replaces the exec() built-in
377function. If a function contains an exec statement, local variable
378optimization is not performed for that particular function, thus
379making assignment to local variables in exec statements less
380confusing. (As a consequence, os.exec and python.exec have been
381renamed to execv.)
382
383* There is a new keyword 'lambda'. An expression of the form
384
385 lambda <parameters> : <expression>
386
387yields an anonymous function. This is really only syntactic sugar;
388you can just as well define a local function using
389
390 def some_temporary_name(<parameters>): return <expression>
391
392Lambda expressions are particularly useful in combination with map(),
393filter() and reduce(), described below. Thanks to Amrit Prem for
394submitting this code (as well as map(), filter(), reduce() and
395xrange())!
396
397
398Built-in functions
399------------------
400
401* The built-in module containing the built-in functions is called
402__builtin__ instead of builtin.
403
404* New built-in functions map(), filter() and reduce() perform standard
405functional programming operations (though not lazily):
406
407- map(f, seq) returns a new sequence whose items are the items from
408seq with f() applied to them.
409
410- filter(f, seq) returns a subsequence of seq consisting of those
411items for which f() is true.
412
413- reduce(f, seq, initial) returns a value computed as follows:
414 acc = initial
415 for item in seq: acc = f(acc, item)
416 return acc
417
418* New function xrange() creates a "range object". Its arguments are
419the same as those of range(), and when used in a for loop a range
420objects also behaves identical. The advantage of xrange() over
421range() is that its representation (if the range contains many
422elements) is much more compact than that of range(). The disadvantage
423is that the result cannot be used to initialize a list object or for
424the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
425architectures, benchmarks have shown that "for i in range(...): ..."
426actually executes *faster* than "for i in xrange(...): ...", but on
427memory starved machines like PCs running DOS range(100000) may be just
428too big to be represented at all...
429
430* Built-in function exec() has been replaced by the exec statement --
431see above.
432
433
434The interpreter
435---------------
436
437* Syntax errors are now not printed to stderr by the parser, but
438rather the offending line and other relevant information are packed up
439in the SyntaxError exception argument. When the main loop catches a
440SyntaxError exception it will print the error in the same format as
441previously, but at the proper position in the stack traceback.
442
443* You can now set a maximum to the number of traceback entries
444printed by assigning to sys.tracebacklimit. The default is 1000.
445
446* The version number in .pyc files has changed yet again.
447
448* It is now possible to have a .pyc file without a corresponding .py
449file. (Warning: this may break existing installations if you have an
450old .pyc file lingering around somewhere on your module search path
451without a corresponding .py file, when there is a .py file for a
452module of the same name further down the path -- the new interpreter
453will find the first .pyc file and complain about it, while the old
454interpreter would ignore it and use the .py file further down.)
455
456* The list sys.builtin_module_names is now sorted and also contains
457the names of a few hardwired built-in modules (sys, __main__ and
458__builtin__).
459
460* A module can now find its own name by accessing the global variable
461__name__. Assigning to this variable essentially renames the module
462(it should also be stored under a different key in sys.modules).
463A neat hack follows from this: a module that wants to execute a main
464program when called as a script no longer needs to compare
465sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
466
467* When an object is printed by the print statement, its implementation
468of str() is used. This means that classes can define __str__(self) to
469direct how their instances are printed. This is different from
470__repr__(self), which should define an unambigous string
471representation of the instance. (If __str__() is not defined, it
472defaults to __repr__().)
473
474* Functions and code objects can now be compared meaningfully.
475
476* On systems supporting SunOS or SVR4 style shared libraries, dynamic
477loading of modules using shared libraries is automatically configured.
478Thanks to Bill Jansen and Denis Severson for contributing this change!
479
480
481Built-in objects
482----------------
483
484* File objects have acquired a new method writelines() which is the
485reverse of readlines(). (It does not actually write lines, just a
486list of strings, but the symmetry makes the choice of name OK.)
487
488
489Built-in modules
490----------------
491
492* Socket objects no longer support the avail() method. Use the select
493module instead, or use this function to replace it:
494
495 def avail(f):
496 import select
497 return f in select.select([f], [], [], 0)[0]
498
499* Initialization of stdwin is done differently. It actually modifies
500sys.argv (taking out the options the X version of stdwin recognizes)
501the first time it is imported.
502
503* A new built-in module parser provides a rudimentary interface to the
504python parser. Corresponding standard library modules token and symbol
505defines the numeric values of tokens and non-terminal symbols.
506
507* The posix module has aquired new functions setuid(), setgid(),
508execve(), and exec() has been renamed to execv().
509
510* The array module is extended with 8-byte object swaps, the 'i'
511format character, and a reverse() method. The read() and write()
512methods are renamed to fromfile() and tofile().
513
514* The rotor module has freed of portability bugs. This introduces a
515backward compatibility problem: strings encoded with the old rotor
516module can't be decoded by the new version.
517
518* For select.select(), a timeout (4th) argument of None means the same
519as leaving the timeout argument out.
520
521* Module strop (and hence standard library module string) has aquired
522a new function: rindex(). Thanks to Amrit Prem!
523
524* Module regex defines a new function symcomp() which uses an extended
525regular expression syntax: parenthesized subexpressions may be labeled
526using the form "\(<labelname>...\)", and the group() method can return
527sub-expressions by name. Thanks to Tracy Tims for these changes!
528
529* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
530Mullender!
531
532
533Standard library modules
534------------------------
535
536* The library is now split in several subdirectories: all stuff using
537stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
538is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
539test modules are in Lib/test. The default module search path will
540include all relevant subdirectories by default.
541
542* Module os now knows about trying to import dos. It defines
543functions execl(), execle(), execlp() and execvp().
544
545* New module dospath (should be attacked by a DOS hacker though).
546
547* All modules defining classes now define __init__() constructors
548instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
549
550* Some minor changes and bugfixes module ftplib (mostly Steve
551Majewski's suggestions); the debug() method is renamed to
552set_debuglevel().
553
554* Some new test modules (not run automatically by testall though):
555test_audioop, test_md5, test_rgbimg, test_select.
556
557* Module string now defines rindex() and rfind() in analogy of index()
558and find(). It also defines atof() and atol() (and corresponding
559exceptions) in analogy to atoi().
560
561* Added help() functions to modules profile and pdb.
562
563* The wdb debugger (now in Lib/stdwin) now shows class or instance
564variables on a double click. Thanks to Sjoerd Mullender!
565
566* The (undocumented) module lambda has gone -- you couldn't import it
567any more, and it was basically more a demo than a library module...
568
569
570Multimedia extensions
571---------------------
572
573* The optional built-in modules audioop and imageop are now standard
574parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
575for contributing this code!
576
577* There's a new operation in audioop: minmax().
578
579* There's a new built-in module called rgbimg which supports portable
580efficient reading of SGI RCG image files. Thanks also to Paul
581Haeberli for the original code! (Who will contribute a GIF reader?)
582
583* The module aifc is gone -- you should now always use aifc, which has
584received a facelift.
585
586* There's a new module sunau., for reading Sun (and NeXT) audio files.
587
588* There's a new module audiodev which provides a uniform interface to
589(SGI Indigo and Sun Sparc) audio hardware.
590
591* There's a new module sndhdr which recognizes various sound files by
592looking in their header and checking for various magic words.
593
594
595Optimizations
596-------------
597
598* Most optimizations below can be configured by compile-time flags.
599Thanks to Sjoerd Mullender for submitting these optimizations!
600
601* Small integers (default -1..99) are shared -- i.e. if two different
602functions compute the same value it is possible (but not
603guaranteed!!!) that they return the same *object*. Python programs
604can detect this but should *never* rely on it.
605
606* Empty tuples (which all compare equal) are shared in the same
607manner.
608
609* Tuples of size up to 20 (default) are put in separate free lists
610when deallocated.
611
612* There is a compile-time option to cache a string's hash function,
613but this appeared to have a negligeable effect, and as it costs 4
614bytes per string it is disabled by default.
615
616
617Embedding Python
618----------------
619
620* The initialization interface has been simplified somewhat. You now
621only call "initall()" to initialize the interpreter.
622
623* The previously announced renaming of externally visible identifiers
624has not been carried out. It will happen in a later release. Sorry.
625
626
627Miscellaneous bugs that have been fixed
628---------------------------------------
629
630* All known portability bugs.
631
632* Version 0.9.9 dumped core in <listobject>.sort() which has been
633fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
634on the mailing list while I was away!
635
636* Core dump on a format string ending in '%', e.g. in the expression
637'%' % None.
638
639* The array module yielded a bogus result for concatenation (a+b would
640yield a+a).
641
642* Some serious memory leaks in strop.split() and strop.splitfields().
643
644* Several problems with the nis module.
645
646* Subtle problem when copying a class method from another class
647through assignment (the method could not be called).
648
649
650Remaining bugs
651--------------
652
653* One problem with 64-bit machines remains -- since .pyc files are
654portable and use only 4 bytes to represent an integer object, 64-bit
655integer literals are silently truncated when written into a .pyc file.
656Work-around: use eval('123456789101112').
657
658* The freeze script doesn't work any more. A new and more portable
659one can probably be cooked up using tricks from Extensions/mkext.py.
660
661* The dos support hasn't been tested yet. (Really Soon Now we should
662have a PC with a working C compiler!)
663
664
Guido van Rossuma7925f11994-01-26 10:20:16 +0000665===================================
666==> Release 0.9.9 (29 Jul 1993) <==
667===================================
668
669I *believe* these are the main user-visible changes in this release,
670but there may be others. SGI users may scan the {src,lib}/ChangeLog
671files for improvements of some SGI specific modules, e.g. aifc and
672cl. Developers of extension modules should also read src/ChangeLog.
673
674
675Naming of C symbols used by the Python interpreter
676--------------------------------------------------
677
678* This is the last release using the current naming conventions. New
679naming conventions are explained in the file misc/NAMING.
680Summarizing, all externally visible symbols get (at least) a "Py"
681prefix, and most functions are renamed to the standard form
682PyModule_FunctionName.
683
684* Writers of extensions are urged to start using the new naming
685conventions. The next release will use the new naming conventions
686throughout (it will also have a different source directory
687structure).
688
689* As a result of the preliminary work for the great renaming, many
690functions that were accidentally global have been made static.
691
692
693BETA X11 support
694----------------
695
696* There are now modules interfacing to the X11 Toolkit Intrinsics, the
697Athena widgets, and the Motif 1.1 widget set. These are not yet
698documented except through the examples and README file in the demo/x11
699directory. It is expected that this interface will be replaced by a
700more powerful and correct one in the future, which may or may not be
701backward compatible. In other words, this part of the code is at most
702BETA level software! (Note: the rest of Python is rock solid as ever!)
703
704* I understand that the above may be a bit of a disappointment,
705however my current schedule does not allow me to change this situation
706before putting the release out of the door. By releasing it
707undocumented and buggy, at least some of the (working!) demo programs,
708like itr (my Internet Talk Radio browser) become available to a larger
709audience.
710
711* There are also modules interfacing to SGI's "Glx" widget (a GL
712window wrapped in a widget) and to NCSA's "HTML" widget (which can
713format HyperText Markup Language, the document format used by the
714World Wide Web).
715
716* I've experienced some problems when building the X11 support. In
717particular, the Xm and Xaw widget sets don't go together, and it
718appears that using X11R5 is better than using X11R4. Also the threads
719module and its link time options may spoil things. My own strategy is
720to build two Python binaries: one for use with X11 and one without
721it, which can contain a richer set of built-in modules. Don't even
722*think* of loading the X11 modules dynamically...
723
724
725Environmental changes
726---------------------
727
728* Compiled files (*.pyc files) created by this Python version are
729incompatible with those created by the previous version. Both
730versions detect this and silently create a correct version, but it
731means that it is not a good idea to use the same library directory for
732an old and a new interpreter, since they will start to "fight" over
733the *.pyc files...
734
735* When a stack trace is printed, the exception is printed last instead
736of first. This means that if the beginning of the stack trace
737scrolled out of your window you can still see what exception caused
738it.
739
740* Sometimes interrupting a Python operation does not work because it
741hangs in a blocking system call. You can now kill the interpreter by
742interrupting it three times. The second time you interrupt it, a
743message will be printed telling you that the third interrupt will kill
744the interpreter. The "sys.exitfunc" feature still makes limited
745clean-up possible in this case.
746
747
748Changes to the command line interface
749-------------------------------------
750
751* The python usage message is now much more informative.
752
753* New option -i enters interactive mode after executing a script --
754useful for debugging.
755
756* New option -k raises an exception when an expression statement
757yields a value other than None.
758
759* For each option there is now also a corresponding environment
760variable.
761
762
763Using Python as an embedded language
764------------------------------------
765
766* The distribution now contains (some) documentation on the use of
767Python as an "embedded language" in other applications, as well as a
768simple example. See the file misc/EMBEDDING and the directory embed/.
769
770
771Speed improvements
772------------------
773
774* Function local variables are now generally stored in an array and
775accessed using an integer indexing operation, instead of through a
776dictionary lookup. (This compensates the somewhat slower dictionary
777lookup caused by the generalization of the dictionary module.)
778
779
780Changes to the syntax
781---------------------
782
783* Continuation lines can now *sometimes* be written without a
784backslash: if the continuation is contained within nesting (), [] or
785{} brackets the \ may be omitted. There's a much improved
786python-mode.el in the misc directory which knows about this as well.
787
788* You can no longer use an empty set of parentheses to define a class
789without base classes. That is, you no longer write this:
790
791 class Foo(): # syntax error
792 ...
793
794You must write this instead:
795
796 class Foo:
797 ...
798
799This was already the preferred syntax in release 0.9.8 but many
800people seemed not to have picked it up. There's a Python script that
801fixes old code: demo/scripts/classfix.py.
802
803* There's a new reserved word: "access". The syntax and semantics are
804still subject of of research and debate (as well as undocumented), but
805the parser knows about the keyword so you must not use it as a
806variable, function, or attribute name.
807
808
809Changes to the semantics of the language proper
810-----------------------------------------------
811
812* The following compatibility hack is removed: if a function was
813defined with two or more arguments, and called with a single argument
814that was a tuple with just as many arguments, the items of this tuple
815would be used as the arguments. This is no longer supported.
816
817
818Changes to the semantics of classes and instances
819-------------------------------------------------
820
821* Class variables are now also accessible as instance variables for
822reading (assignment creates an instance variable which overrides the
823class variable of the same name though).
824
825* If a class attribute is a user-defined function, a new kind of
826object is returned: an "unbound method". This contains a pointer to
827the class and can only be called with a first argument which is a
828member of that class (or a derived class).
829
830* If a class defines a method __init__(self, arg1, ...) then this
831method is called when a class instance is created by the classname()
832construct. Arguments passed to classname() are passed to the
833__init__() method. The __init__() methods of base classes are not
834automatically called; the derived __init__() method must call these if
835necessary (this was done so the derived __init__() method can choose
836the call order and arguments for the base __init__() methods).
837
838* If a class defines a method __del__(self) then this method is called
839when an instance of the class is about to be destroyed. This makes it
840possible to implement clean-up of external resources attached to the
841instance. As with __init__(), the __del__() methods of base classes
842are not automatically called. If __del__ manages to store a reference
843to the object somewhere, its destruction is postponed; when the object
844is again about to be destroyed its __del__() method will be called
845again.
846
847* Classes may define a method __hash__(self) to allow their instances
848to be used as dictionary keys. This must return a 32-bit integer.
849
850
851Minor improvements
852------------------
853
854* Function and class objects now know their name (the name given in
855the 'def' or 'class' statement that created them).
856
857* Class instances now know their class name.
858
859
860Additions to built-in operations
861--------------------------------
862
863* The % operator with a string left argument implements formatting
864similar to sprintf() in C. The right argument is either a single
865value or a tuple of values. All features of Standard C sprintf() are
866supported except %p.
867
868* Dictionaries now support almost any key type, instead of just
869strings. (The key type must be an immutable type or must be a class
870instance where the class defines a method __hash__(), in order to
871avoid losing track of keys whose value may change.)
872
873* Built-in methods are now compared properly: when comparing x.meth1
874and y.meth2, if x is equal to y and the methods are defined by the
875same function, x.meth1 compares equal to y.meth2.
876
877
878Additions to built-in functions
879-------------------------------
880
881* str(x) returns a string version of its argument. If the argument is
882a string it is returned unchanged, otherwise it returns `x`.
883
884* repr(x) returns the same as `x`. (Some users found it easier to
885have this as a function.)
886
887* round(x) returns the floating point number x rounded to an whole
888number, represented as a floating point number. round(x, n) returns x
889rounded to n digits.
890
891* hasattr(x, name) returns true when x has an attribute with the given
892name.
893
894* hash(x) returns a hash code (32-bit integer) of an arbitrary
895immutable object's value.
896
897* id(x) returns a unique identifier (32-bit integer) of an arbitrary
898object.
899
900* compile() compiles a string to a Python code object.
901
902* exec() and eval() now support execution of code objects.
903
904
905Changes to the documented part of the library (standard modules)
906----------------------------------------------------------------
907
908* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
909the border case '/foo/..' returns '/' instead of ''.
910
911* A new function string.find() is added with similar semantics to
912string.index(); however when it does not find the given substring it
913returns -1 instead of raising string.index_error.
914
915
916Changes to built-in modules
917---------------------------
918
919* New optional module 'array' implements operations on sequences of
920integers or floating point numbers of a particular size. This is
921useful to manipulate large numerical arrays or to read and write
922binary files consisting of numerical data.
923
924* Regular expression objects created by module regex now support a new
925method named group(), which returns one or more \(...\) groups by number.
926The number of groups is increased from 10 to 100.
927
928* Function compile() in module regex now supports an optional mapping
929argument; a variable casefold is added to the module which can be used
930as a standard uppercase to lowercase mapping.
931
932* Module time now supports many routines that are defined in the
933Standard C time interface (<time.h>): gmtime(), localtime(),
934asctime(), ctime(), mktime(), as well as these variables (taken from
935System V): timezone, altzone, daylight and tzname. (The corresponding
936functions in the undocumented module calendar have been removed; the
937undocumented and unfinished module tzparse is now obsolete and will
938disappear in a future release.)
939
940* Module strop (the fast built-in version of standard module string)
941now uses C's definition of whitespace instead of fixing it to space,
942tab and newline; in practice this usually means that vertical tab,
943form feed and return are now also considered whitespace. It exports
944the string of characters that are considered whitespace as well as the
945characters that are considered lowercase or uppercase.
946
947* Module sys now defines the variable builtin_module_names, a list of
948names of modules built into the current interpreter (including not
949yet imported, but excluding two special modules that always have to be
950defined -- sys and builtin).
951
952* Objects created by module sunaudiodev now also support flush() and
953close() methods.
954
955* Socket objects created by module socket now support an optional
956flags argument for their methods sendto() and recvfrom().
957
958* Module marshal now supports dumping to and loading from strings,
959through the functions dumps() and loads().
960
961* Module stdwin now supports some new functionality. You may have to
962ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
963
964
965Bugs fixed
966----------
967
968* Fixed comparison of negative long integers.
969
970* The tokenizer no longer botches input lines longer than BUFSIZ.
971
972* Fixed several severe memory leaks in module select.
973
974* Fixed memory leaks in modules socket and sv.
975
976* Fixed memory leak in divmod() for long integers.
977
978* Problems with definition of floatsleep() on Suns fixed.
979
980* Many portability bugs fixed (and undoubtedly new ones added :-).
981
982
983Changes to the build procedure
984------------------------------
985
986* The Makefile supports some new targets: "make default" and "make
987all". Both are by normally equivalent to "make python".
988
989* The Makefile no longer uses $> since it's not supported by all
990versions of Make.
991
992* The header files now all contain #ifdef constructs designed to make
993it safe to include the same header file twice, as well as support for
994inclusion from C++ programs (automatic extern "C" { ... } added).
995
996
997Freezing Python scripts
998-----------------------
999
1000* There is now some support for "freezing" a Python script as a
1001stand-alone executable binary file. See the script
1002demo/scripts/freeze.py. It will require some site-specific tailoring
1003of the script to get this working, but is quite worthwhile if you write
1004Python code for other who may not have built and installed Python.
1005
1006
1007MS-DOS
1008------
1009
1010* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
1011Marcel van der Peijl! This requires fewer compatibility hacks in
1012posixmodule.c. The executable is not yet available but will be soon
1013(check the mailing list).
1014
1015* The default PYTHONPATH has changed.
1016
1017
1018Changes for developers of extension modules
1019-------------------------------------------
1020
1021* Read src/ChangeLog for full details.
1022
1023
1024SGI specific changes
1025--------------------
1026
1027* Read src/ChangeLog for full details.
1028
Guido van Rossumaa253861994-10-06 17:18:57 +00001029
Guido van Rossuma7925f11994-01-26 10:20:16 +00001030==================================
1031==> Release 0.9.8 (9 Jan 1993) <==
1032==================================
1033
1034I claim no completeness here, but I've tried my best to scan the log
1035files throughout my source tree for interesting bits of news. A more
1036complete account of the changes is to be found in the various
1037ChangeLog files. See also "News for release 0.9.7beta" below if you're
1038still using release 0.9.6, and the file HISTORY if you have an even
1039older release.
1040
1041 --Guido
1042
1043
1044Changes to the language proper
1045------------------------------
1046
1047There's only one big change: the conformance checking for function
1048argument lists (of user-defined functions only) is stricter. Earlier,
1049you could get away with the following:
1050
1051 (a) define a function of one argument and call it with any
1052 number of arguments; if the actual argument count wasn't
1053 one, the function would receive a tuple containing the
1054 arguments arguments (an empty tuple if there were none).
1055
1056 (b) define a function of two arguments, and call it with more
1057 than two arguments; if there were more than two arguments,
1058 the second argument would be passed as a tuple containing
1059 the second and further actual arguments.
1060
1061(Note that an argument (formal or actual) that is a tuple is counted as
1062one; these rules don't apply inside such tuples, only at the top level
1063of the argument list.)
1064
1065Case (a) was needed to accommodate variable-length argument lists;
1066there is now an explicit "varargs" feature (precede the last argument
1067with a '*'). Case (b) was needed for compatibility with old class
1068definitions: up to release 0.9.4 a method with more than one argument
1069had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
1070Version 0.9.6 provide better ways to handle both casees, bot provided
1071backward compatibility; version 0.9.8 retracts the compatibility hacks
1072since they also cause confusing behavior if a function is called with
1073the wrong number of arguments.
1074
1075There's a script that helps converting classes that still rely on (b),
1076provided their methods' first argument is called "self":
1077demo/scripts/methfix.py.
1078
1079If this change breaks lots of code you have developed locally, try
1080#defining COMPAT_HACKS in ceval.c.
1081
1082(There's a third compatibility hack, which is the reverse of (a): if a
1083function is defined with two or more arguments, and called with a
1084single argument that is a tuple with just as many arguments, the items
1085of this tuple will be used as the arguments. Although this can (and
1086should!) be done using the built-in function apply() instead, it isn't
1087withdrawn yet.)
1088
1089
1090One minor change: comparing instance methods works like expected, so
1091that if x is an instance of a user-defined class and has a method m,
1092then (x.m==x.m) yields 1.
1093
1094
1095The following was already present in 0.9.7beta, but not explicitly
1096mentioned in the NEWS file: user-defined classes can now define types
1097that behave in almost allrespects like numbers. See
1098demo/classes/Rat.py for a simple example.
1099
1100
1101Changes to the build process
1102----------------------------
1103
1104The Configure.py script and the Makefile has been made somewhat more
1105bullet-proof, after reports of (minor) trouble on certain platforms.
1106
1107There is now a script to patch Makefile and config.c to add a new
1108optional built-in module: Addmodule.sh. Read the script before using!
1109
1110Useing Addmodule.sh, all optional modules can now be configured at
1111compile time using Configure.py, so there are no modules left that
1112require dynamic loading.
1113
1114The Makefile has been fixed to make it easier to use with the VPATH
1115feature of some Make versions (e.g. SunOS).
1116
1117
1118Changes affecting portability
1119-----------------------------
1120
1121Several minor portability problems have been solved, e.g. "malloc.h"
1122has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
1123the system now tolerates malloc(0) returning 0.
1124
1125For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
1126distributed with Python. This solves several minor problems, in
1127particular scripts invoked using #! can now use dynamic loading.
1128
1129
1130Changes to the interpreter interface
1131------------------------------------
1132
1133On popular demand, there's finally a "profile" feature for interactive
1134use of the interpreter. If the environment variable $PYTHONSTARTUP is
1135set to the name of an existing file, Python statements in this file
1136are executed when the interpreter is started in interactive mode.
1137
1138There is a new clean-up mechanism, complementing try...finally: if you
1139assign a function object to sys.exitfunc, it will be called when
1140Python exits or receives a SIGTERM or SIGHUP signal.
1141
1142The interpreter is now generally assumed to live in
1143/usr/local/bin/python (as opposed to /usr/local/python). The script
1144demo/scripts/fixps.py will update old scripts in place (you can easily
1145modify it to do other similar changes).
1146
1147Most I/O that uses sys.stdin/stdout/stderr will now use any object
1148assigned to those names as long as the object supports readline() or
1149write() methods.
1150
1151The parser stack has been increased to 500 to accommodate more
1152complicated expressions (7 levels used to be the practical maximum,
1153it's now about 38).
1154
1155The limit on the size of the *run-time* stack has completely been
1156removed -- this means that tuple or list displays can contain any
1157number of elements (formerly more than 50 would crash the
1158interpreter).
1159
1160
1161Changes to existing built-in functions and methods
1162--------------------------------------------------
1163
1164The built-in functions int(), long(), float(), oct() and hex() now
1165also apply to class instalces that define corresponding methods
1166(__int__ etc.).
1167
1168
1169New built-in functions
1170----------------------
1171
1172The new functions str() and repr() convert any object to a string.
1173The function repr(x) is in all respects equivalent to `x` -- some
1174people prefer a function for this. The function str(x) does the same
1175except if x is already a string -- then it returns x unchanged
1176(repr(x) adds quotes and escapes "funny" characters as octal escapes).
1177
1178The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
1179
1180
1181Changes to general built-in modules
1182-----------------------------------
1183
1184The time module's functions are more general: time() returns a
1185floating point number and sleep() accepts one. Their accuracies
1186depends on the precision of the system clock. Millisleep is no longer
1187needed (although it still exists for now), but millitimer is still
1188needed since on some systems wall clock time is only available with
1189seconds precision, while a source of more precise time exists that
1190isn't synchronized with the wall clock. (On UNIX systems that support
1191the BSD gettimeofday() function, time.time() is as time.millitimer().)
1192
1193The string representation of a file object now includes an address:
1194'<file 'filename', mode 'r' at #######>' where ###### is a hex number
1195(the object's address) to make it unique.
1196
1197New functions added to posix: nice(), setpgrp(), and if your system
1198supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
1199
1200Improvements to the socket module: socket objects have new methods
1201getpeername() and getsockname(), and the {get,set}sockopt methods can
1202now get/set any kind of option using strings built with the new struct
1203module. And there's a new function fromfd() which creates a socket
1204object given a file descriptor (useful for servers started by inetd,
1205which have a socket connected to stdin and stdout).
1206
1207
1208Changes to SGI-specific built-in modules
1209----------------------------------------
1210
1211The FORMS library interface (fl) now requires FORMS 2.1a. Some new
1212functions have been added and some bugs have been fixed.
1213
1214Additions to al (audio library interface): added getname(),
1215getdefault() and getminmax().
1216
1217The gl modules doesn't call "foreground()" when initialized (this
1218caused some problems) like it dit in 0.9.7beta (but not before).
1219There's a new gl function 'gversion() which returns a version string.
1220
1221The interface to sv (Indigo video interface) has totally changed.
1222(Sorry, still no documentation, but see the examples in
1223demo/sgi/{sv,video}.)
1224
1225
1226Changes to standard library modules
1227-----------------------------------
1228
1229Most functions in module string are now much faster: they're actually
1230implemented in C. The module containing the C versions is called
1231"strop" but you should still import "string" since strop doesn't
1232provide all the interfaces defined in string (and strop may be renamed
1233to string when it is complete in a future release).
1234
1235string.index() now accepts an optional third argument giving an index
1236where to start searching in the first argument, so you can find second
1237and further occurrences (this is similar to the regular expression
1238functions in regex).
1239
1240The definition of what string.splitfields(anything, '') should return
1241is changed for the last time: it returns a singleton list containing
1242its whole first argument unchanged. This is compatible with
1243regsub.split() which also ignores empty delimiter matches.
1244
1245posixpath, macpath: added dirname() and normpath() (and basename() to
1246macpath).
1247
1248The mainloop module (for use with stdwin) can now demultiplex input
1249from other sources, as long as they can be polled with select().
1250
1251
1252New built-in modules
1253--------------------
1254
1255Module struct defines functions to pack/unpack values to/from strings
1256representing binary values in native byte order.
1257
1258Module strop implements C versions of many functions from string (see
1259above).
1260
1261Optional module fcntl defines interfaces to fcntl() and ioctl() --
1262UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
1263
1264Optional module mpz defines an interface to an altaernative long
1265integer implementation, the GNU MPZ library.
1266
1267Optional module md5 uses the GNU MPZ library to calculate MD5
1268signatures of strings.
1269
1270There are also optional new modules specific to SGI machines: imageop
1271defines some simple operations to images represented as strings; sv
1272interfaces to the Indigo video board; cl interfaces to the (yet
1273unreleased) compression library.
1274
1275
1276New standard library modules
1277----------------------------
1278
1279(Unfortunately the following modules are not all documented; read the
1280sources to find out more about them!)
1281
1282autotest: run testall without showing any output unless it differs
1283from the expected output
1284
1285bisect: use bisection to insert or find an item in a sorted list
1286
1287colorsys: defines conversions between various color systems (e.g. RGB
1288<-> YUV)
1289
1290nntplib: a client interface to NNTP servers
1291
1292pipes: utility to construct pipeline from templates, e.g. for
1293conversion from one file format to another using several utilities.
1294
1295regsub: contains three functions that are more or less compatible with
1296awk functions of the same name: sub() and gsub() do string
1297substitution, split() splits a string using a regular expression to
1298define how separators are define.
1299
1300test_types: test operations on the built-in types of Python
1301
1302toaiff: convert various audio file formats to AIFF format
1303
1304tzparse: parse the TZ environment parameter (this may be less general
1305than it could be, let me know if you fix it).
1306
1307(Note that the obsolete module "path" no longer exists.)
1308
1309
1310New SGI-specific library modules
1311--------------------------------
1312
1313CL: constants for use with the built-in compression library interface (cl)
1314
1315Queue: a multi-producer, multi-consumer queue class implemented for
1316use with the built-in thread module
1317
1318SOCKET: constants for use with built-in module socket, e.g. to set/get
1319socket options. This is SGI-specific because the constants to be
1320passed are system-dependent. You can generate a version for your own
1321system by running the script demo/scripts/h2py.py with
1322/usr/include/sys/socket.h as input.
1323
1324cddb: interface to the database used the the CD player
1325
1326torgb: convert various image file types to rgb format (requires pbmplus)
1327
1328
1329New demos
1330---------
1331
1332There's an experimental interface to define Sun RPC clients and
1333servers in demo/rpc.
1334
1335There's a collection of interfaces to WWW, WAIS and Gopher (both
1336Python classes and program providing a user interface) in demo/www.
1337This includes a program texi2html.py which converts texinfo files to
1338HTML files (the format used hy WWW).
1339
1340The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
1341
1342For SGI systems, there's a whole collection of programs and classes
1343that make use of the Indigo video board in demo/sgi/{sv,video}. This
1344represents a significant amount of work that we're giving away!
1345
1346There are demos "rsa" and "md5test" that exercise the mpz and md5
1347modules, respectively. The rsa demo is a complete implementation of
1348the RSA public-key cryptosystem!
1349
1350A bunch of games and examples submitted by Stoffel Erasmus have been
1351included in demo/stoffel.
1352
1353There are miscellaneous new files in some existing demo
1354subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
1355sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
1356
1357There are also many minor changes to existing files, but I'm too lazy
1358to run a diff and note the differences -- you can do this yourself if
1359you save the old distribution's demos. One highlight: the
1360stdwin/python.py demo is much improved!
1361
1362
1363Changes to the documentation
1364----------------------------
1365
1366The LaTeX source for the library uses different macros to enable it to
1367be converted to texinfo, and from there to INFO or HTML format so it
1368can be browsed as a hypertext. The net result is that you can now
1369read the Python library documentation in Emacs info mode!
1370
1371
1372Changes to the source code that affect C extension writers
1373----------------------------------------------------------
1374
1375The function strdup() no longer exists (it was used only in one places
1376and is somewhat of a a portability problem sice some systems have the
1377same function in their C library.
1378
1379The functions NEW() and RENEW() allocate one spare byte to guard
1380against a NULL return from malloc(0) being taken for an error, but
1381this should not be relied upon.
1382
1383
1384=========================
1385==> Release 0.9.7beta <==
1386=========================
1387
1388
1389Changes to the language proper
1390------------------------------
1391
1392User-defined classes can now implement operations invoked through
1393special syntax, such as x[i] or `x` by defining methods named
1394__getitem__(self, i) or __repr__(self), etc.
1395
1396
1397Changes to the build process
1398----------------------------
1399
1400Instead of extensive manual editing of the Makefile to select
1401compile-time options, you can now run a Configure.py script.
1402The Makefile as distributed builds a minimal interpreter sufficient to
1403run Configure.py. See also misc/BUILD
1404
1405The Makefile now includes more "utility" targets, e.g. install and
1406tags/TAGS
1407
1408Using the provided strtod.c and strtol.c are now separate options, as
1409on the Sun the provided strtod.c dumps core :-(
1410
1411The regex module is now an option chosen by the Makefile, since some
1412(old) C compilers choke on regexpr.c
1413
1414
1415Changes affecting portability
1416-----------------------------
1417
1418You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
1419interface
1420
1421Dynamic loading is now supported for Sun (and other non-COFF systems)
1422throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
1423DL is out, 1.4)
1424
1425The system-dependent code for the use of the select() system call is
1426moved to one file: myselect.h
1427
1428Thanks to Jaap Vermeulen, the code should now port cleanly to the
1429SEQUENT
1430
1431
1432Changes to the interpreter interface
1433------------------------------------
1434
1435The interpretation of $PYTHONPATH in the environment is different: it
1436is inserted in front of the default path instead of overriding it
1437
1438
1439Changes to existing built-in functions and methods
1440--------------------------------------------------
1441
1442List objects now support an optional argument to their sort() method,
1443which is a comparison function similar to qsort(3) in C
1444
1445File objects now have a method fileno(), used by the new select module
1446(see below)
1447
1448
1449New built-in function
1450---------------------
1451
1452coerce(x, y): take two numbers and return a tuple containing them
1453both converted to a common type
1454
1455
1456Changes to built-in modules
1457---------------------------
1458
1459sys: fixed core dumps in settrace() and setprofile()
1460
1461socket: added socket methods setsockopt() and getsockopt(); and
1462fileno(), used by the new select module (see below)
1463
1464stdwin: added fileno() == connectionnumber(), in support of new module
1465select (see below)
1466
1467posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
1468
1469gl: added qgetfd()
1470
1471fl: added several new functions, fixed several obscure bugs, adapted
1472to FORMS 2.1
1473
1474
1475Changes to standard modules
1476---------------------------
1477
1478posixpath: changed implementation of ismount()
1479
1480string: atoi() no longer mistakes leading zero for octal number
1481
1482...
1483
1484
1485New built-in modules
1486--------------------
1487
1488Modules marked "dynamic only" are not configured at compile time but
1489can be loaded dynamically. You need to turn on the DL or DLD option in
1490the Makefile for support dynamic loading of modules (this requires
1491external code).
1492
1493select: interfaces to the BSD select() system call
1494
1495dbm: interfaces to the (new) dbm library (dynamic only)
1496
1497nis: interfaces to some NIS functions (aka yellow pages)
1498
1499thread: limited form of multiple threads (sgi only)
1500
1501audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
1502coding (dynamic only)
1503
1504cd: interface to Indigo SCSI CDROM player audio library (sgi only)
1505
1506jpeg: read files in JPEG format (dynamic only, sgi only; needs
1507external code)
1508
1509imgfile: read SGI image files (dynamic only, sgi only)
1510
1511sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
1512
1513sv: interface to Indigo video library (sgi only)
1514
1515pc: a minimal set of MS-DOS interfaces (MS-DOS only)
1516
1517rotor: encryption, by Lance Ellinghouse (dynamic only)
1518
1519
1520New standard modules
1521--------------------
1522
1523Not all these modules are documented. Read the source:
1524lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
1525additional documentation.
1526
1527imghdr: recognizes image file headers
1528
1529sndhdr: recognizes sound file headers
1530
1531profile: print run-time statistics of Python code
1532
1533readcd, cdplayer: companion modules for built-in module cd (sgi only)
1534
1535emacs: interface to Emacs using py-connect.el (see below).
1536
1537SOCKET: symbolic constant definitions for socket options
1538
1539SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
1540
1541SV: symbolic constat definitions for sv (sgi only)
1542
1543CD: symbolic constat definitions for cd (sgi only)
1544
1545
1546New demos
1547---------
1548
1549scripts/pp.py: execute Python as a filter with a Perl-like command
1550line interface
1551
1552classes/: examples using the new class features
1553
1554threads/: examples using the new thread module
1555
1556sgi/cd/: examples using the new cd module
1557
1558
1559Changes to the documentation
1560----------------------------
1561
1562The last-minute syntax changes of release 0.9.6 are now reflected
1563everywhere in the manuals
1564
1565The reference manual has a new section (3.2) on implementing new kinds
1566of numbers, sequences or mappings with user classes
1567
1568Classes are now treated extensively in the tutorial (chapter 9)
1569
1570Slightly restructured the system-dependent chapters of the library
1571manual
1572
1573The file misc/EXTENDING incorporates documentation for mkvalue() and
1574a new section on error handling
1575
1576The files misc/CLASSES and misc/ERRORS are no longer necessary
1577
1578The doc/Makefile now creates PostScript files automatically
1579
1580
1581Miscellaneous changes
1582---------------------
1583
1584Incorporated Tim Peters' changes to python-mode.el, it's now version
15851.06
1586
1587A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
1588program running in an Emacs buffer execute Emacs lisp code. The
1589necessary Python code is in lib/emacs.py. The Emacs code is
1590misc/py-connect.el (it needs some external Emacs lisp code)
1591
1592
1593Changes to the source code that affect C extension writers
1594----------------------------------------------------------
1595
1596New service function mkvalue() to construct a Python object from C
1597values according to a "format" string a la getargs()
1598
1599Most functions from pythonmain.c moved to new pythonrun.c which is
1600in libpython.a. This should make embedded versions of Python easier
1601
1602ceval.h is split in eval.h (which needs compile.h and only declares
1603eval_code) and ceval.h (which doesn't need compile.hand declares the
1604rest)
1605
1606ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
1607improve the parallellism of multi-threaded programs by letting other
1608Python code run when a blocking system call or something similar is
1609made)
1610
1611In structmember.[ch], new member types BYTE, CHAR and unsigned
1612variants have been added
1613
1614New file xxmodule.c is a template for new extension modules.
1615
Guido van Rossumaa253861994-10-06 17:18:57 +00001616
Guido van Rossuma7925f11994-01-26 10:20:16 +00001617==================================
1618==> RELEASE 0.9.6 (6 Apr 1992) <==
1619==================================
1620
1621Misc news in 0.9.6:
1622- Restructured the misc subdirectory
1623- Reference manual completed, library manual much extended (with indexes!)
1624- the GNU Readline library is now distributed standard with Python
1625- the script "../demo/scripts/classfix.py" fixes Python modules using old
1626 class syntax
1627- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
1628- Because of the GNU copyleft business I am not using the GNU regular
1629 expression implementation but a free re-implementation by Tatu Ylonen
1630 that recently appeared in comp.sources.misc (Bravo, Tatu!)
1631
1632New features in 0.9.6:
1633- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
1634- New module 'os' supplants modules 'mac' and 'posix' for most cases;
1635 module 'path' is replaced by 'os.path'
1636- os.path.split() return value differs from that of old path.split()
1637- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
1638 currently being handled
1639- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
1640 exception
1641- New function string.expandtabs() expands tabs in a string
1642- Added times() interface to posix (user & sys time of process & children)
1643- Added uname() interface to posix (returns OS type, hostname, etc.)
1644- New built-in function execfile() is like exec() but from a file
1645- Functions exec() and eval() are less picky about whitespace/newlines
1646- New built-in functions getattr() and setattr() access arbitrary attributes
1647- More generic argument handling in built-in functions (see "./EXTENDING")
1648- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
1649- Division and modulo for long and plain integers with negative operands
1650 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
1651 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
1652 (a/b, a%b) for integers. For floats, % is also changed, but of course
1653 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
1654- A function with explicit variable-length argument list can be declared
1655 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
1656- Code tracing and profiling features have been added, and two source
1657 code debuggers are provided in the library (pdb.py, tty-oriented,
1658 and wdb, window-oriented); you can now step through Python programs!
1659 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
1660- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
1661 a script that fixes old Python modules
1662- Plain integer right shift now uses sign extension
1663- Long integer shift/mask operations now simulate 2's complement
1664 to give more useful results for negative operands
1665- Changed/added range checks for long/plain integer shifts
1666- Options found after "-c command" are now passed to the command in sys.argv
1667 (note subtle incompatiblity with "python -c command -- -options"!)
1668- Module stdwin is better protected against touching objects after they've
1669 been closed; menus can now also be closed explicitly
1670- Stdwin now uses its own exception (stdwin.error)
1671
1672New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
1673- dictionary objects can now be compared properly; e.g., {}=={} is true
1674- new exception SystemExit causes termination if not caught;
1675 it is raised by sys.exit() so that 'finally' clauses can clean up,
1676 and it may even be caught. It does work interactively!
1677- new module "regex" implements GNU Emacs style regular expressions;
1678 module "regexp" is rewritten in Python for backward compatibility
1679- formal parameter lists may contain trailing commas
1680
1681Bugs fixed in 0.9.6:
1682- assigning to or deleting a list item with a negative index dumped core
1683- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
1684
1685Bugs fixed in 0.9.5:
1686- masking operations involving negative long integers gave wrong results
1687
1688
1689===================================
1690==> RELEASE 0.9.4 (24 Dec 1991) <==
1691===================================
1692
1693- new function argument handling (see below)
1694- built-in apply(func, args) means func(args[0], args[1], ...)
1695- new, more refined exceptions
1696- new exception string values (NameError = 'NameError' etc.)
1697- better checking for math exceptions
1698- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
1699- fixed list assignment bug: "a[1:1] = a" now works correctly
1700- new class syntax, without extraneous parentheses
1701- new 'global' statement to assign global variables from within a function
1702
1703
1704New class syntax
1705----------------
1706
1707You can now declare a base class as follows:
1708
1709 class B: # Was: class B():
1710 def some_method(self): ...
1711 ...
1712
1713and a derived class thusly:
1714
1715 class D(B): # Was: class D() = B():
1716 def another_method(self, arg): ...
1717
1718Multiple inheritance looks like this:
1719
1720 class M(B, D): # Was: class M() = B(), D():
1721 def this_or_that_method(self, arg): ...
1722
1723The old syntax is still accepted by Python 0.9.4, but will disappear
1724in Python 1.0 (to be posted to comp.sources).
1725
1726
1727New 'global' statement
1728----------------------
1729
1730Every now and then you have a global variable in a module that you
1731want to change from within a function in that module -- say, a count
1732of calls to a function, or an option flag, etc. Until now this was
1733not directly possible. While several kludges are known that
1734circumvent the problem, and often the need for a global variable can
1735be avoided by rewriting the module as a class, this does not always
1736lead to clearer code.
1737
1738The 'global' statement solves this dilemma. Its occurrence in a
1739function body means that, for the duration of that function, the
1740names listed there refer to global variables. For instance:
1741
1742 total = 0.0
1743 count = 0
1744
1745 def add_to_total(amount):
1746 global total, count
1747 total = total + amount
1748 count = count + 1
1749
1750'global' must be repeated in each function where it is needed. The
1751names listed in a 'global' statement must not be used in the function
1752before the statement is reached.
1753
1754Remember that you don't need to use 'global' if you only want to *use*
1755a global variable in a function; nor do you need ot for assignments to
1756parts of global variables (e.g., list or dictionary items or
1757attributes of class instances). This has not changed; in fact
1758assignment to part of a global variable was the standard workaround.
1759
1760
1761New exceptions
1762--------------
1763
1764Several new exceptions have been defined, to distinguish more clearly
1765between different types of errors.
1766
1767name meaning was
1768
1769AttributeError reference to non-existing attribute NameError
1770IOError unexpected I/O error RuntimeError
1771ImportError import of non-existing module or name NameError
1772IndexError invalid string, tuple or list index RuntimeError
1773KeyError key not in dictionary RuntimeError
1774OverflowError numeric overflow RuntimeError
1775SyntaxError invalid syntax RuntimeError
1776ValueError invalid argument value RuntimeError
1777ZeroDivisionError division by zero RuntimeError
1778
1779The string value of each exception is now its name -- this makes it
1780easier to experimentally find out which operations raise which
1781exceptions; e.g.:
1782
1783 >>> KeyboardInterrupt
1784 'KeyboardInterrupt'
1785 >>>
1786
1787
1788New argument passing semantics
1789------------------------------
1790
1791Off-line discussions with Steve Majewski and Daniel LaLiberte have
1792convinced me that Python's parameter mechanism could be changed in a
1793way that made both of them happy (I hope), kept me happy, fixed a
1794number of outstanding problems, and, given some backward compatibility
1795provisions, would only break a very small amount of existing code --
1796probably all mine anyway. In fact I suspect that most Python users
1797will hardly notice the difference. And yet it has cost me at least
1798one sleepless night to decide to make the change...
1799
1800Philosophically, the change is quite radical (to me, anyway): a
1801function is no longer called with either zero or one argument, which
1802is a tuple if there appear to be more arguments. Every function now
1803has an argument list containing 0, 1 or more arguments. This list is
1804always implemented as a tuple, and it is a (run-time) error if a
1805function is called with a different number of arguments than expected.
1806
1807What's the difference? you may ask. The answer is, very little unless
1808you want to write variadic functions -- functions that may be called
1809with a variable number of arguments. Formerly, you could write a
1810function that accepted one or more arguments with little trouble, but
1811writing a function that could be called with either 0 or 1 argument
1812(or more) was next to impossible. This is now a piece of cake: you
1813can simply declare an argument that receives the entire argument
1814tuple, and check its length -- it will be of size 0 if there are no
1815arguments.
1816
1817Another anomaly of the old system was the way multi-argument methods
1818(in classes) had to be declared, e.g.:
1819
1820 class Point():
1821 def init(self, (x, y, color)): ...
1822 def setcolor(self, color): ...
1823 dev moveto(self, (x, y)): ...
1824 def draw(self): ...
1825
1826Using the new scheme there is no need to enclose the method arguments
1827in an extra set of parentheses, so the above class could become:
1828
1829 class Point:
1830 def init(self, x, y, color): ...
1831 def setcolor(self, color): ...
1832 dev moveto(self, x, y): ...
1833 def draw(self): ...
1834
1835That is, the equivalence rule between methods and functions has
1836changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
1837while formerly it was equivalent to Point.moveto(p,(x,y)).
1838
1839A special backward compatibility rule makes that the old version also
1840still works: whenever a function with exactly two arguments (at the top
1841level) is called with more than two arguments, the second and further
1842arguments are packed into a tuple and passed as the second argument.
1843This rule is invoked independently of whether the function is actually a
1844method, so there is a slight chance that some erroneous calls of
1845functions expecting two arguments with more than that number of
1846arguments go undetected at first -- when the function tries to use the
1847second argument it may find it is a tuple instead of what was expected.
1848Note that this rule will be removed from future versions of the
1849language; it is a backward compatibility provision *only*.
1850
1851Two other rules and a new built-in function handle conversion between
1852tuples and argument lists:
1853
1854Rule (a): when a function with more than one argument is called with a
1855single argument that is a tuple of the right size, the tuple's items
1856are used as arguments.
1857
1858Rule (b): when a function with exactly one argument receives no
1859arguments or more than one, that one argument will receive a tuple
1860containing the arguments (the tuple will be empty if there were no
1861arguments).
1862
1863
1864A new built-in function, apply(), was added to support functions that
1865need to call other functions with a constructed argument list. The call
1866
1867 apply(function, tuple)
1868
1869is equivalent to
1870
1871 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
1872
1873
1874While no new argument syntax was added in this phase, it would now be
1875quite sensible to add explicit syntax to Python for default argument
1876values (as in C++ or Modula-3), or a "rest" argument to receive the
1877remaining arguments of a variable-length argument list.
1878
1879
1880========================================================
1881==> Release 0.9.3 (never made available outside CWI) <==
1882========================================================
1883
1884- string sys.version shows current version (also printed on interactive entry)
1885- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
1886- 'global' statement to declare module-global variables assigned in functions.
1887- new class declaration syntax: class C(Base1, Base2, ...): suite
1888 (the old syntax is still accepted -- be sure to convert your classes now!)
1889- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
1890- C comparison operators: == != (the old = and <> remain valid).
1891- floating point numbers may now start with a period (e.g., .14).
1892- definition of integer division tightened (always truncates towards zero).
1893- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
1894- new list method l.count(x) returns the number of occurrences of x in l.
1895- new SGI module: al (Indigo and 4D/35 audio library).
1896- the FORMS interface (modules fl and FL) now uses FORMS 2.0
1897- module gl: added lrect{read,write}, rectzoom and pixmode;
1898 added (non-GL) functions (un)packrect.
1899- new socket method: s.allowbroadcast(flag).
1900- many objects support __dict__, __methods__ or __members__.
1901- dir() lists anything that has __dict__.
1902- class attributes are no longer read-only.
1903- classes support __bases__, instances support __class__ (and __dict__).
1904- divmod() now also works for floats.
1905- fixed obscure bug in eval('1 ').
1906
1907
1908===================================
1909==> Release 0.9.2 (Autumn 1991) <==
1910===================================
1911
1912Highlights
1913----------
1914
1915- tutorial now (almost) complete; library reference reorganized
1916- new syntax: continue statement; semicolons; dictionary constructors;
1917 restrictions on blank lines in source files removed
1918- dramatically improved module load time through precompiled modules
1919- arbitrary precision integers: compute 2 to the power 1000 and more...
1920- arithmetic operators now accept mixed type operands, e.g., 3.14/4
1921- more operations on list: remove, index, reverse; repetition
1922- improved/new file operations: readlines, seek, tell, flush, ...
1923- process management added to the posix module: fork/exec/wait/kill etc.
1924- BSD socket operations (with example servers and clients!)
1925- many new STDWIN features (color, fonts, polygons, ...)
1926- new SGI modules: font manager and FORMS library interface
1927
1928
1929Extended list of changes in 0.9.2
1930---------------------------------
1931
1932Here is a summary of the most important user-visible changes in 0.9.2,
1933in somewhat arbitrary order. Changes in later versions are listed in
1934the "highlights" section above.
1935
1936
19371. Changes to the interpreter proper
1938
1939- Simple statements can now be separated by semicolons.
1940 If you write "if t: s1; s2", both s1 and s2 are executed
1941 conditionally.
1942- The 'continue' statement was added, with semantics as in C.
1943- Dictionary displays are now allowed on input: {key: value, ...}.
1944- Blank lines and lines bearing only a comment no longer need to
1945 be indented properly. (A completely empty line still ends a multi-
1946 line statement interactively.)
1947- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
1948- Option "-c command" to execute statements from the command line
1949- Compiled versions of modules are cached in ".pyc" files, giving a
1950 dramatic improvement of start-up time
1951- Other, smaller speed improvements, e.g., extracting characters from
1952 strings, looking up single-character keys, and looking up global
1953 variables
1954- Interrupting a print operation raises KeyboardInterrupt instead of
1955 only cancelling the print operation
1956- Fixed various portability problems (it now passes gcc with only
1957 warnings -- more Standard C compatibility will be provided in later
1958 versions)
1959- Source is prepared for porting to MS-DOS
1960- Numeric constants are now checked for overflow (this requires
1961 standard-conforming strtol() and strtod() functions; a correct
1962 strtol() implementation is provided, but the strtod() provided
1963 relies on atof() for everything, including error checking
1964
1965
19662. Changes to the built-in types, functions and modules
1967
1968- New module socket: interface to BSD socket primitives
1969- New modules pwd and grp: access the UNIX password and group databases
1970- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
1971- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
1972- New numeric type: long integer, for unlimited precision
1973 - integer constants suffixed with 'L' or 'l' are long integers
1974 - new built-in function long(x) converts int or float to long
1975 - int() and float() now also convert from long integers
1976- New built-in function:
1977 - pow(x, y) returns x to the power y
1978- New operation and methods for lists:
1979 - l*n returns a new list consisting of n concatenated copies of l
1980 - l.remove(x) removes the first occurrence of the value x from l
1981 - l.index(x) returns the index of the first occurrence of x in l
1982 - l.reverse() reverses l in place
1983- New operation for tuples:
1984 - t*n returns a tuple consisting of n concatenated copies of t
1985- Improved file handling:
1986 - f.readline() no longer restricts the line length, is faster,
1987 and isn't confused by null bytes; same for raw_input()
1988 - f.read() without arguments reads the entire (rest of the) file
1989 - mixing of print and sys.stdout.write() has different effect
1990- New methods for files:
1991 - f.readlines() returns a list containing the lines of the file,
1992 as read with f.readline()
1993 - f.flush(), f.tell(), f.seek() call their stdio counterparts
1994 - f.isatty() tests for "tty-ness"
1995- New posix functions:
1996 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
1997 - popen() returns a file object connected to a pipe
1998 - utime() replaces utimes() (the latter is not a POSIX name)
1999- New stdwin features, including:
2000 - font handling
2001 - color drawing
2002 - scroll bars made optional
2003 - polygons
2004 - filled and xor shapes
2005 - text editing objects now have a 'settext' method
2006
2007
20083. Changes to the standard library
2009
2010- Name change: the functions path.cat and macpath.cat are now called
2011 path.join and macpath.join
2012- Added new modules: formatter, mutex, persist, sched, mainloop
2013- Added some modules and functionality to the "widget set" (which is
2014 still under development, so please bear with me):
2015 DirList, FormSplit, TextEdit, WindowSched
2016- Fixed module testall to work non-interactively
2017- Module string:
2018 - added functions join() and joinfields()
2019 - fixed center() to work correct and make it "transitive"
2020- Obsolete modules were removed: util, minmax
2021- Some modules were moved to the demo directory
2022
2023
20244. Changes to the demonstration programs
2025
2026- Added new useful scipts: byteyears, eptags, fact, from, lfact,
2027 objgraph, pdeps, pi, primes, ptags, which
2028- Added a bunch of socket demos
2029- Doubled the speed of ptags
2030- Added new stdwin demos: microedit, miniedit
2031- Added a windowing interface to the Python interpreter: python (most
2032 useful on the Mac)
2033- Added a browser for Emacs info files: demo/stdwin/ibrowse
2034 (yes, I plan to put all STDWIN and Python documentation in texinfo
2035 form in the future)
2036
2037
20385. Other changes to the distribution
2039
2040- An Emacs Lisp file "python.el" is provided to facilitate editing
2041 Python programs in GNU Emacs (slightly improved since posted to
2042 gnu.emacs.sources)
2043- Some info on writing an extension in C is provided
2044- Some info on building Python on non-UNIX platforms is provided
2045
2046
2047=====================================
2048==> Release 0.9.1 (February 1991) <==
2049=====================================
2050
2051- Micro changes only
2052- Added file "patchlevel.h"
2053
2054
2055=====================================
2056==> Release 0.9.0 (February 1991) <==
2057=====================================
2058
2059Original posting to alt.sources.