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