blob: 329d0b369257e869fce0c195f6d8d986ee521b33 [file] [log] [blame]
Guido van Rossuma598c932000-09-04 16:26:03 +00001Python History
Guido van Rossuma7925f11994-01-26 10:20:16 +00002--------------
3
Guido van Rossum439d1fa1998-12-21 21:41:14 +00004This file contains the release messages for previous Python releases.
5As you read on you go back to the dark ages of Python's history.
6
7
8======================================================================
9
10
Skip Montanaro4cb22042002-09-17 20:55:31 +000011What's New in Python 2.1 (final)?
12=================================
13
14We only changed a few things since the last release candidate, all in
15Python library code:
16
17- A bug in the locale module was fixed that affected locales which
18 define no grouping for numeric formatting.
19
20- A few bugs in the weakref module's implementations of weak
21 dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed,
22 and the test suite was updated to check for these bugs.
23
24- An old bug in the os.path.walk() function (introduced in Python
25 2.0!) was fixed: a non-existent file would cause an exception
26 instead of being ignored.
27
28- Fixed a few bugs in the new symtable module found by Neil Norwitz's
29 PyChecker.
30
31
32What's New in Python 2.1c2?
33===========================
34
35A flurry of small changes, and one showstopper fixed in the nick of
36time made it necessary to release another release candidate. The list
37here is the *complete* list of patches (except version updates):
38
39Core
40
41- Tim discovered a nasty bug in the dictionary code, caused by
42 PyDict_Next() calling dict_resize(), and the GC code's use of
43 PyDict_Next() violating an assumption in dict_items(). This was
44 fixed with considerable amounts of band-aid, but the net effect is a
45 saner and more robust implementation.
46
47- Made a bunch of symbols static that were accidentally global.
48
49Build and Ports
50
51- The setup.py script didn't check for a new enough version of zlib
52 (1.1.3 is needed). Now it does.
53
54- Changed "make clean" target to also remove shared libraries.
55
56- Added a more general warning about the SGI Irix optimizer to README.
57
58Library
59
60- Fix a bug in urllib.basejoin("http://host", "../file.html") which
61 omitted the slash between host and file.html.
62
63- The mailbox module's _Mailbox class contained a completely broken
64 and undocumented seek() method. Ripped it out.
65
66- Fixed a bunch of typos in various library modules (urllib2, smtpd,
67 sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker.
68
69- Fixed a few last-minute bugs in unittest.
70
71Extensions
72
73- Reverted the patch to the OpenSSL code in socketmodule.c to support
74 RAND_status() and the EGD, and the subsequent patch that tried to
75 fix it for pre-0.9.5 versions; the problem with the patch is that on
76 some systems it issues a warning whenever socket is imported, and
77 that's unacceptable.
78
79Tests
80
81- Fixed the pickle tests to work with "import test.test_pickle".
82
83- Tweaked test_locale.py to actually run the test Windows.
84
85- In distutils/archive_util.py, call zipfile.ZipFile() with mode "w",
86 not "wb" (which is not a valid mode at all).
87
88- Fix pstats browser crashes. Import readline if it exists to make
89 the user interface nicer.
90
91- Add "import thread" to the top of test modules that import the
92 threading module (test_asynchat and test_threadedtempfile). This
93 prevents test failures caused by a broken threading module resulting
94 from a previously caught failed import.
95
96- Changed test_asynchat.py to set the SO_REUSEADDR option; this was
97 needed on some platforms (e.g. Solaris 8) when the tests are run
98 twice in succession.
99
100- Skip rather than fail test_sunaudiodev if no audio device is found.
101
102
103What's New in Python 2.1c1?
104===========================
105
106This list was significantly updated when 2.1c2 was released; the 2.1c1
107release didn't mention most changes that were actually part of 2.1c1:
108
109Legal
110
111- Copyright was assigned to the Python Software Foundation (PSF) and a
112 PSF license (very similar to the CNRI license) was added.
113
114- The CNRI copyright notice was updated to include 2001.
115
116Core
117
118- After a public outcry, assignment to __debug__ is no longer illegal;
119 instead, a warning is issued. It will become illegal in 2.2.
120
121- Fixed a core dump with "%#x" % 0, and changed the semantics so that
122 "%#x" now always prepends "0x", even if the value is zero.
123
124- Fixed some nits in the bytecode compiler.
125
126- Fixed core dumps when calling certain kinds of non-functions.
127
128- Fixed various core dumps caused by reference count bugs.
129
130Build and Ports
131
132- Use INSTALL_SCRIPT to install script files.
133
134- New port: SCO Unixware 7, by Billy G. Allie.
135
136- Updated RISCOS port.
137
138- Updated BeOS port and notes.
139
140- Various other porting problems resolved.
141
142Library
143
144- The TERMIOS and SOCKET modules are now truly obsolete and
145 unnecessary. Their symbols are incorporated in the termios and
146 socket modules.
147
148- Fixed some 64-bit bugs in pickle, cPickle, and struct, and added
149 better tests for pickling.
150
151- threading: make Condition.wait() robust against KeyboardInterrupt.
152
153- zipfile: add support to zipfile to support opening an archive
154 represented by an open file rather than a file name. Fix bug where
155 the archive was not properly closed. Fixed a bug in this bugfix
156 where flush() was called for a read-only file.
157
158- imputil: added an uninstall() method to the ImportManager.
159
160- Canvas: fixed bugs in lower() and tkraise() methods.
161
162- SocketServer: API change (added overridable close_request() method)
163 so that the TCP server can explicitly close the request.
164
165- pstats: Eric Raymond added a simple interactive statistics browser,
166 invoked when the module is run as a script.
167
168- locale: fixed a problem in format().
169
170- webbrowser: made it work when the BROWSER environment variable has a
171 value like "/usr/bin/netscape". Made it auto-detect Konqueror for
172 KDE 2. Fixed some other nits.
173
174- unittest: changes to allow using a different exception than
175 AssertionError, and added a few more function aliases. Some other
176 small changes.
177
178- urllib, urllib2: fixed redirect problems and a coupleof other nits.
179
180- asynchat: fixed a critical bug in asynchat that slipped through the
181 2.1b2 release. Fixed another rare bug.
182
183- Fix some unqualified except: clauses (always a bad code example).
184
185XML
186
187- pyexpat: new API get_version_string().
188
189- Fixed some minidom bugs.
190
191Extensions
192
193- Fixed a core dump in _weakref. Removed the weakref.mapping()
194 function (it adds nothing to the API).
195
196- Rationalized the use of header files in the readline module, to make
197 it compile (albeit with some warnings) with the very recent readline
198 4.2, without breaking for earlier versions.
199
200- Hopefully fixed a buffering problem in linuxaudiodev.
201
202- Attempted a fix to make the OpenSSL support in the socket module
203 work again with pre-0.9.5 versions of OpenSSL.
204
205Tests
206
207- Added a test case for asynchat and asyncore.
208
209- Removed coupling between tests where one test failing could break
210 another.
211
212Tools
213
214- Ping added an interactive help browser to pydoc, fixed some nits
215 in the rest of the pydoc code, and added some features to his
216 inspect module.
217
218- An updated python-mode.el version 4.1 which integrates Ken
219 Manheimer's pdbtrack.el. This makes debugging Python code via pdb
220 much nicer in XEmacs and Emacs. When stepping through your program
221 with pdb, in either the shell window or the *Python* window, the
222 source file and line will be tracked by an arrow. Very cool!
223
224- IDLE: syntax warnings in interactive mode are changed into errors.
225
226- Some improvements to Tools/webchecker (ignore some more URL types,
227 follow some more links).
228
229- Brought the Tools/compiler package up to date.
230
231
232What's New in Python 2.1 beta 2?
233================================
234
235(Unlisted are many fixed bugs, more documentation, etc.)
236
237Core language, builtins, and interpreter
238
239- The nested scopes work (enabled by "from __future__ import
240 nested_scopes") is completed; in particular, the future now extends
241 into code executed through exec, eval() and execfile(), and into the
242 interactive interpreter.
243
244- When calling a base class method (e.g. BaseClass.__init__(self)),
245 this is now allowed even if self is not strictly spoken a class
246 instance (e.g. when using metaclasses or the Don Beaudry hook).
247
248- Slice objects are now comparable but not hashable; this prevents
249 dict[:] from being accepted but meaningless.
250
251- Complex division is now calculated using less braindead algorithms.
252 This doesn't change semantics except it's more likely to give useful
253 results in extreme cases. Complex repr() now uses full precision
254 like float repr().
255
256- sgmllib.py now calls handle_decl() for simple <!...> declarations.
257
258- It is illegal to assign to the name __debug__, which is set when the
259 interpreter starts. It is effectively a compile-time constant.
260
261- A warning will be issued if a global statement for a variable
262 follows a use or assignment of that variable.
263
264Standard library
265
266- unittest.py, a unit testing framework by Steve Purcell (PyUNIT,
267 inspired by JUnit), is now part of the standard library. You now
268 have a choice of two testing frameworks: unittest requires you to
269 write testcases as separate code, doctest gathers them from
270 docstrings. Both approaches have their advantages and
271 disadvantages.
272
273- A new module Tix was added, which wraps the Tix extension library
274 for Tk. With that module, it is not necessary to statically link
275 Tix with _tkinter, since Tix will be loaded with Tcl's "package
276 require" command. See Demo/tix/.
277
278- tzparse.py is now obsolete.
279
280- In gzip.py, the seek() and tell() methods are removed -- they were
281 non-functional anyway, and it's better if callers can test for their
282 existence with hasattr().
283
284Python/C API
285
286- PyDict_Next(): it is now safe to call PyDict_SetItem() with a key
287 that's already in the dictionary during a PyDict_Next() iteration.
288 This used to fail occasionally when a dictionary resize operation
289 could be triggered that would rehash all the keys. All other
290 modifications to the dictionary are still off-limits during a
291 PyDict_Next() iteration!
292
293- New extended APIs related to passing compiler variables around.
294
295- New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass()
296 implement isinstance() and issubclass().
297
298- Py_BuildValue() now has a "D" conversion to create a Python complex
299 number from a Py_complex C value.
300
301- Extensions types which support weak references must now set the
302 field allocated for the weak reference machinery to NULL themselves;
303 this is done to avoid the cost of checking each object for having a
304 weakly referencable type in PyObject_INIT(), since most types are
305 not weakly referencable.
306
307- PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for
308 free variables and cell variables to and from the frame's f_locals.
309
310- Variants of several functions defined in pythonrun.h have been added
311 to support the nested_scopes future statement. The variants all end
312 in Flags and take an extra argument, a PyCompilerFlags *; examples:
313 PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These
314 variants may be removed in Python 2.2, when nested scopes are
315 mandatory.
316
317Distutils
318
319- the sdist command now writes a PKG-INFO file, as described in PEP 241,
320 into the release tree.
321
322- several enhancements to the bdist_wininst command from Thomas Heller
323 (an uninstaller, more customization of the installer's display)
324
325- from Jack Jansen: added Mac-specific code to generate a dialog for
326 users to specify the command-line (because providing a command-line with
327 MacPython is awkward). Jack also made various fixes for the Mac
328 and the Metrowerks compiler.
329
330- added 'platforms' and 'keywords' to the set of metadata that can be
331 specified for a distribution.
332
333- applied patches from Jason Tishler to make the compiler class work with
334 Cygwin.
335
336
337What's New in Python 2.1 beta 1?
338================================
339
340Core language, builtins, and interpreter
341
342- Following an outcry from the community about the amount of code
343 broken by the nested scopes feature introduced in 2.1a2, we decided
344 to make this feature optional, and to wait until Python 2.2 (or at
345 least 6 months) to make it standard. The option can be enabled on a
346 per-module basis by adding "from __future__ import nested_scopes" at
347 the beginning of a module (before any other statements, but after
348 comments and an optional docstring). See PEP 236 (Back to the
349 __future__) for a description of the __future__ statement. PEP 227
350 (Statically Nested Scopes) has been updated to reflect this change,
351 and to clarify the semantics in a number of endcases.
352
353- The nested scopes code, when enabled, has been hardened, and most
354 bugs and memory leaks in it have been fixed.
355
356- Compile-time warnings are now generated for a number of conditions
357 that will break or change in meaning when nested scopes are enabled:
358
359 - Using "from...import *" or "exec" without in-clause in a function
360 scope that also defines a lambda or nested function with one or
361 more free (non-local) variables. The presence of the import* or
362 bare exec makes it impossible for the compiler to determine the
363 exact set of local variables in the outer scope, which makes it
364 impossible to determine the bindings for free variables in the
365 inner scope. To avoid the warning about import *, change it into
366 an import of explicitly name object, or move the import* statement
367 to the global scope; to avoid the warning about bare exec, use
368 exec...in... (a good idea anyway -- there's a possibility that
369 bare exec will be deprecated in the future).
370
371 - Use of a global variable in a nested scope with the same name as a
372 local variable in a surrounding scope. This will change in
373 meaning with nested scopes: the name in the inner scope will
374 reference the variable in the outer scope rather than the global
375 of the same name. To avoid the warning, either rename the outer
376 variable, or use a global statement in the inner function.
377
378- An optional object allocator has been included. This allocator is
379 optimized for Python objects and should be faster and use less memory
380 than the standard system allocator. It is not enabled by default
381 because of possible thread safety problems. The allocator is only
382 protected by the Python interpreter lock and it is possible that some
383 extension modules require a thread safe allocator. The object
384 allocator can be enabled by providing the "--with-pymalloc" option to
385 configure.
386
387Standard library
388
389- pyexpat now detects the expat version if expat.h defines it. A
390 number of additional handlers are provided, which are only available
391 since expat 1.95. In addition, the methods SetParamEntityParsing and
392 GetInputContext of Parser objects are available with 1.95.x
393 only. Parser objects now provide the ordered_attributes and
394 specified_attributes attributes. A new module expat.model was added,
395 which offers a number of additional constants if 1.95.x is used.
396
397- xml.dom offers the new functions registerDOMImplementation and
398 getDOMImplementation.
399
400- xml.dom.minidom offers a toprettyxml method. A number of DOM
401 conformance issues have been resolved. In particular, Element now
402 has an hasAttributes method, and the handling of namespaces was
403 improved.
404
405- Ka-Ping Yee contributed two new modules: inspect.py, a module for
406 getting information about live Python code, and pydoc.py, a module
407 for interactively converting docstrings to HTML or text.
408 Tools/scripts/pydoc, which is now automatically installed into
409 <prefix>/bin, uses pydoc.py to display documentation; try running
410 "pydoc -h" for instructions. "pydoc -g" pops up a small GUI that
411 lets you browse the module docstrings using a web browser.
412
413- New library module difflib.py, primarily packaging the SequenceMatcher
414 class at the heart of the popular ndiff.py file-comparison tool.
415
416- doctest.py (a framework for verifying Python code examples in docstrings)
417 is now part of the std library.
418
419Windows changes
420
421- A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a
422 small GUI that lets you browse the module docstrings using your
423 default web browser.
424
425- Import is now case-sensitive. PEP 235 (Import on Case-Insensitive
426 Platforms) is implemented. See
427
428 http://python.sourceforge.net/peps/pep-0235.html
429
430 for full details, especially the "Current Lower-Left Semantics" section.
431 The new Windows import rules are simpler than before:
432
433 A. If the PYTHONCASEOK environment variable exists, same as
434 before: silently accept the first case-insensitive match of any
435 kind; raise ImportError if none found.
436
437 B. Else search sys.path for the first case-sensitive match; raise
438 ImportError if none found.
439
440 The same rules have been implemented on other platforms with case-
441 insensitive but case-preserving filesystems too (including Cygwin, and
442 several flavors of Macintosh operating systems).
443
444- winsound module: Under Win9x, winsound.Beep() now attempts to simulate
445 what it's supposed to do (and does do under NT and 2000) via direct
446 port manipulation. It's unknown whether this will work on all systems,
447 but it does work on my Win98SE systems now and was known to be useless on
448 all Win9x systems before.
449
450- Build: Subproject _test (effectively) renamed to _testcapi.
451
452New platforms
453
454- 2.1 should compile and run out of the box under MacOS X, even using HFS+.
455 Thanks to Steven Majewski!
456
457- 2.1 should compile and run out of the box on Cygwin. Thanks to Jason
458 Tishler!
459
460- 2.1 contains new files and patches for RISCOS, thanks to Dietmar
461 Schwertberger! See RISCOS/README for more information -- it seems
462 that because of the bizarre filename conventions on RISCOS, no port
463 to that platform is easy.
464
465
466What's New in Python 2.1 alpha 2?
467=================================
468
469Core language, builtins, and interpreter
470
471- Scopes nest. If a name is used in a function or class, but is not
472 local, the definition in the nearest enclosing function scope will
473 be used. One consequence of this change is that lambda statements
474 could reference variables in the namespaces where the lambda is
475 defined. In some unusual cases, this change will break code.
476
477 In all previous version of Python, names were resolved in exactly
478 three namespaces -- the local namespace, the global namespace, and
479 the builtin namespace. According to this old definition, if a
480 function A is defined within a function B, the names bound in B are
481 not visible in A. The new rules make names bound in B visible in A,
482 unless A contains a name binding that hides the binding in B.
483
484 Section 4.1 of the reference manual describes the new scoping rules
485 in detail. The test script in Lib/test/test_scope.py demonstrates
486 some of the effects of the change.
487
488 The new rules will cause existing code to break if it defines nested
489 functions where an outer function has local variables with the same
490 name as globals or builtins used by the inner function. Example:
491
492 def munge(str):
493 def helper(x):
494 return str(x)
495 if type(str) != type(''):
496 str = helper(str)
497 return str.strip()
498
499 Under the old rules, the name str in helper() is bound to the
500 builtin function str(). Under the new rules, it will be bound to
501 the argument named str and an error will occur when helper() is
502 called.
503
504- The compiler will report a SyntaxError if "from ... import *" occurs
505 in a function or class scope. The language reference has documented
506 that this case is illegal, but the compiler never checked for it.
507 The recent introduction of nested scope makes the meaning of this
508 form of name binding ambiguous. In a future release, the compiler
509 may allow this form when there is no possibility of ambiguity.
510
511- repr(string) is easier to read, now using hex escapes instead of octal,
512 and using \t, \n and \r instead of \011, \012 and \015 (respectively):
513
514 >>> "\texample \r\n" + chr(0) + chr(255)
515 '\texample \r\n\x00\xff' # in 2.1
516 '\011example \015\012\000\377' # in 2.0
517
518- Functions are now compared and hashed by identity, not by value, since
519 the func_code attribute is writable.
520
521- Weak references (PEP 205) have been added. This involves a few
522 changes in the core, an extension module (_weakref), and a Python
523 module (weakref). The weakref module is the public interface. It
524 includes support for "explicit" weak references, proxy objects, and
525 mappings with weakly held values.
526
527- A 'continue' statement can now appear in a try block within the body
528 of a loop. It is still not possible to use continue in a finally
529 clause.
530
531Standard library
532
533- mailbox.py now has a new class, PortableUnixMailbox which is
534 identical to UnixMailbox but uses a more portable scheme for
535 determining From_ separators. Also, the constructors for all the
536 classes in this module have a new optional `factory' argument, which
537 is a callable used when new message classes must be instantiated by
538 the next() method.
539
540- random.py is now self-contained, and offers all the functionality of
541 the now-deprecated whrandom.py. See the docs for details. random.py
542 also supports new functions getstate() and setstate(), for saving
543 and restoring the internal state of the generator; and jumpahead(n),
544 for quickly forcing the internal state to be the same as if n calls to
545 random() had been made. The latter is particularly useful for multi-
546 threaded programs, creating one instance of the random.Random() class for
547 each thread, then using .jumpahead() to force each instance to use a
548 non-overlapping segment of the full period.
549
550- random.py's seed() function is new. For bit-for-bit compatibility with
551 prior releases, use the whseed function instead. The new seed function
552 addresses two problems: (1) The old function couldn't produce more than
553 about 2**24 distinct internal states; the new one about 2**45 (the best
554 that can be done in the Wichmann-Hill generator). (2) The old function
555 sometimes produced identical internal states when passed distinct
556 integers, and there was no simple way to predict when that would happen;
557 the new one guarantees to produce distinct internal states for all
558 arguments in [0, 27814431486576L).
559
560- The socket module now supports raw packets on Linux. The socket
561 family is AF_PACKET.
562
563- test_capi.py is a start at running tests of the Python C API. The tests
564 are implemented by the new Modules/_testmodule.c.
565
566- A new extension module, _symtable, provides provisional access to the
567 internal symbol table used by the Python compiler. A higher-level
568 interface will be added on top of _symtable in a future release.
569
570- Removed the obsolete soundex module.
571
572- xml.dom.minidom now uses the standard DOM exceptions. Node supports
573 the isSameNode method; NamedNodeMap the get method.
574
575- xml.sax.expatreader supports the lexical handler property; it
576 generates comment, startCDATA, and endCDATA events.
577
578Windows changes
579
580- Build procedure: the zlib project is built in a different way that
581 ensures the zlib header files used can no longer get out of synch with
582 the zlib binary used. See PCbuild\readme.txt for details. Your old
583 zlib-related directories can be deleted; you'll need to download fresh
584 source for zlib and unpack it into a new directory.
585
586- Build: New subproject _test for the benefit of test_capi.py (see above).
587
588- Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent
589 interface to some Python compiler internals).
590
591- Build: Subproject ucnhash is gone, since the code was folded into the
592 unicodedata subproject.
593
594What's New in Python 2.1 alpha 1?
595=================================
596
597Core language, builtins, and interpreter
598
599- There is a new Unicode companion to the PyObject_Str() API
600 called PyObject_Unicode(). It behaves in the same way as the
601 former, but assures that the returned value is an Unicode object
602 (applying the usual coercion if necessary).
603
604- The comparison operators support "rich comparison overloading" (PEP
605 207). C extension types can provide a rich comparison function in
606 the new tp_richcompare slot in the type object. The cmp() function
607 and the C function PyObject_Compare() first try the new rich
608 comparison operators before trying the old 3-way comparison. There
609 is also a new C API PyObject_RichCompare() (which also falls back on
610 the old 3-way comparison, but does not constrain the outcome of the
611 rich comparison to a Boolean result).
612
613 The rich comparison function takes two objects (at least one of
614 which is guaranteed to have the type that provided the function) and
615 an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ,
616 Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python
617 object, which may be NotImplemented (in which case the tp_compare
618 slot function is used as a fallback, if defined).
619
620 Classes can overload individual comparison operators by defining one
621 or more of the methods__lt__, __le__, __eq__, __ne__, __gt__,
622 __ge__. There are no explicit "reflected argument" versions of
623 these; instead, __lt__ and __gt__ are each other's reflection,
624 likewise for__le__ and __ge__; __eq__ and __ne__ are their own
625 reflection (similar at the C level). No other implications are
626 made; in particular, Python does not assume that == is the Boolean
627 inverse of !=, or that < is the Boolean inverse of >=. This makes
628 it possible to define types with partial orderings.
629
630 Classes or types that want to implement (in)equality tests but not
631 the ordering operators (i.e. unordered types) should implement ==
632 and !=, and raise an error for the ordering operators.
633
634 It is possible to define types whose rich comparison results are not
635 Boolean; e.g. a matrix type might want to return a matrix of bits
636 for A < B, giving elementwise comparisons. Such types should ensure
637 that any interpretation of their value in a Boolean context raises
638 an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot
639 at the C level) to always raise an exception.
640
641- Complex numbers use rich comparisons to define == and != but raise
642 an exception for <, <=, > and >=. Unfortunately, this also means
643 that cmp() of two complex numbers raises an exception when the two
644 numbers differ. Since it is not mathematically meaningful to compare
645 complex numbers except for equality, I hope that this doesn't break
646 too much code.
647
648- The outcome of comparing non-numeric objects of different types is
649 not defined by the language, other than that it's arbitrary but
650 consistent (see the Reference Manual). An implementation detail changed
651 in 2.1a1 such that None now compares less than any other object. Code
652 relying on this new behavior (like code that relied on the previous
653 behavior) does so at its own risk.
654
655- Functions and methods now support getting and setting arbitrarily
656 named attributes (PEP 232). Functions have a new __dict__
657 (a.k.a. func_dict) which hold the function attributes. Methods get
658 and set attributes on their underlying im_func. It is a TypeError
659 to set an attribute on a bound method.
660
661- The xrange() object implementation has been improved so that
662 xrange(sys.maxint) can be used on 64-bit platforms. There's still a
663 limitation that in this case len(xrange(sys.maxint)) can't be
664 calculated, but the common idiom "for i in xrange(sys.maxint)" will
665 work fine as long as the index i doesn't actually reach 2**31.
666 (Python uses regular ints for sequence and string indices; fixing
667 that is much more work.)
668
669- Two changes to from...import:
670
671 1) "from M import X" now works even if (after loading module M)
672 sys.modules['M'] is not a real module; it's basically a getattr()
673 operation with AttributeError exceptions changed into ImportError.
674
675 2) "from M import *" now looks for M.__all__ to decide which names to
676 import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
677 filters out names starting with '_' as before. Whether or not
678 __all__ exists, there's no restriction on the type of M.
679
680- File objects have a new method, xreadlines(). This is the fastest
681 way to iterate over all lines in a file:
682
683 for line in file.xreadlines():
684 ...do something to line...
685
686 See the xreadlines module (mentioned below) for how to do this for
687 other file-like objects.
688
689- Even if you don't use file.xreadlines(), you may expect a speedup on
690 line-by-line input. The file.readline() method has been optimized
691 quite a bit in platform-specific ways: on systems (like Linux) that
692 support flockfile(), getc_unlocked(), and funlockfile(), those are
693 used by default. On systems (like Windows) without getc_unlocked(),
694 a complicated (but still thread-safe) method using fgets() is used by
695 default.
696
697 You can force use of the fgets() method by #define'ing
698 USE_FGETS_IN_GETLINE at build time (it may be faster than
699 getc_unlocked()).
700
701 You can force fgets() not to be used by #define'ing
702 DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test
703 test_bufio.py fails -- and let us know if it does!).
704
705- In addition, the fileinput module, while still slower than the other
706 methods on most platforms, has been sped up too, by using
707 file.readlines(sizehint).
708
709- Support for run-time warnings has been added, including a new
710 command line option (-W) to specify the disposition of warnings.
711 See the description of the warnings module below.
712
713- Extensive changes have been made to the coercion code. This mostly
714 affects extension modules (which can now implement mixed-type
715 numerical operators without having to use coercion), but
716 occasionally, in boundary cases the coercion semantics have changed
717 subtly. Since this was a terrible gray area of the language, this
718 is considered an improvement. Also note that __rcmp__ is no longer
719 supported -- instead of calling __rcmp__, __cmp__ is called with
720 reflected arguments.
721
722- In connection with the coercion changes, a new built-in singleton
723 object, NotImplemented is defined. This can be returned for
724 operations that wish to indicate they are not implemented for a
725 particular combination of arguments. From C, this is
726 Py_NotImplemented.
727
728- The interpreter accepts now bytecode files on the command line even
729 if they do not have a .pyc or .pyo extension. On Linux, after executing
730
731import imp,sys,string
732magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"")
733reg = ':pyc:M::%s::%s:' % (magic, sys.executable)
734open("/proc/sys/fs/binfmt_misc/register","wb").write(reg)
735
736 any byte code file can be used as an executable (i.e. as an argument
737 to execve(2)).
738
739- %[xXo] formats of negative Python longs now produce a sign
740 character. In 1.6 and earlier, they never produced a sign,
741 and raised an error if the value of the long was too large
742 to fit in a Python int. In 2.0, they produced a sign if and
743 only if too large to fit in an int. This was inconsistent
744 across platforms (because the size of an int varies across
745 platforms), and inconsistent with hex() and oct(). Example:
746
747 >>> "%x" % -0x42L
748 '-42' # in 2.1
749 'ffffffbe' # in 2.0 and before, on 32-bit machines
750 >>> hex(-0x42L)
751 '-0x42L' # in all versions of Python
752
753 The behavior of %d formats for negative Python longs remains
754 the same as in 2.0 (although in 1.6 and before, they raised
755 an error if the long didn't fit in a Python int).
756
757 %u formats don't make sense for Python longs, but are allowed
758 and treated the same as %d in 2.1. In 2.0, a negative long
759 formatted via %u produced a sign if and only if too large to
760 fit in an int. In 1.6 and earlier, a negative long formatted
761 via %u raised an error if it was too big to fit in an int.
762
763- Dictionary objects have an odd new method, popitem(). This removes
764 an arbitrary item from the dictionary and returns it (in the form of
765 a (key, value) pair). This can be useful for algorithms that use a
766 dictionary as a bag of "to do" items and repeatedly need to pick one
767 item. Such algorithms normally end up running in quadratic time;
768 using popitem() they can usually be made to run in linear time.
769
770Standard library
771
772- In the time module, the time argument to the functions strftime,
773 localtime, gmtime, asctime and ctime is now optional, defaulting to
774 the current time (in the local timezone).
775
776- The ftplib module now defaults to passive mode, which is deemed a
777 more useful default given that clients are often inside firewalls
778 these days. Note that this could break if ftplib is used to connect
779 to a *server* that is inside a firewall, from outside; this is
780 expected to be a very rare situation. To fix that, you can call
781 ftp.set_pasv(0).
782
783- The module site now treats .pth files not only for path configuration,
784 but also supports extensions to the initialization code: Lines starting
785 with import are executed.
786
787- There's a new module, warnings, which implements a mechanism for
788 issuing and filtering warnings. There are some new built-in
789 exceptions that serve as warning categories, and a new command line
790 option, -W, to control warnings (e.g. -Wi ignores all warnings, -We
791 turns warnings into errors). warnings.warn(message[, category])
792 issues a warning message; this can also be called from C as
793 PyErr_Warn(category, message).
794
795- A new module xreadlines was added. This exports a single factory
796 function, xreadlines(). The intention is that this code is the
797 absolutely fastest way to iterate over all lines in an open
798 file(-like) object:
799
800 import xreadlines
801 for line in xreadlines.xreadlines(file):
802 ...do something to line...
803
804 This is equivalent to the previous the speed record holder using
805 file.readlines(sizehint). Note that if file is a real file object
806 (as opposed to a file-like object), this is equivalent:
807
808 for line in file.xreadlines():
809 ...do something to line...
810
811- The bisect module has new functions bisect_left, insort_left,
812 bisect_right and insort_right. The old names bisect and insort
813 are now aliases for bisect_right and insort_right. XXX_right
814 and XXX_left methods differ in what happens when the new element
815 compares equal to one or more elements already in the list: the
816 XXX_left methods insert to the left, the XXX_right methods to the
817 right. Code that doesn't care where equal elements end up should
818 continue to use the old, short names ("bisect" and "insort").
819
820- The new curses.panel module wraps the panel library that forms part
821 of SYSV curses and ncurses. Contributed by Thomas Gellekum.
822
823- The SocketServer module now sets the allow_reuse_address flag by
824 default in the TCPServer class.
825
826- A new function, sys._getframe(), returns the stack frame pointer of
827 the caller. This is intended only as a building block for
828 higher-level mechanisms such as string interpolation.
829
830- The pyexpat module supports a number of new handlers, which are
831 available only in expat 1.2. If invocation of a callback fails, it
832 will report an additional frame in the traceback. Parser objects
833 participate now in garbage collection. If expat reports an unknown
834 encoding, pyexpat will try to use a Python codec; that works only
835 for single-byte charsets. The parser type objects is exposed as
836 XMLParserObject.
837
838- xml.dom now offers standard definitions for symbolic node type and
839 exception code constants, and a hierarchy of DOM exceptions. minidom
840 was adjusted to use them.
841
842- The conformance of xml.dom.minidom to the DOM specification was
843 improved. It detects a number of additional error cases; the
844 previous/next relationship works even when the tree is modified;
845 Node supports the normalize() method; NamedNodeMap, DocumentType and
846 DOMImplementation classes were added; Element supports the
847 hasAttribute and hasAttributeNS methods; and Text supports the splitText
848 method.
849
850Build issues
851
852- For Unix (and Unix-compatible) builds, configuration and building of
853 extension modules is now greatly automated. Rather than having to
854 edit the Modules/Setup file to indicate which modules should be
855 built and where their include files and libraries are, a
856 distutils-based setup.py script now takes care of building most
857 extension modules. All extension modules built this way are built
858 as shared libraries. Only a few modules that must be linked
859 statically are still listed in the Setup file; you won't need to
860 edit their configuration.
861
862- Python should now build out of the box on Cygwin. If it doesn't,
863 mail to Jason Tishler (jlt63 at users.sourceforge.net).
864
865- Python now always uses its own (renamed) implementation of getopt()
866 -- there's too much variation among C library getopt()
867 implementations.
868
869- C++ compilers are better supported; the CXX macro is always set to a
870 C++ compiler if one is found.
871
872Windows changes
873
874- select module: By default under Windows, a select() call
875 can specify no more than 64 sockets. Python now boosts
876 this Microsoft default to 512. If you need even more than
877 that, see the MS docs (you'll need to #define FD_SETSIZE
878 and recompile Python from source).
879
880- Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3
881 subdirectory is no more!
882
883
884What's New in Python 2.0?
885=========================
886
887Below is a list of all relevant changes since release 1.6. Older
888changes are in the file HISTORY. If you are making the jump directly
889from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the
890HISTORY file! Many important changes listed there.
891
892Alternatively, a good overview of the changes between 1.5.2 and 2.0 is
893the document "What's New in Python 2.0" by Kuchling and Moshe Zadka:
894http://starship.python.net/crew/amk/python/writing/new-python/.
895
896--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
897
898======================================================================
899
900What's new in 2.0 (since release candidate 1)?
901==============================================
902
903Standard library
904
905- The copy_reg module was modified to clarify its intended use: to
906 register pickle support for extension types, not for classes.
907 pickle() will raise a TypeError if it is passed a class.
908
909- Fixed a bug in gettext's "normalize and expand" code that prevented
910 it from finding an existing .mo file.
911
912- Restored support for HTTP/0.9 servers in httplib.
913
914- The math module was changed to stop raising OverflowError in case of
915 underflow, and return 0 instead in underflow cases. Whether Python
916 used to raise OverflowError in case of underflow was platform-
917 dependent (it did when the platform math library set errno to ERANGE
918 on underflow).
919
920- Fixed a bug in StringIO that occurred when the file position was not
921 at the end of the file and write() was called with enough data to
922 extend past the end of the file.
923
924- Fixed a bug that caused Tkinter error messages to get lost on
925 Windows. The bug was fixed by replacing direct use of
926 interp->result with Tcl_GetStringResult(interp).
927
928- Fixed bug in urllib2 that caused it to fail when it received an HTTP
929 redirect response.
930
931- Several changes were made to distutils: Some debugging code was
932 removed from util. Fixed the installer used when an external zip
933 program (like WinZip) is not found; the source code for this
934 installer is in Misc/distutils. check_lib() was modified to behave
935 more like AC_CHECK_LIB by add other_libraries() as a parameter. The
936 test for whether installed modules are on sys.path was changed to
937 use both normcase() and normpath().
938
939- Several minor bugs were fixed in the xml package (the minidom,
940 pulldom, expatreader, and saxutils modules).
941
942- The regression test driver (regrtest.py) behavior when invoked with
943 -l changed: It now reports a count of objects that are recognized as
944 garbage but not freed by the garbage collector.
945
946- The regression test for the math module was changed to test
947 exceptional behavior when the test is run in verbose mode. Python
948 cannot yet guarantee consistent exception behavior across platforms,
949 so the exception part of test_math is run only in verbose mode, and
950 may fail on your platform.
951
952Internals
953
954- PyOS_CheckStack() has been disabled on Win64, where it caused
955 test_sre to fail.
956
957Build issues
958
959- Changed compiler flags, so that gcc is always invoked with -Wall and
960 -Wstrict-prototypes. Users compiling Python with GCC should see
961 exactly one warning, except if they have passed configure the
962 --with-pydebug flag. The expected warning is for getopt() in
963 Modules/main.c. This warning will be fixed for Python 2.1.
964
965- Fixed configure to add -threads argument during linking on OSF1.
966
967Tools and other miscellany
968
969- The compiler in Tools/compiler was updated to support the new
970 language features introduced in 2.0: extended print statement, list
971 comprehensions, and augmented assignments. The new compiler should
972 also be backwards compatible with Python 1.5.2; the compiler will
973 always generate code for the version of the interpreter it runs
974 under.
975
976What's new in 2.0 release candidate 1 (since beta 2)?
977=====================================================
978
979What is release candidate 1?
980
981We believe that release candidate 1 will fix all known bugs that we
982intend to fix for the 2.0 final release. This release should be a bit
983more stable than the previous betas. We would like to see even more
984widespread testing before the final release, so we are producing this
985release candidate. The final release will be exactly the same unless
986any show-stopping (or brown bag) bugs are found by testers of the
987release candidate.
988
989All the changes since the last beta release are bug fixes or changes
990to support building Python for specific platforms.
991
992Core language, builtins, and interpreter
993
994- A bug that caused crashes when __coerce__ was used with augmented
995 assignment, e.g. +=, was fixed.
996
997- Raise ZeroDivisionError when raising zero to a negative number,
998 e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the builtin
999 power operator and the result of math.pow(0.0, -2.0) will vary by
1000 platform. On Linux, it raises a ValueError.
1001
1002- A bug in Unicode string interpolation was fixed that occasionally
1003 caused errors with formats including "%%". For example, the
1004 following expression "%% %s" % u"abc" no longer raises a TypeError.
1005
1006- Compilation of deeply nested expressions raises MemoryError instead
1007 of SyntaxError, e.g. eval("[" * 50 + "]" * 50).
1008
1009- In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode,
1010 rendering them useless. They are now written in binary mode again.
1011
1012Standard library
1013
1014- Keyword arguments are now accepted for most pattern and match object
1015 methods in SRE, the standard regular expression engine.
1016
1017- In SRE, fixed error with negative lookahead and lookbehind that
1018 manifested itself as a runtime error in patterns like "(?<!abc)(def)".
1019
1020- Several bugs in the Unicode handling and error handling in _tkinter
1021 were fixed.
1022
1023- Fix memory management errors in Merge() and Tkapp_Call() routines.
1024
1025- Several changes were made to cStringIO to make it compatible with
1026 the file-like object interface and with StringIO. If operations are
1027 performed on a closed object, an exception is raised. The truncate
1028 method now accepts a position argument and readline accepts a size
1029 argument.
1030
1031- There were many changes made to the linuxaudiodev module and its
1032 test suite; as a result, a short, unexpected audio sample should now
1033 play when the regression test is run.
1034
1035 Note that this module is named poorly, because it should work
1036 correctly on any platform that supports the Open Sound System
1037 (OSS).
1038
1039 The module now raises exceptions when errors occur instead of
1040 crashing. It also defines the AFMT_A_LAW format (logarithmic A-law
1041 audio) and defines a getptr() method that calls the
1042 SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide.
1043
1044- The library_version attribute, introduced in an earlier beta, was
1045 removed because it can not be supported with early versions of the C
1046 readline library, which provides no way to determine the version at
1047 compile-time.
1048
1049- The binascii module is now enabled on Win64.
1050
1051- tokenize.py no longer suffers "recursion depth" errors when parsing
1052 programs with very long string literals.
1053
1054Internals
1055
1056- Fixed several buffer overflow vulnerabilities in calculate_path(),
1057 which is called when the interpreter starts up to determine where
1058 the standard library is installed. These vulnerabilities affect all
1059 previous versions of Python and can be exploited by setting very
1060 long values for PYTHONHOME or argv[0]. The risk is greatest for a
1061 setuid Python script, although use of the wrapper in
1062 Misc/setuid-prog.c will eliminate the vulnerability.
1063
1064- Fixed garbage collection bugs in instance creation that were
1065 triggered when errors occurred during initialization. The solution,
1066 applied in cPickle and in PyInstance_New(), is to call
1067 PyObject_GC_Init() after the initialization of the object's
1068 container attributes is complete.
1069
1070- pyexpat adds definitions of PyModule_AddStringConstant and
1071 PyModule_AddObject if the Python version is less than 2.0, which
1072 provides compatibility with PyXML on Python 1.5.2.
1073
1074- If the platform has a bogus definition for LONG_BIT (the number of
1075 bits in a long), an error will be reported at compile time.
1076
1077- Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage
1078 collection crashes and possibly other, unreported crashes.
1079
1080- Fixed a memory leak in _PyUnicode_Fini().
1081
1082Build issues
1083
1084- configure now accepts a --with-suffix option that specifies the
1085 executable suffix. This is useful for builds on Cygwin and Mac OS
1086 X, for example.
1087
1088- The mmap.PAGESIZE constant is now initialized using sysconf when
1089 possible, which eliminates a dependency on -lucb for Reliant UNIX.
1090
1091- The md5 file should now compile on all platforms.
1092
1093- The select module now compiles on platforms that do not define
1094 POLLRDNORM and related constants.
1095
1096- Darwin (Mac OS X): Initial support for static builds on this
1097 platform.
1098
1099- BeOS: A number of changes were made to the build and installation
1100 process. ar-fake now operates on a directory of object files.
1101 dl_export.h is gone, and its macros now appear on the mwcc command
1102 line during build on PPC BeOS.
1103
1104- Platform directory in lib/python2.0 is "plat-beos5" (or
1105 "plat-beos4", if building on BeOS 4.5), rather than "plat-beos".
1106
1107- Cygwin: Support for shared libraries, Tkinter, and sockets.
1108
1109- SunOS 4.1.4_JL: Fix test for directory existence in configure.
1110
1111Tools and other miscellany
1112
1113- Removed debugging prints from main used with freeze.
1114
1115- IDLE auto-indent no longer crashes when it encounters Unicode
1116 characters.
1117
1118What's new in 2.0 beta 2 (since beta 1)?
1119========================================
1120
1121Core language, builtins, and interpreter
1122
1123- Add support for unbounded ints in %d,i,u,x,X,o formats; for example
1124 "%d" % 2L**64 == "18446744073709551616".
1125
1126- Add -h and -V command line options to print the usage message and
1127 Python version number and exit immediately.
1128
1129- eval() and exec accept Unicode objects as code parameters.
1130
1131- getattr() and setattr() now also accept Unicode objects for the
1132 attribute name, which are converted to strings using the default
1133 encoding before lookup.
1134
1135- Multiplication on string and Unicode now does proper bounds
1136 checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated
1137 string is too long."
1138
1139- Better error message when continue is found in try statement in a
1140 loop.
1141
1142
1143Standard library and extensions
1144
1145- socket module: the OpenSSL code now adds support for RAND_status()
1146 and EGD (Entropy Gathering Device).
1147
1148- array: reverse() method of array now works. buffer_info() now does
1149 argument checking; it still takes no arguments.
1150
1151- asyncore/asynchat: Included most recent version from Sam Rushing.
1152
1153- cgi: Accept '&' or ';' as separator characters when parsing form data.
1154
1155- CGIHTTPServer: Now works on Windows (and perhaps even Mac).
1156
1157- ConfigParser: When reading the file, options spelled in upper case
1158 letters are now correctly converted to lowercase.
1159
1160- copy: Copy Unicode objects atomically.
1161
1162- cPickle: Fail gracefully when copy_reg can't be imported.
1163
1164- cStringIO: Implemented readlines() method.
1165
1166- dbm: Add get() and setdefault() methods to dbm object. Add constant
1167 `library' to module that names the library used. Added doc strings
1168 and method names to error messages. Uses configure to determine
1169 which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is
1170 now available options.
1171
1172- distutils: Update to version 0.9.3.
1173
1174- dl: Add several dl.RTLD_ constants.
1175
1176- fpectl: Now supported on FreeBSD.
1177
1178- gc: Add DEBUG_SAVEALL option. When enabled all garbage objects
1179 found by the collector will be saved in gc.garbage. This is useful
1180 for debugging a program that creates reference cycles.
1181
1182- httplib: Three changes: Restore support for set_debuglevel feature
1183 of HTTP class. Do not close socket on zero-length response. Do not
1184 crash when server sends invalid content-length header.
1185
1186- mailbox: Mailbox class conforms better to qmail specifications.
1187
1188- marshal: When reading a short, sign-extend on platforms where shorts
1189 are bigger than 16 bits. When reading a long, repair the unportable
1190 sign extension that was being done for 64-bit machines. (It assumed
1191 that signed right shift sign-extends.)
1192
1193- operator: Add contains(), invert(), __invert__() as aliases for
1194 __contains__(), inv(), and __inv__() respectively.
1195
1196- os: Add support for popen2() and popen3() on all platforms where
1197 fork() exists. (popen4() is still in the works.)
1198
1199- os: (Windows only:) Add startfile() function that acts like double-
1200 clicking on a file in Explorer (or passing the file name to the
1201 DOS "start" command).
1202
1203- os.path: (Windows, DOS:) Treat trailing colon correctly in
1204 os.path.join. os.path.join("a:", "b") yields "a:b".
1205
1206- pickle: Now raises ValueError when an invalid pickle that contains
1207 a non-string repr where a string repr was expected. This behavior
1208 matches cPickle.
1209
1210- posixfile: Remove broken __del__() method.
1211
1212- py_compile: support CR+LF line terminators in source file.
1213
1214- readline: Does not immediately exit when ^C is hit when readline and
1215 threads are configured. Adds definition of rl_library_version. (The
1216 latter addition requires GNU readline 2.2 or later.)
1217
1218- rfc822: Domain literals returned by AddrlistClass method
1219 getdomainliteral() are now properly wrapped in brackets.
1220
1221- site: sys.setdefaultencoding() should only be called in case the
1222 standard default encoding ("ascii") is changed. This saves quite a
1223 few cycles during startup since the first call to
1224 setdefaultencoding() will initialize the codec registry and the
1225 encodings package.
1226
1227- socket: Support for size hint in readlines() method of object returned
1228 by makefile().
1229
1230- sre: Added experimental expand() method to match objects. Does not
1231 use buffer interface on Unicode strings. Does not hang if group id
1232 is followed by whitespace.
1233
1234- StringIO: Size hint in readlines() is now supported as documented.
1235
1236- struct: Check ranges for bytes and shorts.
1237
1238- urllib: Improved handling of win32 proxy settings. Fixed quote and
1239 quote_plus functions so that the always encode a comma.
1240
1241- Tkinter: Image objects are now guaranteed to have unique ids. Set
1242 event.delta to zero if Tk version doesn't support mousewheel.
1243 Removed some debugging prints.
1244
1245- UserList: now implements __contains__().
1246
1247- webbrowser: On Windows, use os.startfile() instead of os.popen(),
1248 which works around a bug in Norton AntiVirus 2000 that leads directly
1249 to a Blue Screen freeze.
1250
1251- xml: New version detection code allows PyXML to override standard
1252 XML package if PyXML version is greater than 0.6.1.
1253
1254- xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom
1255 (conventional DOM), and xml.dom.pulldom, which allows building the DOM
1256 tree only for nodes which are sufficiently interesting to a specific
1257 application. Does not provide the HTML-specific extensions. Still
1258 undocumented.
1259
1260- xml.sax: SAX 2 support for Python, including all the handler
1261 interfaces needed to process XML 1.0 compliant XML. Some
1262 documentation is already available.
1263
1264- pyexpat: Renamed to xml.parsers.expat since this is part of the new,
1265 packagized XML support.
1266
1267
1268C API
1269
1270- Add three new convenience functions for module initialization --
1271 PyModule_AddObject(), PyModule_AddIntConstant(), and
1272 PyModule_AddStringConstant().
1273
1274- Cleaned up definition of NULL in C source code; all definitions were
1275 removed and add #error to Python.h if NULL isn't defined after
1276 #include of stdio.h.
1277
1278- Py_PROTO() macros that were removed in 2.0b1 have been restored for
1279 backwards compatibility (at the source level) with old extensions.
1280
1281- A wrapper API was added for signal() and sigaction(). Instead of
1282 either function, always use PyOS_getsig() to get a signal handler
1283 and PyOS_setsig() to set one. A new convenience typedef
1284 PyOS_sighandler_t is defined for the type of signal handlers.
1285
1286- Add PyString_AsStringAndSize() function that provides access to the
1287 internal data buffer and size of a string object -- or the default
1288 encoded version of a Unicode object.
1289
1290- PyString_Size() and PyString_AsString() accept Unicode objects.
1291
1292- The standard header <limits.h> is now included by Python.h (if it
1293 exists). INT_MAX and LONG_MAX will always be defined, even if
1294 <limits.h> is not available.
1295
1296- PyFloat_FromString takes a second argument, pend, that was
1297 effectively useless. It is now officially useless but preserved for
1298 backwards compatibility. If the pend argument is not NULL, *pend is
1299 set to NULL.
1300
1301- PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects
1302 for the attribute name. See note on getattr() above.
1303
1304- A few bug fixes to argument processing for Unicode.
1305 PyArg_ParseTupleAndKeywords() now accepts "es#" and "es".
1306 PyArg_Parse() special cases "s#" for Unicode objects; it returns a
1307 pointer to the default encoded string data instead of to the raw
1308 UTF-16.
1309
1310- Py_BuildValue accepts B format (for bgen-generated code).
1311
1312
1313Internals
1314
1315- On Unix, fix code for finding Python installation directory so that
1316 it works when argv[0] is a relative path.
1317
1318- Added a true unicode_internal_encode() function and fixed the
1319 unicode_internal_decode function() to support Unicode objects directly
1320 rather than by generating a copy of the object.
1321
1322- Several of the internal Unicode tables are much smaller now, and
1323 the source code should be much friendlier to weaker compilers.
1324
1325- In the garbage collector: Fixed bug in collection of tuples. Fixed
1326 bug that caused some instances to be removed from the container set
1327 while they were still live. Fixed parsing in gc.set_debug() for
1328 platforms where sizeof(long) > sizeof(int).
1329
1330- Fixed refcount problem in instance deallocation that only occurred
1331 when Py_REF_DEBUG was defined and Py_TRACE_REFS was not.
1332
1333- On Windows, getpythonregpath is now protected against null data in
1334 registry key.
1335
1336- On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race
1337 condition.
1338
1339
1340Build and platform-specific issues
1341
1342- Better support of GNU Pth via --with-pth configure option.
1343
1344- Python/C API now properly exposed to dynamically-loaded extension
1345 modules on Reliant UNIX.
1346
1347- Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c:
1348 Don't define MS_SYNC to be zero when it is undefined. Added missing
1349 prototypes in posixmodule.c.
1350
1351- Improved support for HP-UX build. Threads should now be correctly
1352 configured (on HP-UX 10.20 and 11.00).
1353
1354- Fix largefile support on older NetBSD systems and OpenBSD by adding
1355 define for TELL64.
1356
1357
1358Tools and other miscellany
1359
1360- ftpmirror: Call to main() is wrapped in if __name__ == "__main__".
1361
1362- freeze: The modulefinder now works with 2.0 opcodes.
1363
1364- IDLE:
1365 Move hackery of sys.argv until after the Tk instance has been
1366 created, which allows the application-specific Tkinter
1367 initialization to be executed if present; also pass an explicit
1368 className parameter to the Tk() constructor.
1369
1370
1371What's new in 2.0 beta 1?
1372=========================
1373
1374Source Incompatibilities
1375------------------------
1376
1377None. Note that 1.6 introduced several incompatibilities with 1.5.2,
1378such as single-argument append(), connect() and bind(), and changes to
1379str(long) and repr(float).
1380
1381
1382Binary Incompatibilities
1383------------------------
1384
1385- Third party extensions built for Python 1.5.x or 1.6 cannot be used
1386with Python 2.0; these extensions will have to be rebuilt for Python
13872.0.
1388
1389- On Windows, attempting to import a third party extension built for
1390Python 1.5.x or 1.6 results in an immediate crash; there's not much we
1391can do about this. Check your PYTHONPATH environment variable!
1392
1393- Python bytecode files (*.pyc and *.pyo) are not compatible between
1394releases.
1395
1396
1397Overview of Changes Since 1.6
1398-----------------------------
1399
1400There are many new modules (including brand new XML support through
1401the xml package, and i18n support through the gettext module); a list
1402of all new modules is included below. Lots of bugs have been fixed.
1403
1404The process for making major new changes to the language has changed
1405since Python 1.6. Enhancements must now be documented by a Python
1406Enhancement Proposal (PEP) before they can be accepted.
1407
1408There are several important syntax enhancements, described in more
1409detail below:
1410
1411 - Augmented assignment, e.g. x += 1
1412
1413 - List comprehensions, e.g. [x**2 for x in range(10)]
1414
1415 - Extended import statement, e.g. import Module as Name
1416
1417 - Extended print statement, e.g. print >> file, "Hello"
1418
1419Other important changes:
1420
1421 - Optional collection of cyclical garbage
1422
1423Python Enhancement Proposal (PEP)
1424---------------------------------
1425
1426PEP stands for Python Enhancement Proposal. A PEP is a design
1427document providing information to the Python community, or describing
1428a new feature for Python. The PEP should provide a concise technical
1429specification of the feature and a rationale for the feature.
1430
1431We intend PEPs to be the primary mechanisms for proposing new
1432features, for collecting community input on an issue, and for
1433documenting the design decisions that have gone into Python. The PEP
1434author is responsible for building consensus within the community and
1435documenting dissenting opinions.
1436
1437The PEPs are available at http://python.sourceforge.net/peps/.
1438
1439Augmented Assignment
1440--------------------
1441
1442This must have been the most-requested feature of the past years!
1443Eleven new assignment operators were added:
1444
1445 += -= *= /= %= **= <<= >>= &= ^= |=
1446
1447For example,
1448
1449 A += B
1450
1451is similar to
1452
1453 A = A + B
1454
1455except that A is evaluated only once (relevant when A is something
1456like dict[index].attr).
1457
1458However, if A is a mutable object, A may be modified in place. Thus,
1459if A is a number or a string, A += B has the same effect as A = A+B
1460(except A is only evaluated once); but if a is a list, A += B has the
1461same effect as A.extend(B)!
1462
1463Classes and built-in object types can override the new operators in
1464order to implement the in-place behavior; the not-in-place behavior is
1465used automatically as a fallback when an object doesn't implement the
1466in-place behavior. For classes, the method name is derived from the
1467method name for the corresponding not-in-place operator by inserting
1468an 'i' in front of the name, e.g. __iadd__ implements in-place
1469__add__.
1470
1471Augmented assignment was implemented by Thomas Wouters.
1472
1473
1474List Comprehensions
1475-------------------
1476
1477This is a flexible new notation for lists whose elements are computed
1478from another list (or lists). The simplest form is:
1479
1480 [<expression> for <variable> in <sequence>]
1481
1482For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
1483This is more efficient than a for loop with a list.append() call.
1484
1485You can also add a condition:
1486
1487 [<expression> for <variable> in <sequence> if <condition>]
1488
1489For example, [w for w in words if w == w.lower()] would yield the list
1490of words that contain no uppercase characters. This is more efficient
1491than a for loop with an if statement and a list.append() call.
1492
1493You can also have nested for loops and more than one 'if' clause. For
1494example, here's a function that flattens a sequence of sequences::
1495
1496 def flatten(seq):
1497 return [x for subseq in seq for x in subseq]
1498
1499 flatten([[0], [1,2,3], [4,5], [6,7,8,9], []])
1500
1501This prints
1502
1503 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
1504
1505List comprehensions originated as a patch set from Greg Ewing; Skip
1506Montanaro and Thomas Wouters also contributed. Described by PEP 202.
1507
1508
1509Extended Import Statement
1510-------------------------
1511
1512Many people have asked for a way to import a module under a different
1513name. This can be accomplished like this:
1514
1515 import foo
1516 bar = foo
1517 del foo
1518
1519but this common idiom gets old quickly. A simple extension of the
1520import statement now allows this to be written as follows:
1521
1522 import foo as bar
1523
1524There's also a variant for 'from ... import':
1525
1526 from foo import bar as spam
1527
1528This also works with packages; e.g. you can write this:
1529
1530 import test.regrtest as regrtest
1531
1532Note that 'as' is not a new keyword -- it is recognized only in this
1533context (this is only possible because the syntax for the import
1534statement doesn't involve expressions).
1535
1536Implemented by Thomas Wouters. Described by PEP 221.
1537
1538
1539Extended Print Statement
1540------------------------
1541
1542Easily the most controversial new feature, this extension to the print
1543statement adds an option to make the output go to a different file
1544than the default sys.stdout.
1545
1546For example, to write an error message to sys.stderr, you can now
1547write:
1548
1549 print >> sys.stderr, "Error: bad dog!"
1550
1551As a special feature, if the expression used to indicate the file
1552evaluates to None, the current value of sys.stdout is used. Thus:
1553
1554 print >> None, "Hello world"
1555
1556is equivalent to
1557
1558 print "Hello world"
1559
1560Design and implementation by Barry Warsaw. Described by PEP 214.
1561
1562
1563Optional Collection of Cyclical Garbage
1564---------------------------------------
1565
1566Python is now equipped with a garbage collector that can hunt down
1567cyclical references between Python objects. It's no replacement for
1568reference counting; in fact, it depends on the reference counts being
1569correct, and decides that a set of objects belong to a cycle if all
1570their reference counts can be accounted for from their references to
1571each other. This devious scheme was first proposed by Eric Tiedemann,
1572and brought to implementation by Neil Schemenauer.
1573
1574There's a module "gc" that lets you control some parameters of the
1575garbage collection. There's also an option to the configure script
1576that lets you enable or disable the garbage collection. In 2.0b1,
1577it's on by default, so that we (hopefully) can collect decent user
1578experience with this new feature. There are some questions about its
1579performance. If it proves to be too much of a problem, we'll turn it
1580off by default in the final 2.0 release.
1581
1582
1583Smaller Changes
1584---------------
1585
1586A new function zip() was added. zip(seq1, seq2, ...) is equivalent to
1587map(None, seq1, seq2, ...) when the sequences have the same length;
1588i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When
1589the lists are not all the same length, the shortest list wins:
1590zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201.
1591
1592sys.version_info is a tuple (major, minor, micro, level, serial).
1593
1594Dictionaries have an odd new method, setdefault(key, default).
1595dict.setdefault(key, default) returns dict[key] if it exists; if not,
1596it sets dict[key] to default and returns that value. Thus:
1597
1598 dict.setdefault(key, []).append(item)
1599
1600does the same work as this common idiom:
1601
1602 if not dict.has_key(key):
1603 dict[key] = []
1604 dict[key].append(item)
1605
1606There are two new variants of SyntaxError that are raised for
1607indentation-related errors: IndentationError and TabError.
1608
1609Changed \x to consume exactly two hex digits; see PEP 223. Added \U
1610escape that consumes exactly eight hex digits.
1611
1612The limits on the size of expressions and file in Python source code
1613have been raised from 2**16 to 2**32. Previous versions of Python
1614were limited because the maximum argument size the Python VM accepted
1615was 2**16. This limited the size of object constructor expressions,
1616e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This
1617limit was raised thanks to a patch by Charles Waldman that effectively
1618fixes the problem. It is now much more likely that you will be
1619limited by available memory than by an arbitrary limit in Python.
1620
1621The interpreter's maximum recursion depth can be modified by Python
1622programs using sys.getrecursionlimit and sys.setrecursionlimit. This
1623limit is the maximum number of recursive calls that can be made by
1624Python code. The limit exists to prevent infinite recursion from
1625overflowing the C stack and causing a core dump. The default value is
16261000. The maximum safe value for a particular platform can be found
1627by running Misc/find_recursionlimit.py.
1628
1629New Modules and Packages
1630------------------------
1631
1632atexit - for registering functions to be called when Python exits.
1633
1634imputil - Greg Stein's alternative API for writing custom import
1635hooks.
1636
1637pyexpat - an interface to the Expat XML parser, contributed by Paul
1638Prescod.
1639
1640xml - a new package with XML support code organized (so far) in three
1641subpackages: xml.dom, xml.sax, and xml.parsers. Describing these
1642would fill a volume. There's a special feature whereby a
1643user-installed package named _xmlplus overrides the standard
1644xmlpackage; this is intended to give the XML SIG a hook to distribute
1645backwards-compatible updates to the standard xml package.
1646
1647webbrowser - a platform-independent API to launch a web browser.
1648
1649
1650Changed Modules
1651---------------
1652
1653array -- new methods for array objects: count, extend, index, pop, and
1654remove
1655
1656binascii -- new functions b2a_hex and a2b_hex that convert between
1657binary data and its hex representation
1658
1659calendar -- Many new functions that support features including control
1660over which day of the week is the first day, returning strings instead
1661of printing them. Also new symbolic constants for days of week,
1662e.g. MONDAY, ..., SUNDAY.
1663
1664cgi -- FieldStorage objects have a getvalue method that works like a
1665dictionary's get method and returns the value attribute of the object.
1666
1667ConfigParser -- The parser object has new methods has_option,
1668remove_section, remove_option, set, and write. They allow the module
1669to be used for writing config files as well as reading them.
1670
1671ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now
1672optionally support the RFC 959 REST command.
1673
1674gzip -- readline and readlines now accept optional size arguments
1675
1676httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See
1677the module doc strings for details.
1678
1679locale -- implement getdefaultlocale for Win32 and Macintosh
1680
1681marshal -- no longer dumps core when marshaling deeply nested or
1682recursive data structures
1683
1684os -- new functions isatty, seteuid, setegid, setreuid, setregid
1685
1686os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3
1687support under Unix.
1688
1689os/pty -- support for openpty and forkpty
1690
1691os.path -- fix semantics of os.path.commonprefix
1692
1693smtplib -- support for sending very long messages
1694
1695socket -- new function getfqdn()
1696
1697readline -- new functions to read, write and truncate history files.
1698The readline section of the library reference manual contains an
1699example.
1700
1701select -- add interface to poll system call
1702
1703shutil -- new copyfileobj function
1704
1705SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the
1706HTTP server.
1707
1708Tkinter -- optimization of function flatten
1709
1710urllib -- scans environment variables for proxy configuration,
1711e.g. http_proxy.
1712
1713whichdb -- recognizes dumbdbm format
1714
1715
1716Obsolete Modules
1717----------------
1718
1719None. However note that 1.6 made a whole slew of modules obsolete:
1720stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail,
1721poly, zmod, strop, util, whatsound.
1722
1723
1724Changed, New, Obsolete Tools
1725----------------------------
1726
1727None.
1728
1729
1730C-level Changes
1731---------------
1732
1733Several cleanup jobs were carried out throughout the source code.
1734
1735All C code was converted to ANSI C; we got rid of all uses of the
1736Py_PROTO() macro, which makes the header files a lot more readable.
1737
1738Most of the portability hacks were moved to a new header file,
1739pyport.h; several other new header files were added and some old
1740header files were removed, in an attempt to create a more rational set
1741of header files. (Few of these ever need to be included explicitly;
1742they are all included by Python.h.)
1743
1744Trent Mick ensured portability to 64-bit platforms, under both Linux
1745and Win64, especially for the new Intel Itanium processor. Mick also
1746added large file support for Linux64 and Win64.
1747
1748The C APIs to return an object's size have been update to consistently
1749use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In
1750previous versions, the abstract interfaces used PyXXX_Length and the
1751concrete interfaces used PyXXX_Size. The old names,
1752e.g. PyObject_Length, are still available for backwards compatibility
1753at the API level, but are deprecated.
1754
1755The PyOS_CheckStack function has been implemented on Windows by
1756Fredrik Lundh. It prevents Python from failing with a stack overflow
1757on Windows.
1758
1759The GC changes resulted in creation of two new slots on object,
1760tp_traverse and tp_clear. The augmented assignment changes result in
1761the creation of a new slot for each in-place operator.
1762
1763The GC API creates new requirements for container types implemented in
1764C extension modules. See Include/objimpl.h for details.
1765
1766PyErr_Format has been updated to automatically calculate the size of
1767the buffer needed to hold the formatted result string. This change
1768prevents crashes caused by programmer error.
1769
1770New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable.
1771
1772PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions
1773that are the same as their non-Ex counterparts except they take an
1774extra flag argument that tells them to close the file when done.
1775
1776XXX There were other API changes that should be fleshed out here.
1777
1778
1779Windows Changes
1780---------------
1781
1782New popen2/popen3/peopen4 in os module (see Changed Modules above).
1783
1784os.popen is much more usable on Windows 95 and 98. See Microsoft
1785Knowledge Base article Q150956. The Win9x workaround described there
1786is implemented by the new w9xpopen.exe helper in the root of your
1787Python installation. Note that Python uses this internally; it is not
1788a standalone program.
1789
1790Administrator privileges are no longer required to install Python
1791on Windows NT or Windows 2000. If you have administrator privileges,
1792Python's registry info will be written under HKEY_LOCAL_MACHINE.
1793Otherwise the installer backs off to writing Python's registry info
1794under HKEY_CURRENT_USER. The latter is sufficient for all "normal"
1795uses of Python, but will prevent some advanced uses from working
1796(for example, running a Python script as an NT service, or possibly
1797from CGI).
1798
1799[This was new in 1.6] The installer no longer runs a separate Tcl/Tk
1800installer; instead, it installs the needed Tcl/Tk files directly in the
1801Python directory. If you already have a Tcl/Tk installation, this
1802wastes some disk space (about 4 Megs) but avoids problems with
1803conflicting Tcl/Tk installations, and makes it much easier for Python
1804to ensure that Tcl/Tk can find all its files.
1805
1806[This was new in 1.6] The Windows installer now installs by default in
1807\Python20\ on the default volume, instead of \Program Files\Python-2.0\.
1808
1809
1810Updates to the changes between 1.5.2 and 1.6
1811--------------------------------------------
1812
1813The 1.6 NEWS file can't be changed after the release is done, so here
1814is some late-breaking news:
1815
1816New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(),
1817and changes to getlocale() and setlocale().
1818
1819The new module is now enabled per default.
1820
1821It is not true that the encodings codecs cannot be used for normal
1822strings: the string.encode() (which is also present on 8-bit strings
1823!) allows using them for 8-bit strings too, e.g. to convert files from
1824cp1252 (Windows) to latin-1 or vice-versa.
1825
1826Japanese codecs are available from Tamito KAJIYAMA:
1827http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/
1828
1829
1830======================================================================
1831
1832
Guido van Rossumf2eac992000-09-04 17:24:24 +00001833=======================================
1834==> Release 1.6 (September 5, 2000) <==
1835=======================================
1836
Guido van Rossuma598c932000-09-04 16:26:03 +00001837What's new in release 1.6?
1838==========================
1839
1840Below is a list of all relevant changes since release 1.5.2.
1841
1842
1843Source Incompatibilities
1844------------------------
1845
1846Several small incompatible library changes may trip you up:
1847
1848 - The append() method for lists can no longer be invoked with more
1849 than one argument. This used to append a single tuple made out of
1850 all arguments, but was undocumented. To append a tuple, use
1851 e.g. l.append((a, b, c)).
1852
1853 - The connect(), connect_ex() and bind() methods for sockets require
1854 exactly one argument. Previously, you could call s.connect(host,
1855 port), but this was undocumented. You must now write
1856 s.connect((host, port)).
1857
1858 - The str() and repr() functions are now different more often. For
1859 long integers, str() no longer appends a 'L'. Thus, str(1L) == '1',
1860 which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
1861 For floats, repr() now gives 17 digits of precision, to ensure no
1862 precision is lost (on all current hardware).
1863
1864 - The -X option is gone. Built-in exceptions are now always
1865 classes. Many more library modules also have been converted to
1866 class-based exceptions.
1867
1868
1869Binary Incompatibilities
1870------------------------
1871
1872- Third party extensions built for Python 1.5.x cannot be used with
1873Python 1.6; these extensions will have to be rebuilt for Python 1.6.
1874
1875- On Windows, attempting to import a third party extension built for
1876Python 1.5.x results in an immediate crash; there's not much we can do
1877about this. Check your PYTHONPATH environment variable!
1878
1879
1880Overview of Changes since 1.5.2
1881-------------------------------
1882
1883For this overview, I have borrowed from the document "What's New in
1884Python 2.0" by Andrew Kuchling and Moshe Zadka:
1885http://starship.python.net/crew/amk/python/writing/new-python/.
1886
1887There are lots of new modules and lots of bugs have been fixed. A
1888list of all new modules is included below.
1889
1890Probably the most pervasive change is the addition of Unicode support.
1891We've added a new fundamental datatype, the Unicode string, a new
1892build-in function unicode(), an numerous C APIs to deal with Unicode
1893and encodings. See the file Misc/unicode.txt for details, or
1894http://starship.python.net/crew/lemburg/unicode-proposal.txt.
1895
1896Two other big changes, related to the Unicode support, are the
1897addition of string methods and (yet another) new regular expression
1898engine.
1899
1900 - String methods mean that you can now say s.lower() etc. instead of
1901 importing the string module and saying string.lower(s) etc. One
1902 peculiarity is that the equivalent of string.join(sequence,
1903 delimiter) is delimiter.join(sequence). Use " ".join(sequence) for
1904 the effect of string.join(sequence); to make this more readable, try
1905 space=" " first. Note that the maxsplit argument defaults in
1906 split() and replace() have changed from 0 to -1.
1907
1908 - The new regular expression engine, SRE by Fredrik Lundh, is fully
1909 backwards compatible with the old engine, and is in fact invoked
1910 using the same interface (the "re" module). You can explicitly
1911 invoke the old engine by import pre, or the SRE engine by importing
1912 sre. SRE is faster than pre, and supports Unicode (which was the
1913 main reason to put effort in yet another new regular expression
1914 engine -- this is at least the fourth!).
1915
1916
1917Other Changes
1918-------------
1919
1920Other changes that won't break code but are nice to know about:
1921
1922Deleting objects is now safe even for deeply nested data structures.
1923
1924Long/int unifications: long integers can be used in seek() calls, as
1925slice indexes.
1926
1927String formatting (s % args) has a new formatting option, '%r', which
1928acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
1929alpha 1.)
1930
1931Greg Ward's "distutils" package is included: this will make
1932installing, building and distributing third party packages much
1933simpler.
1934
1935There's now special syntax that you can use instead of the apply()
1936function. f(*args, **kwds) is equivalent to apply(f, args, kwds).
1937You can also use variations f(a1, a2, *args, **kwds) and you can leave
1938one or the other out: f(*args), f(**kwds).
1939
1940The built-ins int() and long() take an optional second argument to
1941indicate the conversion base -- of course only if the first argument
1942is a string. This makes string.atoi() and string.atol() obsolete.
1943(string.atof() was already obsolete).
1944
1945When a local variable is known to the compiler but undefined when
1946used, a new exception UnboundLocalError is raised. This is a class
1947derived from NameError so code catching NameError should still work.
1948The purpose is to provide better diagnostics in the following example:
1949 x = 1
1950 def f():
1951 print x
1952 x = x+1
1953This used to raise a NameError on the print statement, which confused
1954even experienced Python programmers (especially if there are several
1955hundreds of lines of code between the reference and the assignment to
1956x :-).
1957
1958You can now override the 'in' operator by defining a __contains__
1959method. Note that it has its arguments backwards: x in a causes
1960a.__contains__(x) to be called. That's why the name isn't __in__.
1961
1962The exception AttributeError will have a more friendly error message,
1963e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may
1964<b>break code</b> that expects the message to be exactly the attribute
1965name.
1966
1967
1968New Modules in 1.6
1969------------------
1970
1971UserString - base class for deriving from the string type.
1972
1973distutils - tools for distributing Python modules.
1974
1975robotparser - parse a robots.txt file, for writing web spiders.
1976(Moved from Tools/webchecker/.)
1977
1978linuxaudiodev - audio for Linux.
1979
1980mmap - treat a file as a memory buffer. (Windows and Unix.)
1981
1982sre - regular expressions (fast, supports unicode). Currently, this
1983code is very rough. Eventually, the re module will be reimplemented
1984using sre (without changes to the re API).
1985
1986filecmp - supersedes the old cmp.py and dircmp.py modules.
1987
1988tabnanny - check Python sources for tab-width dependance. (Moved from
1989Tools/scripts/.)
1990
1991urllib2 - new and improved but incompatible version of urllib (still
1992experimental).
1993
1994zipfile - read and write zip archives.
1995
1996codecs - support for Unicode encoders/decoders.
1997
1998unicodedata - provides access to the Unicode 3.0 database.
1999
2000_winreg - Windows registry access.
2001
2002encodings - package which provides a large set of standard codecs --
2003currently only for the new Unicode support. It has a drop-in extension
2004mechanism which allows you to add new codecs by simply copying them
2005into the encodings package directory. Asian codec support will
2006probably be made available as separate distribution package built upon
2007this technique and the new distutils package.
2008
2009
2010Changed Modules
2011---------------
2012
2013readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
2014chunk, wave, random, shelve, nntplib - minor enhancements.
2015
2016socket, httplib, urllib - optional OpenSSL support (Unix only).
2017
2018_tkinter - support for 8.0 up to 8.3. Support for versions older than
20198.0 has been dropped.
2020
2021string - most of this module is deprecated now that strings have
2022methods. This no longer uses the built-in strop module, but takes
2023advantage of the new string methods to provide transparent support for
2024both Unicode and ordinary strings.
2025
2026
2027Changes on Windows
2028------------------
2029
2030The installer no longer runs a separate Tcl/Tk installer; instead, it
2031installs the needed Tcl/Tk files directly in the Python directory. If
2032you already have a Tcl/Tk installation, this wastes some disk space
2033(about 4 Megs) but avoids problems with conflincting Tcl/Tk
2034installations, and makes it much easier for Python to ensure that
2035Tcl/Tk can find all its files. Note: the alpha installers don't
2036include the documentation.
2037
2038The Windows installer now installs by default in \Python16\ on the
2039default volume, instead of \Program Files\Python-1.6\.
2040
2041
2042Changed Tools
2043-------------
2044
2045IDLE - complete overhaul. See the <a href="../idle/">IDLE home
2046page</a> for more information. (Python 1.6 alpha 1 will come with
2047IDLE 0.6.)
2048
2049Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message
2050text extraction tool used for internationalizing applications written
2051in Python.
2052
2053
2054Obsolete Modules
2055----------------
2056
2057stdwin and everything that uses it. (Get Python 1.5.2 if you need
2058it. :-)
2059
2060soundex. (Skip Montanaro has a version in Python but it won't be
2061included in the Python release.)
2062
2063cmp, cmpcache, dircmp. (Replaced by filecmp.)
2064
2065dump. (Use pickle.)
2066
2067find. (Easily coded using os.walk().)
2068
2069grep. (Not very useful as a library module.)
2070
2071packmail. (No longer has any use.)
2072
2073poly, zmod. (These were poor examples at best.)
2074
2075strop. (No longer needed by the string module.)
2076
2077util. (This functionality was long ago built in elsewhere).
2078
2079whatsound. (Use sndhdr.)
2080
2081
2082Detailed Changes from 1.6b1 to 1.6
2083----------------------------------
2084
2085- Slight changes to the CNRI license. A copyright notice has been
2086added; the requirement to indicate the nature of modifications now
2087applies when making a derivative work available "to others" instead of
2088just "to the public"; the version and date are updated. The new
2089license has a new handle.
2090
2091- Added the Tools/compiler package. This is a project led by Jeremy
2092Hylton to write the Python bytecode generator in Python.
2093
2094- The function math.rint() is removed.
2095
2096- In Python.h, "#define _GNU_SOURCE 1" was added.
2097
2098- Version 0.9.1 of Greg Ward's distutils is included (instead of
2099version 0.9).
2100
2101- A new version of SRE is included. It is more stable, and more
2102compatible with the old RE module. Non-matching ranges are indicated
2103by -1, not None. (The documentation said None, but the PRE
2104implementation used -1; changing to None would break existing code.)
2105
2106- The winreg module has been renamed to _winreg. (There are plans for
2107a higher-level API called winreg, but this has not yet materialized in
2108a form that is acceptable to the experts.)
2109
2110- The _locale module is enabled by default.
2111
2112- Fixed the configuration line for the _curses module.
2113
2114- A few crashes have been fixed, notably <file>.writelines() with a
2115list containing non-string objects would crash, and there were
2116situations where a lost SyntaxError could dump core.
2117
2118- The <list>.extend() method now accepts an arbitrary sequence
2119argument.
2120
2121- If __str__() or __repr__() returns a Unicode object, this is
2122converted to an 8-bit string.
2123
2124- Unicode string comparisons is no longer aware of UTF-16
2125encoding peculiarities; it's a straight 16-bit compare.
2126
2127- The Windows installer now installs the LICENSE file and no longer
2128registers the Python DLL version in the registry (this is no longer
2129needed). It now uses Tcl/Tk 8.3.2.
2130
2131- A few portability problems have been fixed, in particular a
2132compilation error involving socklen_t.
2133
2134- The PC configuration is slightly friendlier to non-Microsoft
2135compilers.
2136
2137
2138======================================================================
2139
2140
Guido van Rossumf2eac992000-09-04 17:24:24 +00002141======================================
2142==> Release 1.5.2 (April 13, 1999) <==
2143======================================
2144
Guido van Rossum2001da42000-09-01 22:26:44 +00002145From 1.5.2c1 to 1.5.2 (final)
2146=============================
2147
2148Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2149
2150 * PCbuild/python15.wse: Bump version to 1.5.2 (final)
2151
2152 * PCbuild/python15.dsp: Added shamodule.c
2153
2154 * PC/config.c: Added sha module!
2155
2156 * README, Include/patchlevel.h: Prepare for final release.
2157
2158 * Misc/ACKS:
2159 More (Cameron Laird is honorary; the others are 1.5.2c1 testers).
2160
2161 * Python/thread_solaris.h:
2162 While I can't really test this thoroughly, Pat Knight and the Solaris
2163 man pages suggest that the proper thing to do is to add THR_NEW_LWP to
2164 the flags on thr_create(), and that there really isn't a downside, so
2165 I'll do that.
2166
2167 * Misc/ACKS:
2168 Bunch of new names who helped iron out the last wrinkles of 1.5.2.
2169
2170 * PC/python_nt.rc:
2171 Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3.
2172 (I can't even display this on NT, maybe Win/98 can?)
2173
2174 * Lib/pstats.py:
2175 Fix mysterious references to jprofile that were in the source since
2176 its creation. I'm assuming these were once valid references to "Jim
2177 Roskind's profile"...
2178
2179 * Lib/Attic/threading_api.py:
2180 Removed; since long subsumed in Doc/lib/libthreading.tex
2181
2182 * Modules/socketmodule.c:
2183 Put back __osf__ support for gethostbyname_r(); the real bug was that
2184 it was being used even without threads. This of course might be an
2185 all-platform problem so now we only use the _r variant when we are
2186 using threads.
2187
2188Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2189
2190 * Modules/cPickle.c:
2191 Fix accidentally reversed NULL test in load_mark(). Suggested by
2192 Tamito Kajiyama. (This caused a bug only on platforms where malloc(0)
2193 returns NULL.)
2194
2195 * README:
2196 Add note about popen2 problem on Linux noticed by Pablo Bleyer.
2197
2198 * README: Add note about -D_REENTRANT for HP-UX 10.20.
2199
2200 * Modules/Makefile.pre.in: 'clean' target should remove hassignal.
2201
2202 * PC/Attic/vc40.mak, PC/readme.txt:
2203 Remove all VC++ info (except VC 1.5) from readme.txt;
2204 remove the VC++ 4.0 project file; remove the unused _tkinter extern defs.
2205
2206 * README: Clarify PC build instructions (point to PCbuild).
2207
2208 * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port).
2209
2210 * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py:
2211 Forgot to add this file. CDROM device parameters.
2212
2213 * Lib/gzip.py: Two different changes.
2214
2215 1. Jack Jansen reports that on the Mac, the time may be negative, and
2216 solves this by adding a write32u() function that writes an unsigned
2217 long.
2218
2219 2. On 64-bit platforms the CRC comparison fails; I've fixed this by
2220 casting both values to be compared to "unsigned long" i.e. modulo
2221 0x100000000L.
2222
2223Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2224
2225 * PC/Attic/_tkinter.def: No longer needed.
2226
2227 * Misc/ACKS: Correct missed character in Andrew Dalke's name.
2228
2229 * README: Add DEC Ultrix notes (from Donn Cave's email).
2230
2231 * configure: The usual
2232
2233 * configure.in:
2234 Quote a bunch of shell variables used in test, related to long-long.
2235
2236 * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c:
2237 casts for picky compilers.
2238
2239 * Modules/socketmodule.c:
2240 3-arg gethostbyname_r doesn't really work on OSF/1.
2241
2242 * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py:
2243 Avoid totally empty files.
2244
2245Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2246
2247 * Tools/scripts/fixps.py: Use re instead of regex.
2248 Don't rewrite the file in place.
2249 (Reported by Andy Dustman.)
2250
2251 * Lib/netrc.py, Lib/shlex.py: Get rid of #! line
2252
2253Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2254
2255 * PCbuild/python15.wse: Use the Tcl 8.0.5 installer.
2256 Add a variable %_TCL_% that makes it easier to switch to a different version.
2257
2258
2259======================================================================
2260
2261
2262From 1.5.2b2 to 1.5.2c1
2263=======================
2264
2265Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2266
2267 * PCbuild/python15.wse:
2268 Release 1.5.2c1. Add IDLE and Uninstall to program group.
2269 Don't distribute zlib.dll. Tweak some comments.
2270
2271 * PCbuild/zlib.dsp: Now using static zlib 1.1.3
2272
2273 * Lib/dos-8x3/userdict.py, Lib/dos-8x3/userlist.py, Lib/dos-8x3/test_zli.py, Lib/dos-8x3/test_use.py, Lib/dos-8x3/test_pop.py, Lib/dos-8x3/test_pic.py, Lib/dos-8x3/test_ntp.py, Lib/dos-8x3/test_gzi.py, Lib/dos-8x3/test_fcn.py, Lib/dos-8x3/test_cpi.py, Lib/dos-8x3/test_bsd.py, Lib/dos-8x3/posixfil.py, Lib/dos-8x3/mimetype.py, Lib/dos-8x3/nturl2pa.py, Lib/dos-8x3/compilea.py, Lib/dos-8x3/exceptio.py, Lib/dos-8x3/basehttp.py:
2274 The usual
2275
2276 * Include/patchlevel.h: Release 1.5.2c1
2277
2278 * README: Release 1.5.2c1.
2279
2280 * Misc/NEWS: News for the 1.5.2c1 release.
2281
2282 * Lib/test/test_strftime.py:
2283 On Windows, we suddenly find, strftime() may return "" for an
2284 unsupported format string. (I guess this is because the logic for
2285 deciding whether to reallocate the buffer or not has been improved.)
2286 This caused the test code to crash on result[0]. Fix this by assuming
2287 an empty result also means the format is not supported.
2288
2289 * Demo/tkinter/matt/window-creation-w-location.py:
2290 This demo imported some private code from Matt. Make it cripple along.
2291
2292 * Lib/lib-tk/Tkinter.py:
2293 Delete an accidentally checked-in feature that actually broke more
2294 than was worth it: when deleting a canvas item, it would try to
2295 automatically delete the bindings for that item. Since there's
2296 nothing that says you can't reuse the tag and still have the bindings,
2297 this is not correct. Also, it broke at least one demo
2298 (Demo/tkinter/matt/rubber-band-box-demo-1.py).
2299
2300 * Python/thread_wince.h: Win/CE thread support by Mark Hammond.
2301
2302Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2303
2304 * Modules/zlibmodule.c:
2305 Patch by Andrew Kuchling to unflush() (flush() for deflating).
2306 Without this, if inflate() returned Z_BUF_ERROR asking for more output
2307 space, we would report the error; now, we increase the buffer size and
2308 try again, just as for Z_OK.
2309
2310 * Lib/test/test_gzip.py: Use binary mode for all gzip files we open.
2311
2312 * Tools/idle/ChangeLog: New change log.
2313
2314 * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version.
2315
2316 * Python/pythonrun.c:
2317 Alas, get rid of the Win specific hack to ask the user to press Return
2318 before exiting when an error happened. This didn't work right when
2319 Python is invoked from a daemon.
2320
2321 * Tools/idle/idlever.py: Version bump awaiting impending new release.
2322 (Not much has changed :-( )
2323
2324 * Lib/lib-tk/Tkinter.py:
2325 lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
2326 so the preferred name for them is tag_lower, tag_raise
2327 (similar to tag_bind, and similar to the Text widget);
2328 unfortunately can't delete the old ones yet (maybe in 1.6)
2329
2330 * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c:
2331 Changes by Mark Hammond for Windows CE. Mostly of the form
2332 #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>.
2333
2334 * Python/bltinmodule.c:
2335 Remove unused variable from complex_from_string() code.
2336
2337 * Include/patchlevel.h:
2338 Add the possibility of a gamma release (release candidate).
2339 Add '+' to string version number to indicate we're beyond b2 now.
2340
2341 * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x.
2342
2343 * Lib/smtplib.py: Changes by Per Cederquist and The Dragon.
2344
2345 Per writes:
2346
2347 """
2348 The application where Signum Support uses smtplib needs to be able to
2349 report good error messages to the user when sending email fails. To
2350 help in diagnosing problems it is useful to be able to report the
2351 entire message sent by the server, not only the SMTP error code of the
2352 offending command.
2353
2354 A lot of the functions in sendmail.py unfortunately discards the
2355 message, leaving only the code. The enclosed patch fixes that
2356 problem.
2357
2358 The enclosed patch also introduces a base class for exceptions that
2359 include an SMTP error code and error message, and make the code and
2360 message available on separate attributes, so that surrounding code can
2361 deal with them in whatever way it sees fit. I've also added some
2362 documentation to the exception classes.
2363
2364 The constructor will now raise an exception if it cannot connect to
2365 the SMTP server.
2366
2367 The data() method will raise an SMTPDataError if it doesn't receive
2368 the expected 354 code in the middle of the exchange.
2369
2370 According to section 5.2.10 of RFC 1123 a smtp client must accept "any
2371 text, including no text at all" after the error code. If the response
2372 of a HELO command contains no text self.helo_resp will be set to the
2373 empty string (""). The patch fixes the test in the sendmail() method
2374 so that helo_resp is tested against None; if it has the empty string
2375 as value the sendmail() method would invoke the helo() method again.
2376
2377 The code no longer accepts a -1 reply from the ehlo() method in
2378 sendmail().
2379
2380 [Text about removing SMTPRecipientsRefused deleted --GvR]
2381 """
2382
2383 and also:
2384
2385 """
2386 smtplib.py appends an extra blank line to the outgoing mail if the
2387 `msg' argument to the sendmail method already contains a trailing
2388 newline. This patch should fix the problem.
2389 """
2390
2391 The Dragon writes:
2392
2393 """
2394 Mostly I just re-added the SMTPRecipientsRefused exception
2395 (the exeption object now has the appropriate info in it ) [Per had
2396 removed this in his patch --GvR] and tweaked the behavior of the
2397 sendmail method whence it throws the newly added SMTPHeloException (it
2398 was closing the connection, which it shouldn't. whatever catches the
2399 exception should do that. )
2400
2401 I pondered the change of the return values to tuples all around,
2402 and after some thinking I decided that regularizing the return values was
2403 too much of the Right Thing (tm) to not do.
2404
2405 My one concern is that code expecting an integer & getting a tuple
2406 may fail silently.
2407
2408 (i.e. if it's doing :
2409
2410 x.somemethod() >= 400:
2411 expecting an integer, the expression will always be true if it gets a
2412 tuple instead. )
2413
2414 However, most smtplib code I've seen only really uses the
2415 sendmail() method, so this wouldn't bother it. Usually code I've seen
2416 that calls the other methods usually only calls helo() and ehlo() for
2417 doing ESMTP, a feature which was not in the smtplib included with 1.5.1,
2418 and thus I would think not much code uses it yet.
2419 """
2420
2421Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2422
2423 * Lib/test/test_ntpath.py:
2424 Fix the tests now that splitdrive() no longer treats UNC paths special.
2425 (Some tests converted to splitunc() tests.)
2426
2427 * Lib/ntpath.py:
2428 Withdraw the UNC support from splitdrive(). Instead, a new function
2429 splitunc() parses UNC paths. The contributor of the UNC parsing in
2430 splitdrive() doesn't like it, but I haven't heard a good reason to
2431 keep it, and it causes some problems. (I think there's a
2432 philosophical problem -- to me, the split*() functions are purely
2433 syntactical, and the fact that \\foo is not a valid path doesn't mean
2434 that it shouldn't be considered an absolute path.)
2435
2436 Also (quite separately, but strangely related to the philosophical
2437 issue above) fix abspath() so that if win32api exists, it doesn't fail
2438 when the path doesn't actually exist -- if GetFullPathName() fails,
2439 fall back on the old strategy (join with getcwd() if neccessary, and
2440 then use normpath()).
2441
2442 * configure.in, configure, config.h.in, acconfig.h:
2443 For BeOS PowerPC. Chris Herborth.
2444
2445Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2446
2447 * Modules/timemodule.c:
2448 Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on
2449 #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
2450
2451 * Misc/ACKS:
2452 Bunch of new contributors, including 9 who contributed to the Docs,
2453 reported by Fred.
2454
2455Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2456
2457 * Lib/gzip.py:
2458 Oops, missed mode parameter to open().
2459
2460 * Lib/gzip.py:
2461 Made the default mode 'rb' instead of 'r', for better cross-platform
2462 support. (Based on comment on the documentation by Bernhard Reiter
2463 <bernhard@csd.uwm.edu>).
2464
2465Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2466
2467 * Tools/scripts/dutree.py:
2468 For reasons I dare not explain, this script should always execute
2469 main() when imported (in other words, it is not usable as a module).
2470
2471Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2472
2473 * Lib/test/test_cpickle.py: Jonathan Giddy write:
2474
2475 In test_cpickle.py, the module os got imported, but the line to remove
2476 the temp file has gone missing.
2477
2478Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2479
2480 * Lib/BaseHTTPServer.py: Per Cederqvist writes:
2481
2482 If you send something like "PUT / HTTP/1.0" to something derived from
2483 BaseHTTPServer that doesn't define do_PUT, you will get a response
2484 that begins like this:
2485
2486 HTTP/1.0 501 Unsupported method ('do_PUT')
2487 Server: SimpleHTTP/0.3 Python/1.5
2488 Date: Tue, 30 Mar 1999 18:53:53 GMT
2489
2490 The server should complain about 'PUT' instead of 'do_PUT'. This
2491 patch should fix the problem.
2492
2493Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2494
2495 * Lib/smtplib.py: Patch by Per Cederqvist, who writes:
2496
2497 """
2498 - It needlessly used the makefile() method for each response that is
2499 read from the SMTP server.
2500
2501 - If the remote SMTP server closes the connection unexpectedly the
2502 code raised an IndexError. It now raises an SMTPServerDisconnected
2503 exception instead.
2504
2505 - The code now checks that all lines in a multiline response actually
2506 contains an error code.
2507 """
2508
2509 The Dragon approves.
2510
2511Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2512
2513 * Lib/compileall.py:
2514 When run as a script, report failures in the exit code as well.
2515 Patch largely based on changes by Andrew Dalke, as discussed in the
2516 distutils-sig.
2517
2518Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2519
2520 * Lib/urllib.py:
2521 Hack so that if a 302 or 301 redirect contains a relative URL, the
2522 right thing "just happens" (basejoin() with old URL).
2523
2524 * Modules/cPickle.c:
2525 Protection against picling to/from closed (real) file.
2526 The problem was reported by Moshe Zadka.
2527
2528 * Lib/test/test_cpickle.py:
2529 Test protection against picling to/from closed (real) file.
2530
2531 * Modules/timemodule.c: Chris Lawrence writes:
2532
2533 """
2534 The GNU folks, in their infinite wisdom, have decided not to implement
2535 altzone in libc6; this would not be horrible, except that timezone
2536 (which is implemented) includes the current DST setting (i.e. timezone
2537 for Central is 18000 in summer and 21600 in winter). So Python's
2538 timezone and altzone variables aren't set correctly during DST.
2539
2540 Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone
2541 show the "right" thing on Linux (by using the tm_gmtoff stuff
2542 available in BSD, which is how the GLIBC manual claims things should
2543 be done) and (b) should cope with the southern hemisphere. In pursuit
2544 of (b), I also took the liberty of renaming the "summer" and "winter"
2545 variables to "july" and "jan". This patch should also make certain
2546 time calculations on Linux actually work right (like the tz-aware
2547 functions in the rfc822 module).
2548
2549 (It's hard to find DST that's currently being used in the southern
2550 hemisphere; I tested using Africa/Windhoek.)
2551 """
2552
2553 * Lib/test/output/test_gzip:
2554 Jonathan Giddy discovered this file was missing.
2555
2556 * Modules/shamodule.c:
2557 Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my
2558 middlename) Marangozov, patch coded by Greg Stein.
2559
2560 * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py:
2561 At Tim Peters' recommendation, add a dummy flush() method to PseudoFile.
2562
2563Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2564
2565 * Tools/scripts/ndiff.py: Tim Peters writes:
2566
2567 I should have waited overnight <wink/sigh>. Nothing wrong with the one I
2568 sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options
2569 for recreating the original files from ndiff's output. That's attached, if
2570 you're game! Us Windows guys don't usually have a sed sitting around
2571 <wink>.
2572
2573Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2574
2575 * Tools/scripts/ndiff.py: Tim Peters writes:
2576
2577 Attached is a cleaned-up version of ndiff (added useful module
2578 docstring, now echo'ed in case of cmd line mistake); added -q option
2579 to suppress initial file identification lines; + other minor cleanups,
2580 & a slightly faster match engine.
2581
2582Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2583
2584 * Tools/scripts/dutree.py:
2585 During display, if EPIPE is raised, it's probably because a pager was
2586 killed. Discard the error in that case, but propogate it otherwise.
2587
2588Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2589
2590 * Lib/test/output/test_userlist, Lib/test/test_userlist.py:
2591 Test suite for UserList.
2592
2593 * Lib/UserList.py: Use isinstance() where appropriate.
2594 Reformatted with 4-space indent.
2595
2596Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
2597
2598 * Tools/pynche/PyncheWidget.py:
2599 Helpwin.__init__(): The text widget should get focus.
2600
2601 * Tools/pynche/pyColorChooser.py:
2602 Removed unnecessary import `from PyncheWidget import PyncheWidget'
2603
2604Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2605
2606 * Lib/test/output/test_userdict, Lib/test/test_userdict.py:
2607 Test suite for UserDict
2608
2609 * Lib/UserDict.py: Improved a bunch of things.
2610 The constructor now takes an optional dictionary.
2611 Use isinstance() where appropriate.
2612
2613Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2614
2615 * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py:
2616 Basic regr tests for pickle/cPickle
2617
2618 * Lib/pickle.py:
2619 Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK
2620 points out) it doesn't work in JPython Applets.
2621
2622Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
2623
2624 * Lib/test/test_gzip.py:
2625 Added a simple test suite for gzip. It simply opens a temp file,
2626 writes a chunk of compressed data, closes it, writes another chunk, and
2627 reads the contents back to verify that they are the same.
2628
2629 * Lib/gzip.py:
2630 Based on a suggestion from bruce@hams.com, make a trivial change to
2631 allow using the 'a' flag as a mode for opening a GzipFile. gzip
2632 files, surprisingly enough, can be concatenated and then decompressed;
2633 the effect is to concatenate the two chunks of data.
2634
2635 If we support it on writing, it should also be supported on reading.
2636 This *wasn't* trivial, and required rearranging the code in the
2637 reading path, particularly the _read() method.
2638
2639 Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file'
2640 and 'Unknown compression method'
2641
2642Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2643
2644 * Lib/test/test_b1.py:
2645 Add tests for float() and complex() with string args (Nick/Stephanie
2646 Lockwood).
2647
2648Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
2649
2650 * Modules/zlibmodule.c:
2651 Add an .unused_data attribute to decompressor objects. If .unused_data
2652 is not an empty string, this means that you have arrived at the
2653 end of the stream of compressed data, and the contents of .unused_data are
2654 whatever follows the compressed stream.
2655
2656Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2657
2658 * Python/bltinmodule.c:
2659 Patch by Nick and Stephanie Lockwood to implement complex() with a string
2660 argument. This closes TODO item 2.19.
2661
2662Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2663
2664 * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker.
2665 Unfortunately his code breaks wcgui.py in a way that's not easy
2666 to fix. I expect that this is a temporary situation --
2667 eventually Sam's changes will be merged back in.
2668 (The changes add a -t option to specify exceptions to the -x
2669 option, and explicit checking for #foo style fragment ids.)
2670
2671 * Objects/dictobject.c:
2672 Vladimir Marangozov contributed updated comments.
2673
2674 * Objects/bufferobject.c: Folded long lines.
2675
2676 * Lib/test/output/test_sha, Lib/test/test_sha.py:
2677 Added Jeremy's test code for the sha module.
2678
2679 * Modules/shamodule.c, Modules/Setup.in:
2680 Added Greg Stein and Andrew Kuchling's sha module.
2681 Fix comments about zlib version and URL.
2682
2683 * Lib/test/test_bsddb.py: Remove the temp file when we're done.
2684
2685 * Include/pythread.h: Conform to standard boilerplate.
2686
2687 * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake:
2688 Chris Herborth: the new compiler in R4.1 needs some new options to work...
2689
2690 * Modules/socketmodule.c:
2691 Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the
2692 data struct before calling gethostby{name,addr}_r(); (2) ignore the
2693 3/5/6 args determinations made by the configure script and switch on
2694 platform identifiers instead:
2695
2696 AIX, OSF have 3 args
2697 Sun, SGI have 5 args
2698 Linux has 6 args
2699
2700 On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether.
2701
2702 * Modules/socketmodule.c:
2703 Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code.
2704
2705 * Lib/mailbox.py:
2706 Add readlines() to _Subfile class. Not clear who would need it, but
2707 Chris Lawrence sent me a broken version; this one is a tad simpler and
2708 more conforming to the standard.
2709
2710Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
2711
2712 * Lib/gzip.py: use struct instead of bit-manipulate in Python
2713
2714Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2715
2716 * Modules/Makefile.pre.in:
2717 Add $(EXE) to various occurrences of python so it will work on Cygwin
2718 with egcs (after setting EXE=.exe). Patch by Norman Vine.
2719
2720 * configure, configure.in:
2721 Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested!
2722
2723Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2724
2725 * Include/thread.h:
2726 Adding thread.h -- unused but for b/w compatibility.
2727 As requested by Bill Janssen.
2728
2729 * configure.in, configure:
2730 Add code to test for all sorts of gethostbyname_r variants,
2731 donated by David Arnold.
2732
2733 * config.h.in, acconfig.h:
2734 Add symbols for gethostbyname_r variants (sigh).
2735
2736 * Modules/socketmodule.c: Clean up pass for the previous patches.
2737
2738 - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and
2739 glibc2.
2740
2741 - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R --
2742 don't know what code should be used.
2743
2744 - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used.
2745
2746 - Modify the gethostbyaddr() code to also hold on to the lock until
2747 after it is safe to release, overlapping with the Python lock.
2748
2749 (Note: I think that it could in theory be possible that Python code
2750 executed while gethostbyname_lock is held could attempt to reacquire
2751 the lock -- e.g. in a signal handler or destructor. I will simply say
2752 "don't do that then.")
2753
2754 * Modules/socketmodule.c: Jonathan Giddy writes:
2755
2756 Here's a patch to fix the race condition, which wasn't fixed by Rob's
2757 patch. It holds the gethostbyname lock until the results are copied out,
2758 which means that this lock and the Python global lock are held at the same
2759 time. This shouldn't be a problem as long as the gethostbyname lock is
2760 always acquired when the global lock is not held.
2761
2762Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us>
2763
2764 * Modules/zlibmodule.c:
2765 Fixed the flush() method of compression objects; the test for
2766 the end of loop was incorrect, and failed when the flushmode != Z_FINISH.
2767 Logic cleaned up and commented.
2768
2769 * Lib/test/test_zlib.py:
2770 Added simple test for the flush() method of compression objects, trying the
2771 different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH.
2772
2773Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2774
2775 * Lib/shlex.py:
2776 Bug reported by Tobias Thelen: missing "self." in assignment target.
2777
2778Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2779
2780 * Modules/arraymodule.c:
2781 Use an unsigned cast to avoid a warning in VC++.
2782
2783 * Lib/dospath.py, Lib/ntpath.py:
2784 New code for split() by Tim Peters, behaves more like posixpath.split().
2785
2786 * Objects/floatobject.c:
2787 Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if
2788 a block cannot be freed, add its free items back to the free list.
2789 This is necessary to avoid leaking when Python is reinitialized later.
2790
2791 * Objects/intobject.c:
2792 Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if
2793 a block cannot be freed, add its free items back to the free list, and
2794 add its valid ints back to the small_ints array if they are in range.
2795 This is necessary to avoid leaking when Python is reinitialized later.
2796
2797 * Lib/types.py:
2798 Added BufferType, the type returned by the new builtin buffer(). Greg Stein.
2799
2800 * Python/bltinmodule.c:
2801 New builtin buffer() creates a derived read-only buffer from any
2802 object that supports the buffer interface (e.g. strings, arrays).
2803
2804 * Objects/bufferobject.c:
2805 Added check for negative offset for PyBuffer_FromObject and check for
2806 negative size for PyBuffer_FromMemory. Greg Stein.
2807
2808Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2809
2810 * Lib/urlparse.py: Sjoerd Mullender writes:
2811
2812 If a filename on Windows starts with \\, it is converted to a URL
2813 which starts with ////. If this URL is passed to urlparse.urlparse
2814 you get a path that starts with // (and an empty netloc). If you pass
2815 the result back to urlparse.urlunparse, you get a URL that starts with
2816 //, which is parsed differently by urlparse.urlparse. The fix is to
2817 add the (empty) netloc with accompanying slashes if the path in
2818 urlunparse starts with //. Do this for all schemes that use a netloc.
2819
2820 * Lib/nturl2path.py: Sjoerd Mullender writes:
2821
2822 Pathnames of files on other hosts in the same domain
2823 (\\host\path\to\file) are not translated correctly to URLs and back.
2824 The URL should be something like file:////host/path/to/file.
2825 Note that a combination of drive letter and remote host is not
2826 possible.
2827
2828Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2829
2830 * Lib/urlparse.py:
2831 Delete non-standard-conforming code in urljoin() that would use the
2832 netloc from the base url as the default netloc for the resulting url
2833 even if the schemes differ.
2834
2835 Once upon a time, when the web was wild, this was a valuable hack
2836 because some people had a URL referencing an ftp server colocated with
2837 an http server without having the host in the ftp URL (so they could
2838 replicate it or change the hostname easily).
2839
2840 More recently, after the file: scheme got added back to the list of
2841 schemes that accept a netloc, it turns out that this caused weirdness
2842 when joining an http: URL with a file: URL -- the resulting file: URL
2843 would always inherit the host from the http: URL because the file:
2844 scheme supports a netloc but in practice never has one.
2845
2846 There are two reasons to get rid of the old, once-valuable hack,
2847 instead of removing the file: scheme from the uses_netloc list. One,
2848 the RFC says that file: uses the netloc syntax, and does not endorse
2849 the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old
2850 hack.
2851
2852 * Include/ceval.h, Include/abstract.h:
2853 Add DLL level b/w compat for PySequence_In and PyEval_CallObject
2854
2855Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2856
2857 * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson:
2858
2859 An attempt to execute grid_slaves with arguments (0,0) results in
2860 *all* of the slaves being returned, not just the slave associated with
2861 row 0, column 0. This is because the test for arguments in the method
2862 does not test to see if row (and column) does not equal None, but
2863 rather just whether is evaluates to non-false. A value of 0 fails
2864 this test.
2865
2866Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2867
2868 * Modules/cmathmodule.c:
2869 Docstring fix: acosh() returns the hyperbolic arccosine, not the
2870 hyperbolic cosine. Problem report via David Ascher by one of his
2871 students.
2872
2873Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2874
2875 * configure.in:
2876 Should test for gethost*by*name_r, not for gethostname_r (which
2877 doesn't exist and doesn't make sense).
2878
2879 * Modules/socketmodule.c:
2880 Patch by Rob Riggs for Linux -- glibc2 has a different argument
2881 converntion for gethostbyname_r() etc. than Solaris!
2882
2883 * Python/thread_pthread.h: Rob Riggs wrote:
2884
2885 """
2886 Spec says that on success pthread_create returns 0. It does not say
2887 that an error code will be < 0. Linux glibc2 pthread_create() returns
2888 ENOMEM (12) when one exceed process limits. (It looks like it should
2889 return EAGAIN, but that's another story.)
2890
2891 For reference, see:
2892 http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html
2893 """
2894
2895 [I have a feeling that similar bugs were fixed before; perhaps someone
2896 could check that all error checks no check for != 0?]
2897
2898 * Tools/bgen/bgen/bgenObjectDefinition.py:
2899 New mixin class that defines cmp and hash that use
2900 the ob_itself pointer. This allows (when using the mixin)
2901 different Python objects pointing to the same C object and
2902 behaving well as dictionary keys.
2903
2904 Or so sez Jack Jansen...
2905
2906 * Lib/urllib.py: Yet another patch by Sjoerd Mullender:
2907
2908 Don't convert URLs to URLs using pathname2url.
2909
2910Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2911
2912 * Lib/cmd.py: Patch by Michael Scharf. He writes:
2913
2914 The module cmd requires for each do_xxx command a help_xxx
2915 function. I think this is a little old fashioned.
2916
2917 Here is a patch: use the docstring as help if no help_xxx
2918 function can be found.
2919
2920 [I'm tempted to rip out all the help_* functions from pdb, but I'll
2921 resist it. Any takers? --Guido]
2922
2923 * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes:
2924
2925 Under Windows, python freeze.py -o hello hello.py
2926 creates all the correct files in the hello subdirectory, but the
2927 Makefile has the directory prefix in it for frozen_extensions.c
2928 nmake fails because it tries to locate hello/frozen_extensions.c
2929
2930 (His fix adds a call to os.path.basename() in the appropriate place.)
2931
2932 * Objects/floatobject.c, Objects/intobject.c:
2933 Vladimir has restructured his code somewhat so that the blocks are now
2934 represented by an explicit structure. (There are still too many casts
2935 in the code, but that may be unavoidable.)
2936
2937 Also added code so that with -vv it is very chatty about what it does.
2938
2939 * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py:
2940 Change #! line to modern usage; also chmod +x
2941
2942 * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump:
2943 Change #! line to modern usage
2944
2945 * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender
2946
2947 The filename to URL conversion didn't properly quote special
2948 characters.
2949 The URL to filename didn't properly unquote special chatacters.
2950
2951 * Objects/floatobject.c:
2952 OK, try again. Vladimir gave me a fix for the alignment bus error,
2953 so here's his patch again. This time it works (at least on Solaris,
2954 Linux and Irix).
2955
2956Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2957
2958 * Tools/idle/PathBrowser.py:
2959 Don't crash when sys.path contains an empty string.
2960
2961 * Tools/idle/PathBrowser.py:
2962 - Don't crash in the case where a superclass is a string instead of a
2963 pyclbr.Class object; this can happen when the superclass is
2964 unrecognizable (to pyclbr), e.g. when module renaming is used.
2965
2966 - Show a watch cursor when calling pyclbr (since it may take a while
2967 recursively parsing imported modules!).
2968
2969Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
2970
2971 * Lib/mimetypes.py:
2972 Added .rdf and .xsl as application/xml types. (.rdf is for the
2973 Resource Description Framework, a metadata encoding, and .xsl is for
2974 the Extensible Stylesheet Language.)
2975
2976Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2977
2978 * Lib/test/output/test_popen2, Lib/test/test_popen2.py:
2979 Test for popen2 module, by Chris Tismer.
2980
2981 * Objects/floatobject.c:
2982 Alas, Vladimir's patch caused a bus error (probably double
2983 alignment?), and I didn't test it. Withdrawing it for now.
2984
2985Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
2986
2987 * Objects/floatobject.c:
2988 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
2989 floats on finalization.
2990
2991 * Objects/intobject.c:
2992 Patch by Vladimir Marangoz to allow freeing of the allocated blocks of
2993 integers on finalization.
2994
2995 * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py:
2996 Add PathBrowser to File module
2997
2998 * Tools/idle/PathBrowser.py:
2999 "Path browser" - 4 scrolled lists displaying:
3000 directories on sys.path
3001 modules in selected directory
3002 classes in selected module
3003 methods of selected class
3004
3005 Sinlge clicking in a directory, module or class item updates the next
3006 column with info about the selected item. Double clicking in a
3007 module, class or method item opens the file (and selects the clicked
3008 item if it is a class or method).
3009
3010 I guess eventually I should be using a tree widget for this, but the
3011 ones I've seen don't work well enough, so for now I use the old
3012 Smalltalk or NeXT style multi-column hierarchical browser.
3013
3014 * Tools/idle/MultiScrolledLists.py:
3015 New utility: multiple scrolled lists in parallel
3016
3017 * Tools/idle/ScrolledList.py: - White background.
3018 - Display "(None)" (or text of your choosing) when empty.
3019 - Don't set the focus.
3020
3021Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3022
3023 * Lib/urllib.py:
3024 open_http also had the 'data is None' test backwards. don't call with the
3025 extra argument if data is None.
3026
3027 * Demo/embed/demo.c:
3028 Call Py_SetProgramName() instead of redefining getprogramname(),
3029 reflecting changes in the runtime around 1.5 or earlier.
3030
3031 * Python/ceval.c:
3032 Always test for an error return (usually NULL or -1) without setting
3033 an exception.
3034
3035 * Modules/timemodule.c: Patch by Chris Herborth for BeOS code.
3036 He writes:
3037
3038 I had an off-by-1000 error in floatsleep(),
3039 and the problem with time.clock() is that it's not implemented properly
3040 on QNX... ANSI says it's supposed to return _CPU_ time used by the
3041 process, but on QNX it returns the amount of real time used... so I was
3042 confused.
3043
3044 * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen.
3045 Test for self.returntype behaving like OSErr rather than being it.
3046
3047Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
3048
3049 * Lib/urllib.py:
3050 http_error had the 'data is None' test backwards. don't call with the
3051 extra argument if data is None.
3052
3053 * Lib/urllib.py: change indentation from 8 spaces to 4 spaces
3054
3055 * Lib/urllib.py: pleasing the tabnanny
3056
3057Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
3058
3059 * Lib/colorsys.py:
3060 Oops, one more "x, y, z" to convert...
3061
3062 * Lib/colorsys.py:
3063 Adjusted comment at the top to be less confusing, following Fredrik
3064 Lundh's example.
3065
3066 Converted comment to docstring.
3067
3068Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
3069
3070 * Lib/toaiff.py:
3071 Use sndhdr instead of the obsolete whatsound module.
3072
3073Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us>
3074
3075 * Lib/urllib.py:
3076 When performing a POST request, i.e. when the second argument to
3077 urlopen is used to specify form data, make sure the second argument is
3078 threaded through all of the http_error_NNN calls. This allows error
3079 handlers like the redirect and authorization handlers to properly
3080 re-start the connection.
3081
3082Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3083
3084 * Lib/mhlib.py: Patch by Lars Wirzenius:
3085
3086 o the initial comment is wrong: creating messages is already
3087 implemented
3088
3089 o Message.getbodytext: if the mail or it's part contains an
3090 empty content-transfer-encoding header, the code used to
3091 break; the change below treats an empty encoding value the same
3092 as the other types that do not need decoding
3093
3094 o SubMessage.getbodytext was missing the decode argument; the
3095 change below adds it; I also made it unconditionally return
3096 the raw text if decoding was not desired, because my own
3097 routines needed that (and it was easier than rewriting my
3098 own routines ;-)
3099
3100Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us>
3101
3102 * Python/bltinmodule.c (initerrors):
3103 Make sure that the exception tuples ("base-classes" when
3104 string-based exceptions are used) reflect the real class hierarchy,
3105 i.e. that SystemExit derives from Exception not StandardError.
3106
3107 * Lib/exceptions.py:
3108 Document the correct class hierarchy for SystemExit. It is not an
3109 error and so it derives from Exception and not SystemError. The
3110 docstring was incorrect but the implementation was fine.
3111
3112Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3113
3114 * Lib/shutil.py:
3115 Add import sys, needed by reference to sys.exc_info() in rmtree().
3116 Discovered by Mitch Chapman.
3117
3118 * config.h.in:
3119 Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol
3120 disappears. It wasn't used anywhere anyway...
3121
3122 * Modules/arraymodule.c:
3123 Carefully check for overflow when allocating the memory for fromfile
3124 -- someone tried to pass in sys.maxint and got bitten by the bogus
3125 calculations.
3126
3127 * configure.in:
3128 Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with
3129 LIBM (from --with-libm=...); this actually broke the customizability
3130 offered by the latter option. Thanks go to Clay Spence for reporting
3131 this.
3132
3133 * Lib/test/test_dl.py:
3134 1. Print the error message (carefully) when a dl.open() fails in verbose mode.
3135 2. When no test case worked, raise ImportError instead of failing.
3136
3137 * Python/bltinmodule.c:
3138 Patch by Tim Peters to improve the range checks for range() and
3139 xrange(), especially for platforms where int and long are different
3140 sizes (so sys.maxint isn't actually the theoretical limit for the
3141 length of a list, but the largest C int is -- sys.maxint is the
3142 largest Python int, which is actually a C long).
3143
3144 * Makefile.in:
3145 1. Augment the DG/UX rule so it doesn't break the BeOS build.
3146 2. Add $(EXE) to various occurrences of python so it will work on
3147 Cygwin with egcs (after setting EXE=.exe). These patches by
3148 Norman Vine.
3149
3150 * Lib/posixfile.py:
3151 According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the
3152 list (of bsd variants that have a different lock structure).
3153
3154 * Lib/test/test_fcntl.py:
3155 According to Jeffrey Honig, bsd/os 4.0 should be added to the list.
3156
3157 * Modules/timemodule.c:
3158 Patch by Tadayoshi Funaba (with some changes) to be smarter about
3159 guessing what happened when strftime() returns 0. Is it buffer
3160 overflow or was the result simply 0 bytes long? (This happens for an
3161 empty format string, or when the format string is a single %Z and the
3162 timezone is unknown.) if the buffer is at least 256 times as long as
3163 the format, assume the latter.
3164
3165Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3166
3167 * Lib/urllib.py:
3168 As Des Barry points out, we need to call pathname2url(file) in two
3169 calls to addinfourl() in open_file().
3170
3171 * Modules/Setup.in: Document *static* -- in two places!
3172
3173 * Modules/timemodule.c:
3174 We don't support leap seconds, so the seconds field of a time 9-tuple
3175 should be in the range [0-59]. Noted by Tadayoshi Funaba.
3176
3177 * Modules/stropmodule.c:
3178 In atoi(), don't use isxdigit() to test whether the last character
3179 converted was a "digit" -- use isalnum(). This test is there only to
3180 guard against "+" or "-" being interpreted as a valid int literal.
3181 Reported by Takahiro Nakayama.
3182
3183 * Lib/os.py:
3184 As Finn Bock points out, _P_WAIT etc. don't have a leading underscore
3185 so they don't need to be treated specially here.
3186
3187Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
3188
3189 * Misc/NEWS:
3190 Typo: "apparentlt" --> "apparently"
3191
3192Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us>
3193
3194 * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc.
3195
3196 * Modules/posixmodule.c:
3197 The docstring for ttyname(..) claims a second "mode" argument. The
3198 actual code does not allow such an argument. (Finn Bock.)
3199
3200 * Lib/lib-old/poly.py:
3201 Dang. Even though this is obsolete code, somebody found a bug, and I
3202 fix it. Oh well.
3203
3204Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us>
3205
3206 * Lib/pyclbr.py:
3207 Bow to font-lock at the end of the docstring, since it throws stuff
3208 off.
3209
3210 Make sure the path paramter to readmodule() is a list before adding it
3211 with sys.path, or the addition could fail.
3212
3213
3214======================================================================
3215
3216
3217From 1.5.2b1 to 1.5.2b2
3218=======================
3219
3220General
3221-------
3222
3223- Many memory leaks fixed.
3224
3225- Many small bugs fixed.
3226
3227- Command line option -OO (or -O -O) suppresses inclusion of doc
3228strings in resulting bytecode.
3229
3230Windows-specific changes
3231------------------------
3232
3233- New built-in module winsound provides an interface to the Win32
3234PlaySound() call.
3235
3236- Re-enable the audioop module in the config.c file.
3237
3238- On Windows, support spawnv() and associated P_* symbols.
3239
3240- Fixed the conversion of times() return values on Windows.
3241
3242- Removed freeze from the installer -- it doesn't work without the
3243source tree. (See FAQ 8.11.)
3244
3245- On Windows 95/98, the Tkinter module now is smart enough to find
3246Tcl/Tk even when the PATH environment variable hasn't been set -- when
3247the import of _tkinter fails, it searches in a standard locations,
3248patches os.environ["PATH"], and tries again. When it still fails, a
3249clearer error message is produced. This should avoid most
3250installation problems with Tkinter use (e.g. in IDLE).
3251
3252- The -i option doesn't make any calls to set[v]buf() for stdin --
3253this apparently screwed up _kbhit() and the _tkinter main loop.
3254
3255- The ntpath module (and hence, os.path on Windows) now parses out UNC
3256paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that
3257splitdrive() will \\host\mountpoint as the drive and \dir\file as the
3258path. ** EXPERIMENTAL **
3259
3260- Added a hack to the exit code so that if (1) the exit status is
3261nonzero and (2) we think we have our own DOS box (i.e. we're not
3262started from a command line shell), we print a message and wait for
3263the user to hit a key before the DOS box is closed.
3264
3265- Updated the installer to WISE 5.0g. Added a dialog warning about
3266the imminent Tcl installation. Added a dialog to specify the program
3267group name in the start menu. Upgraded the Tcl installer to Tcl
32688.0.4.
3269
3270Changes to intrinsics
3271---------------------
3272
3273- The repr() or str() of a module object now shows the __file__
3274attribute (i.e., the file which it was loaded), or the string
3275"(built-in)" if there is no __file__ attribute.
3276
3277- The range() function now avoids overflow during its calculations (if
3278at all possible).
3279
3280- New info string sys.hexversion, which is an integer encoding the
3281version in hexadecimal. In other words, hex(sys.hexversion) ==
32820x010502b2 for Python 1.5.2b2.
3283
3284New or improved ports
3285---------------------
3286
3287- Support for Nextstep descendants (future Mac systems).
3288
3289- Improved BeOS support.
3290
3291- Support dynamic loading of shared libraries on NetBSD platforms that
3292use ELF (i.e., MIPS and Alpha systems).
3293
3294Configuration/build changes
3295---------------------------
3296
3297- The Lib/test directory is no longer included in the default module
3298search path (sys.path) -- "test" has been a package ever since 1.5.
3299
3300- Now using autoconf 2.13.
3301
3302New library modules
3303-------------------
3304
3305- New library modules asyncore and asynchat: these form Sam Rushing's
3306famous asynchronous socket library. Sam has gracefully allowed me to
3307incorporate these in the standard Python library.
3308
3309- New module statvfs contains indexing constants for [f]statvfs()
3310return tuple.
3311
3312Changes to the library
3313----------------------
3314
3315- The wave module (platform-independent support for Windows sound
3316files) has been fixed to actually make it work.
3317
3318- The sunau module (platform-independent support for Sun/NeXT sound
3319files) has been fixed to work across platforms. Also, a weird
3320encoding bug in the header of the audio test data file has been
3321corrected.
3322
3323- Fix a bug in the urllib module that occasionally tripped up
3324webchecker and other ftp retrieves.
3325
3326- ConfigParser's get() method now accepts an optional keyword argument
3327(vars) that is substituted on top of the defaults that were setup in
3328__init__. You can now also have recusive references in your
3329configuration file.
3330
3331- Some improvements to the Queue module, including a put_nowait()
3332module and an optional "block" second argument, to get() and put(),
3333defaulting to 1.
3334
3335- The updated xmllib module is once again compatible with the version
3336present in Python 1.5.1 (this was accidentally broken in 1.5.2b1).
3337
3338- The bdb module (base class for the debugger) now supports
3339canonicalizing pathnames used in breakpoints. The derived class must
3340override the new canonical() method for this to work. Also changed
3341clear_break() to the backwards compatible old signature, and added
3342clear_bpbynumber() for the new functionality.
3343
3344- In sgmllib (and hence htmllib), recognize attributes even if they
3345don't have space in front of them. I.e. '<a
3346name="foo"href="bar.html">' will now have two attributes recognized.
3347
3348- In the debugger (pdb), change clear syntax to support three
3349alternatives: clear; clear file:line; clear bpno bpno ...
3350
3351- The os.path module now pretends to be a submodule within the os
3352"package", so you can do things like "from os.path import exists".
3353
3354- The standard exceptions now have doc strings.
3355
3356- In the smtplib module, exceptions are now classes. Also avoid
3357inserting a non-standard space after "TO" in rcpt() command.
3358
3359- The rfc822 module's getaddrlist() method now uses all occurrences of
3360the specified header instead of just the first. Some other bugfixes
3361too (to handle more weird addresses found in a very large test set,
3362and to avoid crashes on certain invalid dates), and a small test
3363module has been added.
3364
3365- Fixed bug in urlparse in the common-case code for HTTP URLs; it
3366would lose the query, fragment, and/or parameter information.
3367
3368- The sndhdr module no longer supports whatraw() -- it depended on a
3369rare extenral program.
3370
3371- The UserList module/class now supports the extend() method, like
3372real list objects.
3373
3374- The uu module now deals better with trailing garbage generated by
3375some broke uuencoders.
3376
3377- The telnet module now has an my_interact() method which uses threads
3378instead of select. The interact() method uses this by default on
3379Windows (where the single-threaded version doesn't work).
3380
3381- Add a class to mailbox.py for dealing with qmail directory
3382mailboxes. The test code was extended to notice these being used as
3383well.
3384
3385Changes to extension modules
3386----------------------------
3387
3388- Support for the [f]statvfs() system call, where it exists.
3389
3390- Fixed some bugs in cPickle where bad input could cause it to dump
3391core.
3392
3393- Fixed cStringIO to make the writelines() function actually work.
3394
3395- Added strop.expandtabs() so string.expandtabs() is now much faster.
3396
3397- Added fsync() and fdatasync(), if they appear to exist.
3398
3399- Support for "long files" (64-bit seek pointers).
3400
3401- Fixed a bug in the zlib module's flush() function.
3402
3403- Added access() system call. It returns 1 if access granted, 0 if
3404not.
3405
3406- The curses module implements an optional nlines argument to
3407w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).)
3408
3409Changes to tools
3410----------------
3411
3412- Some changes to IDLE; see Tools/idle/NEWS.txt.
3413
3414- Latest version of Misc/python-mode.el included.
3415
3416Changes to Tkinter
3417------------------
3418
3419- Avoid tracebacks when an image is deleted after its root has been
3420destroyed.
3421
3422Changes to the Python/C API
3423---------------------------
3424
3425- When parentheses are used in a PyArg_Parse[Tuple]() call, any
3426sequence is now accepted, instead of requiring a tuple. This is in
3427line with the general trend towards accepting arbitrary sequences.
3428
3429- Added PyModule_GetFilename().
3430
3431- In PyNumber_Power(), remove unneeded and even harmful test for float
3432to the negative power (which is already and better done in
3433floatobject.c).
3434
3435- New version identification symbols; read patchlevel.h for info. The
3436version numbers are now exported by Python.h.
3437
3438- Rolled back the API version change -- it's back to 1007!
3439
3440- The frozenmain.c function calls PyInitFrozenExtensions().
3441
3442- Added 'N' format character to Py_BuildValue -- like 'O' but doesn't
3443INCREF.
3444
3445
3446======================================================================
3447
3448
3449From 1.5.2a2 to 1.5.2b1
3450=======================
3451
3452Changes to intrinsics
3453---------------------
3454
3455- New extension NotImplementedError, derived from RuntimeError. Not
3456used, but recommended use is for "abstract" methods to raise this.
3457
3458- The parser will now spit out a warning or error when -t or -tt is
3459used for parser input coming from a string, too.
3460
3461- The code generator now inserts extra SET_LINENO opcodes when
3462compiling multi-line argument lists.
3463
3464- When comparing bound methods, use identity test on the objects, not
3465equality test.
3466
3467New or improved ports
3468---------------------
3469
3470- Chris Herborth has redone his BeOS port; it now works on PowerPC
3471(R3/R4) and x86 (R4 only). Threads work too in this port.
3472
3473Renaming
3474--------
3475
3476- Thanks to Chris Herborth, the thread primitives now have proper Py*
3477names in the source code (they already had those for the linker,
3478through some smart macros; but the source still had the old, un-Py
3479names).
3480
3481Configuration/build changes
3482---------------------------
3483
3484- Improved support for FreeBSD/3.
3485
3486- Check for pthread_detach instead of pthread_create in libc.
3487
3488- The makesetup script now searches EXECINCLUDEPY before INCLUDEPY.
3489
3490- Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local.
3491Otherwise modules such as thread didn't get incorporated in extensions.
3492
3493New library modules
3494-------------------
3495
3496- shlex.py by Eric Raymond provides a lexical analyzer class for
3497simple shell-like syntaxes.
3498
3499- netrc.py by Eric Raymond provides a parser for .netrc files. (The
3500undocumented Netrc class in ftplib.py is now obsolete.)
3501
3502- codeop.py is a new module that contains the compile_command()
3503function that was previously in code.py. This is so that JPython can
3504provide its own version of this function, while still sharing the
3505higher-level classes in code.py.
3506
3507- turtle.py is a new module for simple turtle graphics. I'm still
3508working on it; let me know if you use this to teach Python to children
3509or other novices without prior programming experience.
3510
3511Obsoleted library modules
3512-------------------------
3513
3514- poly.py and zmod.py have been moved to Lib/lib-old to emphasize
3515their status of obsoleteness. They don't do a particularly good job
3516and don't seem particularly relevant to the Python core.
3517
3518New tools
3519---------
3520
3521- I've added IDLE: my Integrated DeveLopment Environment for Python.
3522Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should
3523work on Macintosh, but I haven't been able to test it there; it does
3524depend on new features in 1.5.2 and perhaps even new features in
35251.5.2b1, especially the new code module). This is very much a work in
3526progress. I'd like to hear how people like it compared to PTUI (or
3527any other IDE they are familiar with).
3528
3529- New tools by Barry Warsaw:
3530
3531 = audiopy: controls the Solaris Audio device
3532 = pynche: The PYthonically Natural Color and Hue Editor
3533 = world: Print mappings between country names and DNS country codes
3534
3535New demos
3536---------
3537
3538- Demo/scripts/beer.py prints the lyrics to an arithmetic drinking
3539song.
3540
3541- Demo/tkinter/guido/optionmenu.py shows how to do an option menu in
3542Tkinter. (By Fredrik Lundh -- not by me!)
3543
3544Changes to the library
3545----------------------
3546
3547- compileall.py now avoids recompiling .py files that haven't changed;
3548it adds a -f option to force recompilation.
3549
3550- New version of xmllib.py by Sjoerd Mullender (0.2 with latest
3551patches).
3552
3553- nntplib.py: statparse() no longer lowercases the message-id.
3554
3555- types.py: use type(__stdin__) for FileType.
3556
3557- urllib.py: fix translations for filenames with "funny" characters.
3558Patch by Sjoerd Mullender. Note that if you subclass one of the
3559URLopener classes, and you have copied code from the old urllib.py,
3560your subclass may stop working. A long-term solution is to provide
3561more methods so that you don't have to copy code.
3562
3563- cgi.py: In read_multi, allow a subclass to override the class we
3564instantiate when we create a recursive instance, by setting the class
3565variable 'FieldStorageClass' to the desired class. By default, this
3566is set to None, in which case we use self.__class__ (as before).
3567Also, a patch by Jim Fulton to pass additional arguments to recursive
3568calls to the FieldStorage constructor from its read_multi method.
3569
3570- UserList.py: In __getslice__, use self.__class__ instead of
3571UserList.
3572
3573- In SimpleHTTPServer.py, the server specified in test() should be
3574BaseHTTPServer.HTTPServer, in case the request handler should want to
3575reference the two attributes added by BaseHTTPServer.server_bind. (By
3576Jeff Rush, for Bobo). Also open the file in binary mode, so serving
3577images from a Windows box might actually work.
3578
3579- In CGIHTTPServer.py, the list of acceptable formats is -split-
3580on spaces but -joined- on commas, resulting in double commas
3581in the joined text. (By Jeff Rush.)
3582
3583- SocketServer.py, patch by Jeff Bauer: a minor change to declare two
3584new threaded versions of Unix Server classes, using the ThreadingMixIn
3585class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer.
3586
3587- bdb.py: fix bomb on deleting a temporary breakpoint: there's no
3588method do_delete(); do_clear() was meant. By Greg Ward.
3589
3590- getopt.py: accept a non-list sequence for the long options (request
3591by Jack Jansen). Because it might be a common mistake to pass a
3592single string, this situation is treated separately. Also added
3593docstrings (copied from the library manual) and removed the (now
3594redundant) module comments.
3595
3596- tempfile.py: improvements to avoid security leaks.
3597
3598- code.py: moved compile_command() to new module codeop.py.
3599
3600- pickle.py: support pickle format 1.3 (binary float added). By Jim
3601Fulton. Also get rid of the undocumented obsolete Pickler dump_special
3602method.
3603
3604- uu.py: Move 'import sys' to top of module, as noted by Tim Peters.
3605
3606- imaplib.py: fix problem with some versions of IMAP4 servers that
3607choose to mix the case in their CAPABILITIES response.
3608
3609- cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted
3610by Fredrik Lundh.
3611
3612Changes to extension modules
3613----------------------------
3614
3615- More doc strings for several modules were contributed by Chris
3616Petrilli: math, cmath, fcntl.
3617
3618- Fixed a bug in zlibmodule.c that could cause core dumps on
3619decompression of rarely occurring input.
3620
3621- cPickle.c: new version from Jim Fulton, with Open Source copyright
3622notice. Also, initialize self->safe_constructors early on to prevent
3623crash in early dealloc.
3624
3625- cStringIO.c: new version from Jim Fulton, with Open Source copyright
3626notice. Also fixed a core dump in cStringIO.c when doing seeks.
3627
3628- mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty).
3629
3630- readline.c: Bernard Herzog pointed out that rl_parse_and_bind
3631modifies its argument string (bad function!), so we make a temporary
3632copy.
3633
3634- sunaudiodev.c: Barry Warsaw added more smarts to get the device and
3635control pseudo-device, per audio(7I).
3636
3637Changes to tools
3638----------------
3639
3640- New, improved version of Barry Warsaw's Misc/python-mode.el (editing
3641support for Emacs).
3642
3643- tabnanny.py: added a -q ('quiet') option to tabnanny, which causes
3644only the names of offending files to be printed.
3645
3646- freeze: when printing missing modules, also print the module they
3647were imported from.
3648
3649- untabify.py: patch by Detlef Lannert to implement -t option
3650(set tab size).
3651
3652Changes to Tkinter
3653------------------
3654
3655- grid_bbox(): support new Tk API: grid bbox ?column row? ?column2
3656row2?
3657
3658- _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2)
3659doesn't work when running in a non-threaded environment. He added
3660some #ifdefs that fix this.
3661
3662Changes to the Python/C API
3663---------------------------
3664
3665- Bumped API version number to 1008 -- enough things have changed!
3666
3667- There's a new macro, PyThreadState_GET(), which does the same work
3668as PyThreadState_Get() without the overhead of a function call (it
3669also avoids the error check). The two top calling locations of
3670PyThreadState_Get() have been changed to use this macro.
3671
3672- All symbols intended for export from a DLL or shared library are now
3673marked as such (with the DL_IMPORT() macro) in the header file that
3674declares them. This was needed for the BeOS port, and should also
3675make some other ports easier. The PC port no longer needs the file
3676with exported symbols (PC/python_nt.def). There's also a DL_EXPORT
3677macro which is only used for init methods in extension modules, and
3678for Py_Main().
3679
3680Invisible changes to internals
3681------------------------------
3682
3683- Fixed a bug in new_buffersize() in fileobject.c which could
3684return a buffer size that was way too large.
3685
3686- Use PySys_WriteStderr instead of fprintf in most places.
3687
3688- dictobject.c: remove dead code discovered by Vladimir Marangozov.
3689
3690- tupleobject.c: make tuples less hungry -- an extra item was
3691allocated but never used. Tip by Vladimir Marangozov.
3692
3693- mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack
3694Jansen)
3695
3696- import.c: Jim Fulton fixes a reference count bug in
3697PyEval_GetGlobals.
3698
3699- glmodule.c: check in the changed version after running the stubber
3700again -- this solves the conflict with curses over the 'clear' entry
3701point much nicer. (Jack Jansen had checked in the changes to cstubs
3702eons ago, but I never regenrated glmodule.c :-( )
3703
3704- frameobject.c: fix reference count bug in PyFrame_New. Vladimir
3705Marangozov.
3706
3707- stropmodule.c: add a missing DECREF in an error exit. Submitted by
3708Jonathan Giddy.
3709
3710
3711======================================================================
3712
3713
3714From 1.5.2a1 to 1.5.2a2
3715=======================
3716
3717General
3718-------
3719
3720- It is now a syntax error to have a function argument without a
3721default following one with a default.
3722
3723- __file__ is now set to the .py file if it was parsed (it used to
3724always be the .pyc/.pyo file).
3725
3726- Don't exit with a fatal error during initialization when there's a
3727problem with the exceptions.py module.
3728
3729- New environment variable PYTHONOPTIMIZE can be used to set -O.
3730
3731- New version of python-mode.el for Emacs.
3732
3733Miscellaneous fixed bugs
3734------------------------
3735
3736- No longer print the (confusing) error message about stack underflow
3737while compiling.
3738
3739- Some threading and locking bugs fixed.
3740
3741- When errno is zero, report "Error", not "Success".
3742
3743Documentation
3744-------------
3745
3746- Documentation will be released separately.
3747
3748- Doc strings added to array and md5 modules by Chris Petrilli.
3749
3750Ports and build procedure
3751-------------------------
3752
3753- Stop installing when a move or copy fails.
3754
3755- New version of the OS/2 port code by Jeff Rush.
3756
3757- The makesetup script handles absolute filenames better.
3758
3759- The 'new' module is now enabled by default in the Setup file.
3760
3761- I *think* I've solved the problem with the Linux build blowing up
3762sometimes due to a conflict between sigcheck/intrcheck and
3763signalmodule.
3764
3765Built-in functions
3766------------------
3767
3768- The second argument to apply() can now be any sequence, not just a
3769tuple.
3770
3771Built-in types
3772--------------
3773
3774- Lists have a new method: L1.extend(L2) is equivalent to the common
3775idiom L1[len(L1):] = L2.
3776
3777- Better error messages when a sequence is indexed with a non-integer.
3778
3779- Bettter error message when calling a non-callable object (include
3780the type in the message).
3781
3782Python services
3783---------------
3784
3785- New version of cPickle.c fixes some bugs.
3786
3787- pickle.py: improved instantiation error handling.
3788
3789- code.py: reworked quite a bit. New base class
3790InteractiveInterpreter and derived class InteractiveConsole. Fixed
3791several problems in compile_command().
3792
3793- py_compile.py: print error message and continue on syntax errors.
3794Also fixed an old bug with the fstat code (it was never used).
3795
3796- pyclbr.py: support submodules of packages.
3797
3798String Services
3799---------------
3800
3801- StringIO.py: raise the right exception (ValueError) for attempted
3802I/O on closed StringIO objects.
3803
3804- re.py: fixed a bug in subn(), which caused .groups() to fail inside
3805the replacement function called by sub().
3806
3807- The struct module has a new format 'P': void * in native mode.
3808
3809Generic OS Services
3810-------------------
3811
3812- Module time: Y2K robustness. 2-digit year acceptance depends on
3813value of time.accept2dyear, initialized from env var PYTHONY2K,
3814default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999
3815(POSIX or X/Open recommendation).
3816
3817- os.path: normpath(".//x") should return "x", not "/x".
3818
3819- getpass.py: fall back on default_getpass() when sys.stdin.fileno()
3820doesn't work.
3821
3822- tempfile.py: regenerate the template after a fork() call.
3823
3824Optional OS Services
3825--------------------
3826
3827- In the signal module, disable restarting interrupted system calls
3828when we have siginterrupt().
3829
3830Debugger
3831--------
3832
3833- No longer set __args__; this feature is no longer supported and can
3834affect the debugged code.
3835
3836- cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who
3837added aliases and some other useful new features, e.g. much better
3838breakpoint support: temporary breakpoint, disabled breakpoints,
3839breakpoints with ignore counts, and conditions; breakpoints can be set
3840on a file before it is loaded.
3841
3842Profiler
3843--------
3844
3845- Changes so that JPython can use it. Also fix the calibration code
3846so it actually works again
3847.
3848Internet Protocols and Support
3849------------------------------
3850
3851- imaplib.py: new version from Piers Lauder.
3852
3853- smtplib.py: change sendmail() method to accept a single string or a
3854list or strings as the destination (commom newbie mistake).
3855
3856- poplib.py: LIST with a msg argument fixed.
3857
3858- urlparse.py: some optimizations for common case (http).
3859
3860- urllib.py: support content-length in info() for ftp protocol;
3861support for a progress meter through a third argument to
3862urlretrieve(); commented out gopher test (the test site is dead).
3863
3864Internet Data handling
3865----------------------
3866
3867- sgmllib.py: support tags with - or . in their name.
3868
3869- mimetypes.py: guess_type() understands 'data' URLs.
3870
3871Restricted Execution
3872--------------------
3873
3874- The classes rexec.RModuleLoader and rexec.RModuleImporter no
3875longer exist.
3876
3877Tkinter
3878-------
3879
3880- When reporting an exception, store its info in sys.last_*. Also,
3881write all of it to stderr.
3882
3883- Added NS, EW, and NSEW constants, for grid's sticky option.
3884
3885- Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h".
3886
3887- Make bind variants without a sequence return a tuple of sequences
3888(formerly it returned a string, which wasn't very convenient).
3889
3890- Add image commands to the Text widget (these are new in Tk 8.0).
3891
3892- Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.)
3893
3894- Improved the thread code (but you still can't call update() from
3895another thread on Windows).
3896
3897- Fixed unnecessary references to _default_root in the new dialog
3898modules.
3899
3900- Miscellaneous problems fixed.
3901
3902
3903Windows General
3904---------------
3905
3906- Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to
3907search for dependent dlls in the directory containing the .pyd.
3908
3909- In debugging mode, call DebugBreak() in Py_FatalError().
3910
3911Windows Installer
3912-----------------
3913
3914- Install zlib.dll in the DLLs directory instead of in the win32
3915system directory, to avoid conflicts with other applications that have
3916their own zlib.dll.
3917
3918Test Suite
3919----------
3920
3921- test_long.py: new test for long integers, by Tim Peters.
3922
3923- regrtest.py: improved so it can be used for other test suites as
3924well.
3925
3926- test_strftime.py: use re to compare test results, to support legal
3927variants (e.g. on Linux).
3928
3929Tools and Demos
3930---------------
3931
3932- Four new scripts in Tools/scripts: crlf.py and lfcr.py (to
3933remove/add Windows style '\r\n' line endings), untabify.py (to remove
3934tabs), and rgrep.yp (reverse grep).
3935
3936- Improvements to Tools/freeze/. Each Python module is now written to
3937its own C file. This prevents some compilers or assemblers from
3938blowing up on large frozen programs, and saves recompilation time if
3939only a few modules are changed. Other changes too, e.g. new command
3940line options -x and -i.
3941
3942- Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py.
3943
3944Python/C API
3945------------
3946
3947- New mechanism to support extensions of the type object while
3948remaining backward compatible with extensions compiled for previous
3949versions of Python 1.5. A flags field indicates presence of certain
3950fields.
3951
3952- Addition to the buffer API to differentiate access to bytes and
39538-bit characters (in anticipation of Unicode characters).
3954
3955- New argument parsing format t# ("text") to indicate 8-bit
3956characters; s# simply means 8-bit bytes, for backwards compatibility.
3957
3958- New object type, bufferobject.c is an example and can be used to
3959create buffers from memory.
3960
3961- Some support for 64-bit longs, including some MS platforms.
3962
3963- Many calls to fprintf(stderr, ...) have been replaced with calls to
3964PySys_WriteStderr(...).
3965
3966- The calling context for PyOS_Readline() has changed: it must now be
3967called with the interpreter lock held! It releases the lock around
3968the call to the function pointed to by PyOS_ReadlineFunctionPointer
3969(default PyOS_StdioReadline()).
3970
3971- New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr().
3972
3973- Renamed header file "thread.h" to "pythread.h".
3974
3975- The code string of code objects may now be anything that supports the
3976buffer API.
3977
3978
3979======================================================================
3980
3981
3982From 1.5.1 to 1.5.2a1
3983=====================
3984
3985General
3986-------
3987
3988- When searching for the library, a landmark that is a compiled module
3989(string.pyc or string.pyo) is also accepted.
3990
3991- When following symbolic links to the python executable, use a loop
3992so that a symlink to a symlink can work.
3993
3994- Added a hack so that when you type 'quit' or 'exit' at the
3995interpreter, you get a friendly explanation of how to press Ctrl-D (or
3996Ctrl-Z) to exit.
3997
3998- New and improved Misc/python-mode.el (Python mode for Emacs).
3999
4000- Revert a new feature in Unix dynamic loading: for one or two
4001revisions, modules were loaded using the RTLD_GLOBAL flag. It turned
4002out to be a bad idea.
4003
4004Miscellaneous fixed bugs
4005------------------------
4006
4007- All patches on the patch page have been integrated. (But much more
4008has been done!)
4009
4010- Several memory leaks plugged (e.g. the one for classes with a
4011__getattr__ method).
4012
4013- Removed the only use of calloc(). This triggered an obscure bug on
4014multiprocessor Sparc Solaris 2.6.
4015
4016- Fix a peculiar bug that would allow "import sys.time" to succeed
4017(believing the built-in time module to be a part of the sys package).
4018
4019- Fix a bug in the overflow checking when converting a Python long to
4020a C long (failed to convert -2147483648L, and some other cases).
4021
4022Documentation
4023-------------
4024
4025- Doc strings have been added to many extension modules: __builtin__,
4026errno, select, signal, socket, sys, thread, time. Also to methods of
4027list objects (try [].append.__doc__). A doc string on a type will now
4028automatically be propagated to an instance if the instance has methods
4029that are accessed in the usual way.
4030
4031- The documentation has been expanded and the formatting improved.
4032(Remember that the documentation is now unbundled and has its own
4033release cycle though; see http://www.python.org/doc/.)
4034
4035- Added Misc/Porting -- a mini-FAQ on porting to a new platform.
4036
4037Ports and build procedure
4038-------------------------
4039
4040- The BeOS port is now integrated. Courtesy Chris Herborth.
4041
4042- Symbol files for FreeBSD 2.x and 3.x have been contributed
4043(Lib/plat-freebsd[23]/*).
4044
4045- Support HPUX 10.20 DCE threads.
4046
4047- Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0
4048works, it won't also use -Olimit 1500 (which gives a warning for every
4049file). Also support the SGI_ABI environment variable better.
4050
4051- The makesetup script now understands absolute pathnames ending in .o
4052in the module -- it assumes it's a file for which we have no source.
4053
4054- Other miscellaneous improvements to the configure script and
4055Makefiles.
4056
4057- The test suite now uses a different sound sample.
4058
4059Built-in functions
4060------------------
4061
4062- Better checks for invalid input to int(), long(), string.atoi(),
4063string.atol(). (Formerly, a sign without digits would be accepted as
4064a legal ways to spell zero.)
4065
4066- Changes to map() and filter() to use the length of a sequence only
4067as a hint -- if an IndexError happens earlier, take that. (Formerly,
4068this was considered an error.)
4069
4070- Experimental feature in getattr(): a third argument can specify a
4071default (instead of raising AttributeError).
4072
4073- Implement round() slightly different, so that for negative ndigits
4074no additional errors happen in the last step.
4075
4076- The open() function now adds the filename to the exception when it
4077fails.
4078
4079Built-in exceptions
4080-------------------
4081
4082- New standard exceptions EnvironmentError and PosixError.
4083EnvironmentError is the base class for IOError and PosixError;
4084PosixError is the same as os.error. All this so that either exception
4085class can be instantiated with a third argument indicating a filename.
4086The built-in function open() and most os/posix functions that take a
4087filename argument now use this.
4088
4089Built-in types
4090--------------
4091
4092- List objects now have an experimental pop() method; l.pop() returns
4093and removes the last item; l.pop(i) returns and removes the item at
4094i. Also, the sort() method is faster again. Sorting is now also
4095safer: it is impossible for the sorting function to modify the list
4096while the sort is going on (which could cause core dumps).
4097
4098- Changes to comparisons: numbers are now smaller than any other type.
4099This is done to prevent the circularity where [] < 0L < 1 < [] is
4100true. As a side effect, cmp(None, 0) is now positive instead of
4101negative. This *shouldn't* affect any working code, but I've found
4102that the change caused several "sleeping" bugs to become active, so
4103beware!
4104
4105- Instance methods may now have other callable objects than just
4106Python functions as their im_func. Use new.instancemethod() or write
4107your own C code to create them; new.instancemethod() may be called
4108with None for the instance to create an unbound method.
4109
4110- Assignment to __name__, __dict__ or __bases__ of a class object is
4111now allowed (with stringent type checks); also allow assignment to
4112__getattr__ etc. The cached values for __getattr__ etc. are
4113recomputed after such assignments (but not for derived classes :-( ).
4114
4115- Allow assignment to some attributes of function objects: func_code,
4116func_defaults and func_doc / __doc__. (With type checks except for
4117__doc__ / func_doc .)
4118
4119Python services
4120---------------
4121
4122- New tests (in Lib/test): reperf.py (regular expression benchmark),
4123sortperf.py (list sorting benchmark), test_MimeWriter.py (test case
4124for the MimeWriter module).
4125
4126- Generalized test/regrtest.py so that it is useful for testing other
4127packages.
4128
4129- The ihooks.py module now understands package imports.
4130
4131- In code.py, add a class that subsumes Fredrik Lundh's
4132PythonInterpreter class. The interact() function now uses this.
4133
4134- In rlcompleter.py, in completer(), return None instead of raising an
4135IndexError when there are no more completions left.
4136
4137- Fixed the marshal module to test for certain common kinds of invalid
4138input. (It's still not foolproof!)
4139
4140- In the operator module, add an alias (now the preferred name)
4141"contains" for "sequenceincludes".
4142
4143String Services
4144---------------
4145
4146- In the string and strop modules, in the replace() function, treat an
4147empty pattern as an error (since it's not clear what was meant!).
4148
4149- Some speedups to re.py, especially the string substitution and split
4150functions. Also added new function/method findall(), to find all
4151occurrences of a given substring.
4152
4153- In cStringIO, add better argument type checking and support the
4154readonly 'closed' attribute (like regular files).
4155
4156- In the struct module, unsigned 1-2 byte sized formats no longer
4157result in long integer values.
4158
4159Miscellaneous services
4160----------------------
4161
4162- In whrandom.py, added new method and function randrange(), same as
4163choice(range(start, stop, step)) but faster. This addresses the
4164problem that randint() was accidentally defined as taking an inclusive
4165range. Also, randint(a, b) is now redefined as randrange(a, b+1),
4166adding extra range and type checking to its arguments!
4167
4168- Add some semi-thread-safety to random.gauss() (it used to be able to
4169crash when invoked from separate threads; now the worst it can do is
4170give a duplicate result occasionally).
4171
4172- Some restructuring and generalization done to cmd.py.
4173
4174- Major upgrade to ConfigParser.py; converted to using 're', added new
4175exceptions, support underscore in section header and option name. No
4176longer add 'name' option to every section; instead, add '__name__'.
4177
4178- In getpass.py, don't use raw_input() to ask for the password -- we
4179don't want it to show up in the readline history! Also don't catch
4180interrupts (the try-finally already does all necessary cleanup).
4181
4182Generic OS Services
4183-------------------
4184
4185- New functions in os.py: makedirs(), removedirs(), renames(). New
4186variable: linesep (the line separator as found in binary files,
4187i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use
4188this with files opened in (default) text mode; the line separator used
4189will always be '\n'!
4190
4191- Changes to the 'os.path' submodule of os.py: added getsize(),
4192getmtime(), getatime() -- these fetch the most popular items from the
4193stat return tuple.
4194
4195- In the time module, add strptime(), if it exists. (This parses a
4196time according to a format -- the inverse of strftime().) Also,
4197remove the call to mktime() from strftime() -- it messed up the
4198formatting of some non-local times.
4199
4200- In the socket module, added a new function gethostbyname_ex().
4201Also, don't use #ifdef to test for some symbols that are enums on some
4202platforms (and should exist everywhere).
4203
4204Optional OS Services
4205--------------------
4206
4207- Some fixes to gzip.py. In particular, the readlines() method now
4208returns the lines *with* trailing newline characters, like readlines()
4209of regular file objects. Also, it didn't work together with cPickle;
4210fixed that.
4211
4212- In whichdb.py, support byte-swapped dbhash (bsddb) files.
4213
4214- In anydbm.py, look at the type of an existing database to determine
4215which module to use to open it. (The anydbm.error exception is now a
4216tuple.)
4217
4218Unix Services
4219-------------
4220
4221- In the termios module, in tcsetattr(), initialize the structure vy
4222calling tcgetattr().
4223
4224- Added some of the "wait status inspection" macros as functions to
4225the posix module (and thus to the os module): WEXITSTATUS(),
4226WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG().
4227
4228- In the syslog module, make the default facility more intuitive
4229(matching the docs).
4230
4231Debugger
4232--------
4233
4234- In pdb.py, support for setting breaks on files/modules that haven't
4235been loaded yet.
4236
4237Internet Protocols and Support
4238------------------------------
4239
4240- Changes in urllib.py; sped up unquote() and quote(). Fixed an
4241obscure bug in quote_plus(). Added urlencode(dict) -- convenience
4242function for sending a POST request with urlopen(). Use the getpass
4243module to ask for a password. Rewrote the (test) main program so that
4244when used as a script, it can retrieve one or more URLs to stdout.
4245Use -t to run the self-test. Made the proxy code work again.
4246
4247- In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't
4248fail when someone asks for their HEAD. Also, for POST, set the
4249default content-type to application/x-www-form-urlencoded. Also, in
4250FieldStorage.__init__(), when method='GET', always get the query
4251string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an
4252explicitly passed in fp.
4253
4254- The smtplib.py module now supports ESMTP and has improved standard
4255compliance, for picky servers.
4256
4257- Improved imaplib.py.
4258
4259- Fixed UDP support in SocketServer.py (it never worked).
4260
4261- Fixed a small bug in CGIHTTPServer.py.
4262
4263Internet Data handling
4264----------------------
4265
4266- In rfc822.py, add a new class AddressList. Also support a new
4267overridable method, isheader(). Also add a get() method similar to
4268dictionaries (and make getheader() an alias for it). Also, be smarter
4269about seekable (test whether fp.tell() works) and test for presence of
4270unread() method before trying seeks.
4271
4272- In sgmllib.py, restore the call to report_unbalanced() that was lost
4273long ago. Also some other improvements: handle <? processing
4274instructions >, allow . and - in entity names, and allow \r\n as line
4275separator.
4276
4277- Some restructuring and generalization done to multifile.py; support
4278a 'seekable' flag.
4279
4280Restricted Execution
4281--------------------
4282
4283- Improvements to rexec.py: package support; support a (minimal)
4284sys.exc_info(). Also made the (test) main program a bit fancier (you
4285can now use it to run arbitrary Python scripts in restricted mode).
4286
4287Tkinter
4288-------
4289
4290- On Unix, Tkinter can now safely be used from a multi-threaded
4291application. (Formerly, no threads would make progress while
4292Tkinter's mainloop() was active, because it didn't release the Python
4293interpreter lock.) Unfortunately, on Windows, threads other than the
4294main thread should not call update() or update_idletasks() because
4295this will deadlock the application.
4296
4297- An interactive interpreter that uses readline and Tkinter no longer
4298uses up all available CPU time.
4299
4300- Even if readline is not used, Tk windows created in an interactive
4301interpreter now get continuously updated. (This even works in Windows
4302as long as you don't hit a key.)
4303
4304- New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py.
4305
4306- No longer register Tcl_finalize() as a low-level exit handler. It
4307may call back into Python, and that's a bad idea.
4308
4309- Allow binding of Tcl commands (given as a string).
4310
4311- Some minor speedups; replace explicitly coded getint() with int() in
4312most places.
4313
4314- In FileDialog.py, remember the directory of the selected file, if
4315given.
4316
4317- Change the names of all methods in the Wm class: they are now
4318wm_title(), etc. The old names (title() etc.) are still defined as
4319aliases.
4320
4321- Add a new method of interpreter objects, interpaddr(). This returns
4322the address of the Tcl interpreter object, as an integer. Not very
4323useful for the Python programmer, but this can be called by another C
4324extension that needs to make calls into the Tcl/Tk C API and needs to
4325get the address of the Tcl interpreter object. A simple cast of the
4326return value to (Tcl_Interp *) will do the trick.
4327
4328Windows General
4329---------------
4330
4331- Don't insist on proper case for module source files if the filename
4332is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still
4333doesn't). This should address problems with this feature on
4334oldfashioned filesystems (Novell servers?).
4335
4336Windows Library
4337---------------
4338
4339- os.environ is now all uppercase, but accesses are case insensitive,
4340and the putenv() calls made as a side effect of changing os.environ
4341are case preserving.
4342
4343- Removed samefile(), sameopenfile(), samestat() from os.path (aka
4344ntpath.py) -- these cannot be made to work reliably (at least I
4345wouldn't know how).
4346
4347- Fixed os.pipe() so that it returns file descriptors acceptable to
4348os.read() and os.write() (like it does on Unix), rather than Windows
4349file handles.
4350
4351- Added a table of WSA error codes to socket.py.
4352
4353- In the select module, put the (huge) file descriptor arrays on the
4354heap.
4355
4356- The getpass module now raises KeyboardInterrupt when it sees ^C.
4357
4358- In mailbox.py, fix tell/seek when using files opened in text mode.
4359
4360- In rfc822.py, fix tell/seek when using files opened in text mode.
4361
4362- In the msvcrt extension module, release the interpreter lock for
4363calls that may block: _locking(), _getch(), _getche(). Also fix a
4364bogus error return when open_osfhandle() doesn't have the right
4365argument list.
4366
4367Windows Installer
4368-----------------
4369
4370- The registry key used is now "1.5" instead of "1.5.x" -- so future
4371versions of 1.5 and Mark Hammond's win32all installer don't need to be
4372resynchronized.
4373
4374Windows Tools
4375-------------
4376
4377- Several improvements to freeze specifically for Windows.
4378
4379Windows Build Procedure
4380-----------------------
4381
4382- The VC++ project files and the WISE installer have been moved to the
4383PCbuild subdirectory, so they are distributed in the same subdirectory
4384where they must be used. This avoids confusion.
4385
4386- New project files for Windows 3.1 port by Jim Ahlstrom.
4387
4388- Got rid of the obsolete subdirectory PC/setup_nt/.
4389
4390- The projects now use distinct filenames for the .exe, .dll, .lib and
4391.pyd files built in debug mode (by appending "_d" to the base name,
4392before the extension). This makes it easier to switch between the two
4393and get the right versions. There's a pragma in config.h that directs
4394the linker to include the appropriate .lib file (so python15.lib no
4395longer needs to be explicit in your project).
4396
4397- The installer now installs more files (e.g. config.h). The idea is
4398that you shouldn't need the source distribution if you want build your
4399own extensions in C or C++.
4400
4401Tools and Demos
4402---------------
4403
4404- New script nm2def.py by Marc-Andre Lemburg, to construct
4405PC/python_nt.def automatically (some hand editing still required).
4406
4407- New tool ndiff.py: Tim Peters' text diffing tool.
4408
4409- Various and sundry improvements to the freeze script.
4410
4411- The script texi2html.py (which was part of the Doc tree but is no
4412longer used there) has been moved to the Tools/scripts subdirectory.
4413
4414- Some generalizations in the webchecker code. There's now a
4415primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.)
4416
4417- The ftpmirror.py script now handles symbolic links properly, and
4418also files with multiple spaces in their names.
4419
4420- The 1.5.1 tabnanny.py suffers an assert error if fed a script whose
4421last line is both indented and lacks a newline. This is now fixed.
4422
4423Python/C API
4424------------
4425
4426- Added missing prototypes for PyEval_CallFunction() and
4427PyEval_CallMethod().
4428
4429- New macro PyList_SET_ITEM().
4430
4431- New macros to access object members for PyFunction, PyCFunction
4432objects.
4433
4434- New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to
4435dynamically add one or many entries to the table of built-in modules.
4436
4437- New macro Py_InitModule3(name, methods, doc) which calls
4438Py_InitModule4() with appropriate arguments. (The -4 variant requires
4439you to pass an obscure version number constant which is always the same.)
4440
4441- New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to
4442sys.stdout or sys.stderr using a printf-like interface. (Used in
4443_tkinter.c, for example.)
4444
4445- New APIs for conversion between Python longs and C 'long long' if
4446your compiler supports it.
4447
4448- PySequence_In() is now called PySequence_Contains().
4449(PySequence_In() is still supported for b/w compatibility; it is
4450declared obsolete because its argument order is confusing.)
4451
4452- PyDict_GetItem() and PyDict_GetItemString() are changed so that they
4453*never* raise an exception -- (even if the hash() fails, simply clear
4454the error). This was necessary because there is lots of code out
4455there that already assumes this.
4456
4457- Changes to PySequence_Tuple() and PySequence_List() to use the
4458length of a sequence only as a hint -- if an IndexError happens
4459earlier, take that. (Formerly, this was considered an error.)
4460
4461- Reformatted abstract.c to give it a more familiar "look" and fixed
4462many error checking bugs.
4463
4464- Add NULL pointer checks to all calls of a C function through a type
4465object and extensions (e.g. nb_add).
4466
4467- The code that initializes sys.path now calls Py_GetPythonHome()
4468instead of getenv("PYTHONHOME"). This, together with the new API
4469Py_SetPythonHome(), makes it easier for embedding applications to
4470change the notion of Python's "home" directory (where the libraries
4471etc. are sought).
4472
4473- Fixed a very old bug in the parsing of "O?" format specifiers.
4474
4475
4476======================================================================
4477
4478
Guido van Rossumf2eac992000-09-04 17:24:24 +00004479========================================
4480==> Release 1.5.1 (October 31, 1998) <==
4481========================================
4482
Guido van Rossum439d1fa1998-12-21 21:41:14 +00004483From 1.5 to 1.5.1
4484=================
4485
4486General
4487-------
4488
4489- The documentation is now unbundled. It has also been extensively
4490modified (mostly to implement a new and more uniform formatting
4491style). We figure that most people will prefer to download one of the
4492preformatted documentation sets (HTML, PostScript or PDF) and that
4493only a minority have a need for the LaTeX or FrameMaker sources. Of
4494course, the unbundled documentation sources still released -- just not
4495in the same archive file, and perhaps not on the same date.
4496
4497- All bugs noted on the errors page (and many unnoted) are fixed. All
4498new bugs take their places.
4499
4500- No longer a core dump when attempting to print (or repr(), or str())
4501a list or dictionary that contains an instance of itself; instead, the
4502recursive entry is printed as [...] or {...}. See Py_ReprEnter() and
4503Py_ReprLeave() below. Comparisons of such objects still go beserk,
4504since this requires a different kind of fix; fortunately, this is a
4505less common scenario in practice.
4506
4507Syntax change
4508-------------
4509
4510- The raise statement can now be used without arguments, to re-raise
4511a previously set exception. This should be used after catching an
4512exception with an except clause only, either in the except clause or
4513later in the same function.
4514
4515Import and module handling
4516--------------------------
4517
4518- The implementation of import has changed to use a mutex (when
4519threading is supported). This means that when two threads
4520simultaneously import the same module, the import statements are
4521serialized. Recursive imports are not affected.
4522
4523- Rewrote the finalization code almost completely, to be much more
4524careful with the order in which modules are destroyed. Destructors
4525will now generally be able to reference built-in names such as None
4526without trouble.
4527
4528- Case-insensitive platforms such as Mac and Windows require the case
4529of a module's filename to match the case of the module name as
4530specified in the import statement (see below).
4531
4532- The code for figuring out the default path now distinguishes between
4533files, modules, executable files, and directories. When expecting a
4534module, we also look for the .pyc or .pyo file.
4535
4536Parser/tokenizer changes
4537------------------------
4538
4539- The tokenizer can now warn you when your source code mixes tabs and
4540spaces for indentation in a manner that depends on how much a tab is
4541worth in spaces. Use "python -t" or "python -v" to enable this
4542option. Use "python -tt" to turn the warnings into errors. (See also
4543tabnanny.py and tabpolice.py below.)
4544
4545- Return unsigned characters from tok_nextc(), so '\377' isn't
4546mistaken for an EOF character.
4547
4548- Fixed two pernicious bugs in the tokenizer that only affected AIX.
4549One was actually a general bug that was triggered by AIX's smaller I/O
4550buffer size. The other was a bug in the AIX optimizer's loop
4551unrolling code; swapping two statements made the problem go away.
4552
4553Tools, demos and miscellaneous files
4554------------------------------------
4555
4556- There's a new version of Misc/python-mode.el (the Emacs mode for
4557Python) which is much smarter about guessing the indentation style
4558used in a particular file. Lots of other cool features too!
4559
4560- There are two new tools in Tools/scripts: tabnanny.py and
4561tabpolice.py, implementing two different ways of checking whether a
4562file uses indentation in a way that is sensitive to the interpretation
4563of a tab. The preferred module is tabnanny.py (by Tim Peters).
4564
4565- Some new demo programs:
4566
4567 Demo/tkinter/guido/paint.py -- Dave Mitchell
4568 Demo/sockets/unixserver.py -- Piet van Oostrum
4569
4570
4571- Much better freeze support. The freeze script can now freeze
4572hierarchical module names (with a corresponding change to import.c),
4573and has a few extra options (e.g. to suppress freezing specific
4574modules). It also does much more on Windows NT.
4575
4576- Version 1.0 of the faq wizard is included (only very small changes
4577since version 0.9.0).
4578
4579- New feature for the ftpmirror script: when removing local files
4580(i.e., only when -r is used), do a recursive delete.
4581
4582Configuring and building Python
4583-------------------------------
4584
4585- Get rid of the check for -linet -- recent Sequent Dynix systems don't
4586need this any more and apparently it screws up their configuration.
4587
4588- Some changes because gcc on SGI doesn't support '-all'.
4589
4590- Changed the build rules to use $(LIBRARY) instead of
4591 -L.. -lpython$(VERSION)
4592since the latter trips up the SunOS 4.1.x linker (sigh).
4593
4594- Fix the bug where the '# dgux is broken' comment in the Makefile
4595tripped over Make on some platforms.
4596
4597- Changes for AIX: install the python.exp file; properly use
4598$(srcdir); the makexp_aix script now removes C++ entries of the form
4599Class::method.
4600
4601- Deleted some Makefile targets only used by the (long obsolete)
4602gMakefile hacks.
4603
4604Extension modules
4605-----------------
4606
4607- Performance and threading improvements to the socket and bsddb
4608modules, by Christopher Lindblad of Infoseek.
4609
4610- Added operator.__not__ and operator.not_.
4611
4612- In the thread module, when a thread exits due to an unhandled
4613exception, don't store the exception information in sys.last_*; it
4614prevents proper calling of destructors of local variables.
4615
4616- Fixed a number of small bugs in the cPickle module.
4617
4618- Changed find() and rfind() in the strop module so that
4619find("x","",2) returns -1, matching the implementation in string.py.
4620
4621- In the time module, be more careful with the result of ctime(), and
4622test for HAVE_MKTIME before usinmg mktime().
4623
4624- Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm
4625modules.
4626
4627- Added the LOG_SYSLOG constant to the syslog module, if defined.
4628
4629Standard library modules
4630------------------------
4631
4632- All standard library modules have been converted to an indentation
4633style using either only tabs or only spaces -- never a mixture -- if
4634they weren't already consistent according to tabnanny. This means
4635that the new -t option (see above) won't complain about standard
4636library modules.
4637
4638- New standard library modules:
4639
4640 threading -- GvR and the thread-sig
4641 Java style thread objects -- USE THIS!!!
4642
4643 getpass -- Piers Lauder
4644 simple utilities to prompt for a password and to
4645 retrieve the current username
4646
4647 imaplib -- Piers Lauder
4648 interface for the IMAP4 protocol
4649
4650 poplib -- David Ascher, Piers Lauder
4651 interface for the POP3 protocol
4652
4653 smtplib -- Dragon De Monsyne
4654 interface for the SMTP protocol
4655
4656- Some obsolete modules moved to a separate directory (Lib/lib-old)
4657which is *not* in the default module search path:
4658
4659 Para
4660 addpack
4661 codehack
4662 fmt
4663 lockfile
4664 newdir
4665 ni
4666 rand
4667 tb
4668
4669- New version of the PCRE code (Perl Compatible Regular Expressions --
4670the re module and the supporting pcre extension) by Andrew Kuchling.
4671Incompatible new feature in re.sub(): the handling of escapes in the
4672replacement string has changed.
4673
4674- Interface change in the copy module: a __deepcopy__ method is now
4675called with the memo dictionary as an argument.
4676
4677- Feature change in the tokenize module: differentiate between NEWLINE
4678token (an official newline) and NL token (a newline that the grammar
4679ignores).
4680
4681- Several bugfixes to the urllib module. It is now truly thread-safe,
4682and several bugs and a portability problem have been fixed. New
4683features, all due to Sjoerd Mullender: When creating a temporary file,
4684it gives it an appropriate suffix. Support the "data:" URL scheme.
4685The open() method uses the tempcache.
4686
4687- New version of the xmllib module (this time with a test suite!) by
4688Sjoerd Mullender.
4689
4690- Added debugging code to the telnetlib module, to be able to trace
4691the actual traffic.
4692
4693- In the rfc822 module, added support for deleting a header (still no
4694support for adding headers, though). Also fixed a bug where an
4695illegal address would cause a crash in getrouteaddr(), fixed a
4696sign reversal in mktime_tz(), and use the local timezone by default
4697(the latter two due to Bill van Melle).
4698
4699- The normpath() function in the dospath and ntpath modules no longer
4700does case normalization -- for that, use the separate function
4701normcase() (which always existed); normcase() has been sped up and
4702fixed (it was the cause of a crash in Mark Hammond's installer in
4703certain locales).
4704
4705- New command supported by the ftplib module: rmd(); also fixed some
4706minor bugs.
4707
4708- The profile module now uses a different timer function by default --
4709time.clock() is generally better than os.times(). This makes it work
4710better on Windows NT, too.
4711
4712- The tempfile module now recovers when os.getcwd() raises an
4713exception.
4714
4715- Fixed some bugs in the random module; gauss() was subtly wrong, and
4716vonmisesvariate() should return a full circle. Courtesy Mike Miller,
4717Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()).
4718
4719- Better default seed in the whrandom module, courtesy Andrew Kuchling.
4720
4721- Fix slow close() in shelve module.
4722
4723- The Unix mailbox class in the mailbox module is now more robust when
4724a line begins with the string "From " but is definitely not the start
4725of a new message. The pattern used can be changed by overriding a
4726method or class variable.
4727
4728- Added a rmtree() function to the copy module.
4729
4730- Fixed several typos in the pickle module. Also fixed problems when
4731unpickling in restricted execution environments.
4732
4733- Added docstrings and fixed a typo in the py_compile and compileall
4734modules. At Mark Hammond's repeated request, py_compile now append a
4735newline to the source if it needs one. Both modules support an extra
4736parameter to specify the purported source filename (to be used in
4737error messages).
4738
4739- Some performance tweaks by Jeremy Hylton to the gzip module.
4740
4741- Fixed a bug in the merge order of dictionaries in the ConfigParser
4742module. Courtesy Barry Warsaw.
4743
4744- In the multifile module, support the optional second parameter to
4745seek() when possible.
4746
4747- Several fixes to the gopherlib module by Lars Marius Garshol. Also,
4748urlparse now correctly handles Gopher URLs with query strings.
4749
4750- Fixed a tiny bug in format_exception() in the traceback module.
4751Also rewrite tb_lineno() to be compatible with JPython (and not
4752disturb the current exception!); by Jim Hugunin.
4753
4754- The httplib module is more robust when servers send a short response
4755-- courtesy Tim O'Malley.
4756
4757Tkinter and friends
4758-------------------
4759
4760- Various typos and bugs fixed.
4761
4762- New module Tkdnd implements a drag-and-drop protocol (within one
4763application only).
4764
4765- The event_*() widget methods have been restructured slightly -- they
4766no longer use the default root.
4767
4768- The interfaces for the bind*() and unbind() widget methods have been
4769redesigned; the bind*() methods now return the name of the Tcl command
4770created for the callback, and this can be passed as a optional
4771argument to unbind() in order to delete the command (normally, such
4772commands are automatically unbound when the widget is destroyed, but
4773for some applications this isn't enough).
4774
4775- Variable objects now have trace methods to interface to Tcl's
4776variable tracing facilities.
4777
4778- Image objects now have an optional keyword argument, 'master', to
4779specify a widget (tree) to which they belong. The image_names() and
4780image_types() calls are now also widget methods.
4781
4782- There's a new global call, Tkinter.NoDefaultRoot(), which disables
4783all use of the default root by the Tkinter library. This is useful to
4784debug applications that are in the process of being converted from
4785relying on the default root to explicit specification of the root
4786widget.
4787
4788- The 'exit' command is deleted from the Tcl interpreter, since it
4789provided a loophole by which one could (accidentally) exit the Python
4790interpreter without invoking any cleanup code.
4791
4792- Tcl_Finalize() is now registered as a Python low-level exit handle,
4793so Tcl will be finalized when Python exits.
4794
4795The Python/C API
4796----------------
4797
4798- New function PyThreadState_GetDict() returns a per-thread dictionary
4799intended for storing thread-local global variables.
4800
4801- New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread
4802dictionary to allow recursive container types to detect recursion in
4803their repr(), str() and print implementations.
4804
4805- New function PyObject_Not(x) calculates (not x) according to Python's
4806standard rules (basically, it negates the outcome PyObject_IsTrue(x).
4807
4808- New function _PyModule_Clear(), which clears a module's dictionary
4809carefully without removing the __builtins__ entry. This is implied
4810when a module object is deallocated (this used to clear the dictionary
4811completely).
4812
4813- New function PyImport_ExecCodeModuleEx(), which extends
4814PyImport_ExecCodeModule() by adding an extra parameter to pass it the
4815true file.
4816
4817- New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to
4818allow embedded applications to force a different value for PYTHONHOME.
4819
4820- New global flag Py_FrozenFlag is set when this is a "frozen" Python
4821binary; it suppresses warnings about not being able to find the
4822standard library directories.
4823
4824- New global flag Py_TabcheckFlag is incremented by the -t option and
4825causes the tokenizer to issue warnings or errors about inconsistent
4826mixing of tabs and spaces for indentation.
4827
4828Miscellaneous minor changes and bug fixes
4829-----------------------------------------
4830
4831- Improved the error message when an attribute of an attribute-less
4832object is requested -- include the name of the attribute and the type
4833of the object in the message.
4834
4835- Sped up int(), long(), float() a bit.
4836
4837- Fixed a bug in list.sort() that would occasionally dump core.
4838
4839- Fixed a bug in PyNumber_Power() that caused numeric arrays to fail
4840when taken tothe real power.
4841
4842- Fixed a number of bugs in the file reading code, at least one of
4843which could cause a core dump on NT, and one of which would
4844occasionally cause file.read() to return less than the full contents
4845of the file.
4846
4847- Performance hack by Vladimir Marangozov for stack frame creation.
4848
4849- Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined.
4850
4851Windows 95/NT
4852-------------
4853
4854- The .lib files are now part of the distribution; they are collected
4855in the subdirectory "libs" of the installation directory.
4856
4857- The extension modules (.pyd files) are now collected in a separate
4858subdirectory of the installation directory named "DLLs".
4859
4860- The case of a module's filename must now match the case of the
4861module name as specified in the import statement. This is an
4862experimental feature -- if it turns out to break in too many
4863situations, it will be removed (or disabled by default) in the future.
4864It can be disabled on a per-case basis by setting the environment
4865variable PYTHONCASEOK (to any value).
4866
4867
4868======================================================================
4869
4870
Guido van Rossumf2eac992000-09-04 17:24:24 +00004871=====================================
4872==> Release 1.5 (January 3, 1998) <==
4873=====================================
4874
4875
Guido van Rossum439d1fa1998-12-21 21:41:14 +00004876From 1.5b2 to 1.5
4877=================
4878
4879- Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein.
4880
4881- Added doc strings to string.py, stropmodule.c, structmodule.c,
4882thanks to Charles Waldman.
4883
4884- Many nits fixed in the manuals, thanks to Fred Drake and many others
4885(especially Rob Hooft and Andrew Kuchling). The HTML version now uses
4886HTML markup instead of inline GIF images for tables; only two images
4887are left (for obsure bits of math). The index of the HTML version has
4888also been much improved. Finally, it is once again possible to
4889generate an Emacs info file from the library manual (but I don't
4890commit to supporting this in future versions).
4891
4892- New module: telnetlib.py (a simple telnet client library).
4893
4894- New tool: Tools/versioncheck/, by Jack Jansen.
4895
4896- Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS
4897DevStudio 5.0 now includes new subprojects to build the zlib and bsddb
4898extension modules.
4899
4900- Many small changes again to Tkinter.py -- mostly bugfixes and adding
4901missing routines. Thanks to Greg McFarlane for reporting a bunch of
4902problems and proofreading my fixes.
4903
4904- The re module and its documentation are up to date with the latest
4905version released to the string-sig (Dec. 22).
4906
4907- Stop test_grp.py from failing when the /etc/group file is empty
4908(yes, this happens!).
4909
4910- Fix bug in integer conversion (mystrtoul.c) that caused
49114294967296==0 to be true!
4912
4913- The VC++ 4.2 project file should be complete again.
4914
4915- In tempfile.py, use a better template on NT, and add a new optional
4916argument "suffix" with default "" to specify a specific extension for
4917the temporary filename (needed sometimes on NT but perhaps also handy
4918elsewhere).
4919
4920- Fixed some bugs in the FAQ wizard, and converted it to use re
4921instead of regex.
4922
4923- Fixed a mysteriously undetected error in dlmodule.c (it was using a
4924totally bogus routine name to raise an exception).
4925
4926- Fixed bug in import.c which wasn't using the new "dos-8x3" name yet.
4927
4928- Hopefully harmless changes to the build process to support shared
4929libraries on DG/UX. This adds a target to create
4930libpython$(VERSION).so; however this target is *only* for DG/UX.
4931
4932- Fixed a bug in the new format string error checking in getargs.c.
4933
4934- A simple fix for infinite recursion when printing __builtins__:
4935reset '_' to None before printing and set it to the printed variable
4936*after* printing (and only when printing is successful).
4937
4938- Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the
4939parent window is not (Skip Montanaro).
4940
4941- Fixed the two most annoying problems with ftp URLs in
4942urllib.urlopen(); an empty file now correctly raises an error, and it
4943is no longer required to explicitly close the returned "file" object
4944before opening another ftp URL to the same host and directory.
4945
4946
4947======================================================================
4948
4949
4950From 1.5b1 to 1.5b2
4951===================
4952
4953- Fixed a bug in cPickle.c that caused it to crash right away because
4954the version string had a different format.
4955
4956- Changes in pickle.py and cPickle.c: when unpickling an instance of a
4957class that doesn't define the __getinitargs__() method, the __init__()
4958constructor is no longer called. This makes a much larger group of
4959classes picklable by default, but may occasionally change semantics.
4960To force calling __init__() on unpickling, define a __getinitargs__()
4961method. Other changes too, in particular cPickle now handles classes
4962defined in packages correctly. The same change applies to copying
4963instances with copy.py. The cPickle.c changes and some pickle.py
4964changes are courtesy Jim Fulton.
4965
4966- Locale support in he "re" (Perl regular expressions) module. Use
4967the flag re.L (or re.LOCALE) to enable locale-specific matching
4968rules for \w and \b. The in-line syntax for this flag is (?L).
4969
4970- The built-in function isinstance(x, y) now also succeeds when y is
4971a type object and type(x) is y.
4972
4973- repr() and str() of class and instance objects now reflect the
4974package/module in which the class is defined.
4975
4976- Module "ni" has been removed. (If you really need it, it's been
4977renamed to "ni1". Let me know if this causes any problems for you.
4978Package authors are encouraged to write __init__.py files that
4979support both ni and 1.5 package support, so the same version can be
4980used with Python 1.4 as well as 1.5.)
4981
4982- The thread module is now automatically included when threads are
4983configured. (You must remove it from your existing Setup file,
4984since it is now in its own Setup.thread file.)
4985
4986- New command line option "-x" to skip the first line of the script;
4987handy to make executable scripts on non-Unix platforms.
4988
4989- In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I
4990haven't checked how this affects things, but it should make symbols
4991in one shared library available to the next one.
4992
4993- The Windows installer now installs in the "Program Files" folder on
4994the proper volume by default.
4995
4996- The Windows configuration adds a new main program, "pythonw", and
4997registers a new extension, ".pyw" that invokes this. This is a
4998pstandard Python interpreter that does not pop up a console window;
4999handy for pure Tkinter applications. All output to the original
5000stdout and stderr is lost; reading from the original stdin yields
5001EOF. Also, both python.exe and pythonw.exe now have a pretty icon
5002(a green snake in a box, courtesy Mark Hammond).
5003
5004- Lots of improvements to emacs-mode.el again. See Barry's web page:
5005http://www.python.org/ftp/emacs/pmdetails.html.
5006
5007- Lots of improvements and additions to the library reference manual;
5008many by Fred Drake.
5009
5010- Doc strings for the following modules: rfc822.py, posixpath.py,
5011ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman.
5012
5013- Some more regression testing.
5014
5015- An optional 4th (maxsplit) argument to strop.replace().
5016
5017- Fixed handling of maxsplit in string.splitfields().
5018
5019- Tweaked os.environ so it can be pickled and copied.
5020
5021- The portability problems caused by indented preprocessor commands
5022and C++ style comments should be gone now.
5023
5024- In random.py, added Pareto and Weibull distributions.
5025
5026- The crypt module is now disabled in Modules/Setup.in by default; it
5027is rarely needed and causes errors on some systems where users often
5028don't know how to deal with those.
5029
5030- Some improvements to the _tkinter build line suggested by Case Roole.
5031
5032- A full suite of platform specific files for NetBSD 1.x, submitted by
5033Anders Andersen.
5034
5035- New Solaris specific header STROPTS.py.
5036
5037- Moved a confusing occurrence of *shared* from the comments in
5038Modules/Setup.in (people would enable this one instead of the real
5039one, and get disappointing results).
5040
5041- Changed the default mode for directories to be group-writable when
5042the installation process creates them.
5043
5044- Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support
5045shared libraries for both.
5046
5047- Support FreeBSD and NetBSD in posixfile.py.
5048
5049- Support for the "event" command, new in Tk 4.2. By Case Roole.
5050
5051- Add Tix_SafeInit() support to tkappinit.c.
5052
5053- Various bugs fixed in "re.py" and "pcre.c".
5054
5055- Fixed a bug (broken use of the syntax table) in the old "regexpr.c".
5056
5057- In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED
5058is set.
5059
5060- Provide default blocksize for retrbinary in ftplib.py (Skip
5061Montanaro).
5062
5063- In NT, pick the username up from different places in user.py (Jeff
5064Bauer).
5065
5066- Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg.
5067
5068- Many small improvements to Jeff Rush' OS/2 support.
5069
5070- ospath.py is gone; it's been obsolete for so many years now...
5071
5072- The reference manual is now set up to prepare better HTML (still
5073using webmaker, alas).
5074
5075- Add special handling to /Tools/freeze for Python modules that are
5076imported implicitly by the Python runtime: 'site' and 'exceptions'.
5077
5078- Tools/faqwiz 0.8.3 -- add an option to suppress URL processing
5079inside <PRE>, by "Scott".
5080
5081- Added ConfigParser.py, a generic parser for sectioned configuration
5082files.
5083
5084- In _localemodule.c, LC_MESSAGES is not always defined; put it
5085between #ifdefs.
5086
5087- Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN.
5088
5089- Demo/scripts/newslist.py: Fix the way the version number is gotten
5090out of the RCS revision.
5091
5092- PyArg_Parse[Tuple] now explicitly check for bad characters at the
5093end of the format string.
5094
5095- Revamped PC/example_nt to support VC++ 5.x.
5096
5097- <listobject>.sort() now uses a modified quicksort by Raymund Galvin,
5098after studying the GNU libg++ quicksort. This should be much faster
5099if there are lots of duplicates, and otherwise at least as good.
5100
5101- Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the
5102uudecode bug where it complaints about trailing garbage is still there
5103:-( ).
5104
5105- pickle.py requires integers in text mode to be in decimal notation
5106(it used to accept octal and hex, even though it would only generate
5107decimal numbers).
5108
5109- In string.atof(), don't fail when the "re" module is unavailable.
5110Plug the ensueing security leak by supplying an empty __builtins__
5111directory to eval().
5112
5113- A bunch of small fixes and improvements to Tkinter.py.
5114
5115- Fixed a buffer overrun in PC/getpathp.c.
5116
5117
5118======================================================================
5119
5120
5121From 1.5a4 to 1.5b1
5122===================
5123
5124- The Windows NT/95 installer now includes full HTML of all manuals.
5125It also has a checkbox that lets you decide whether to install the
5126interpreter and library. The WISE installer script for the installer
5127is included in the source tree as PC/python15.wse, and so are the
5128icons used for Python files. The config.c file for the Windows build
5129is now complete with the pcre module.
5130
5131- sys.ps1 and sys.ps2 can now arbitrary objects; their str() is
5132evaluated for the prompt.
5133
5134- The reference manual is brought up to date (more or less -- it still
5135needs work, e.g. in the area of package import).
5136
5137- The icons used by latex2html are now included in the Doc
5138subdirectory (mostly so that tarring up the HTML files can be fully
5139automated). A simple index.html is also added to Doc (it only works
5140after you have successfully run latex2html).
5141
5142- For all you would-be proselytizers out there: a new version of
5143Misc/BLURB describes Python more concisely, and Misc/comparisons
5144compares Python to several other languages. Misc/BLURB.WINDOWS
5145contains a blurb specifically aimed at Windows programmers (by Mark
5146Hammond).
5147
5148- A new version of the Python mode for Emacs is included as
5149Misc/python-mode.el. There are too many new features to list here.
5150See http://www.python.org/ftp/emacs/pmdetails.html for more info.
5151
5152- New module fileinput makes iterating over the lines of a list of
5153files easier. (This still needs some more thinking to make it more
5154extensible.)
5155
5156- There's full OS/2 support, courtesy Jeff Rush. To build the OS/2
5157version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual
5158Age C++ compiler. I expect that Jeff will also provide a binary
5159release for this platform.
5160
5161- On Linux, the configure script now uses '-Xlinker -export-dynamic'
5162instead of '-rdynamic' to link the main program so that it exports its
5163symbols to shared libraries it loads dynamically. I hope this doesn't
5164break on older Linux versions; it is needed for mklinux and appears to
5165work on Linux 2.0.30.
5166
5167- Some Tkinter resstructuring: the geometry methods that apply to a
5168master are now properly usable on toplevel master widgets. There's a
5169new (internal) widget class, BaseWidget. New, longer "official" names
5170for the geometry manager methods have been added,
5171e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old
5172shorter names still work, and where there's ambiguity, pack wins over
5173place wins over grid. Also, the bind_class method now returns its
5174value.
5175
5176- New, RFC-822 conformant parsing of email addresses and address lists
5177in the rfc822 module, courtesy Ben Escoto.
5178
5179- New, revamped tkappinit.c with support for popular packages (PIL,
5180TIX, BLT, TOGL). For the last three, you need to execute the Tcl
5181command "load {} Tix" (or Blt, or Togl) to gain access to them.
5182The Modules/Setup line for the _tkinter module has been rewritten
5183using the cool line-breaking feature of most Bourne shells.
5184
5185- New socket method connect_ex() returns the error code from connect()
5186instead of raising an exception on errors; this makes the logic
5187required for asynchronous connects simpler and more efficient.
5188
5189- New "locale" module with (still experimental) interface to the
5190standard C library locale interface, courtesy Martin von Loewis. This
5191does not repeat my mistake in 1.5a4 of always calling
5192setlocale(LC_ALL, ""). In fact, we've pretty much decided that
5193Python's standard numerical formatting operations should always use
5194the conventions for the C locale; the locale module contains utility
5195functions to format numbers according to the user specified locale.
5196(All this is accomplished by an explicit call to setlocale(LC_NUMERIC,
5197"C") after locale-changing calls.) See the library manual. (Alas, the
5198promised changes to the "re" module for locale support have not been
5199materialized yet. If you care, volunteer!)
5200
5201- Memory leak plugged in Py_BuildValue when building a dictionary.
5202
5203- Shared modules can now live inside packages (hierarchical module
5204namespaces). No changes to the shared module itself are needed.
5205
5206- Improved policy for __builtins__: this is a module in __main__ and a
5207dictionary everywhere else.
5208
5209- Python no longer catches SIGHUP and SIGTERM by default. This was
5210impossible to get right in the light of thread contexts. If you want
5211your program to clean up when a signal happens, use the signal module
5212to set up your own signal handler.
5213
5214- New Python/C API PyNumber_CoerceEx() does not return an exception
5215when no coercion is possible. This is used to fix a problem where
5216comparing incompatible numbers for equality would raise an exception
5217rather than return false as in Python 1.4 -- it once again will return
5218false.
5219
5220- The errno module is changed again -- the table of error messages
5221(errorstr) is removed. Instead, you can use os.strerror(). This
5222removes redundance and a potential locale dependency.
5223
5224- New module xmllib, to parse XML files. By Sjoerd Mullender.
5225
5226- New C API PyOS_AfterFork() is called after fork() in posixmodule.c.
5227It resets the signal module's notion of what the current process ID
5228and thread are, so that signal handlers will work after (and across)
5229calls to os.fork().
5230
5231- Fixed most occurrences of fatal errors due to missing thread state.
5232
5233- For vgrind (a flexible source pretty printer) fans, there's a simple
5234Python definition in Misc/vgrindefs, courtesy Neale Pickett.
5235
5236- Fixed memory leak in exec statement.
5237
5238- The test.pystone module has a new function, pystones(loops=LOOPS),
5239which returns a (benchtime, stones) tuple. The main() function now
5240calls this and prints the report.
5241
5242- Package directories now *require* the presence of an __init__.py (or
5243__init__.pyc) file before they are considered as packages. This is
5244done to prevent accidental subdirectories with common names from
5245overriding modules with the same name.
5246
5247- Fixed some strange exceptions in __del__ methods in library modules
5248(e.g. urllib). This happens because the builtin names are already
5249deleted by the time __del__ is called. The solution (a hack, but it
5250works) is to set some instance variables to 0 instead of None.
5251
5252- The table of built-in module initializers is replaced by a pointer
5253variable. This makes it possible to switch to a different table at
5254run time, e.g. when a collection of modules is loaded from a shared
5255library. (No example code of how to do this is given, but it is
5256possible.) The table is still there of course, its name prefixed with
5257an underscore and used to initialize the pointer.
5258
5259- The warning about a thread still having a frame now only happens in
5260verbose mode.
5261
5262- Change the signal finialization so that it also resets the signal
5263handlers. After this has been called, our signal handlers are no
5264longer active!
5265
5266- New version of tokenize.py (by Ka-Ping Yee) recognizes raw string
5267literals. There's now also a test fort this module.
5268
5269- The copy module now also uses __dict__.update(state) instead of
5270going through individual attribute assignments, for class instances
5271without a __setstate__ method.
5272
5273- New module reconvert translates old-style (regex module) regular
5274expressions to new-style (re module, Perl-style) regular expressions.
5275
5276- Most modules that used to use the regex module now use the re
5277module. The grep module has a new pgrep() function which uses
5278Perl-style regular expressions.
5279
5280- The (very old, backwards compatibility) regexp.py module has been
5281deleted.
5282
5283- Restricted execution (rexec): added the pcre module (support for the
5284re module) to the list of trusted extension modules.
5285
5286- New version of Jim Fulton's CObject object type, adds
5287PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs.
5288
5289- Some patches to Lee Busby's fpectl mods that accidentally didn't
5290make it into 1.5a4.
5291
5292- In the string module, add an optional 4th argument to count(),
5293matching find() etc.
5294
5295- Patch for the nntplib module by Charles Waldman to add optional user
5296and password arguments to NNTP.__init__(), for nntp servers that need
5297them.
5298
5299- The str() function for class objects now returns
5300"modulename.classname" instead of returning the same as repr().
5301
5302- The parsing of \xXX escapes no longer relies on sscanf().
5303
5304- The "sharedmodules" subdirectory of the installation is renamed to
5305"lib-dynload". (You may have to edit your Modules/Setup file to fix
5306this in an existing installation!)
5307
5308- Fixed Don Beaudry's mess-up with the OPT test in the configure
5309script. Certain SGI platforms will still issue a warning for each
5310compile; there's not much I can do about this since the compiler's
5311exit status doesn't indicate that I was using an obsolete option.
5312
5313- Fixed Barry's mess-up with {}.get(), and added test cases for it.
5314
5315- Shared libraries didn't quite work under AIX because of the change
5316in status of the GNU readline interface. Fix due to by Vladimir
5317Marangozov.
5318
5319
5320======================================================================
5321
5322
5323From 1.5a3 to 1.5a4
5324===================
5325
5326- faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html>
5327feature; better install instructions; removed faqmain.py (which was an
5328older version).
5329
5330- nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian)
5331about the treatment of lines starting with '.'. Added a minimal test
5332function.
5333
5334- struct module: ignore most whitespace in format strings.
5335
5336- urllib.py: close the socket and temp file in URLopener.retrieve() so
5337that multiple retrievals using the same connection work.
5338
5339- All standard exceptions are now classes by default; use -X to make
5340them strings (for backward compatibility only).
5341
5342- There's a new standard exception hierarchy, defined in the standard
5343library module exceptions.py (which you never need to import
5344explicitly). See
5345http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for
5346more info.
5347
5348- Three new C API functions:
5349
5350 - int PyErr_GivenExceptionMatches(obj1, obj2)
5351
5352 Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
5353 instance of type obj2, or of a class derived from obj2
5354
5355 - int PyErr_ExceptionMatches(obj)
5356
5357 Higher level wrapper around PyErr_GivenExceptionMatches() which uses
5358 PyErr_Occurred() as obj1. This will be the more commonly called
5359 function.
5360
5361 - void PyErr_NormalizeException(typeptr, valptr, tbptr)
5362
5363 Normalizes exceptions, and places the normalized values in the
5364 arguments. If type is not a class, this does nothing. If type is a
5365 class, then it makes sure that value is an instance of the class by:
5366
5367 1. if instance is of the type, or a class derived from type, it does
5368 nothing.
5369
5370 2. otherwise it instantiates the class, using the value as an
5371 argument. If value is None, it uses an empty arg tuple, and if
5372 the value is a tuple, it uses just that.
5373
5374- Another new C API function: PyErr_NewException() creates a new
5375exception class derived from Exception; when -X is given, it creates a
5376new string exception.
5377
5378- core interpreter: remove the distinction between tuple and list
5379unpacking; allow an arbitrary sequence on the right hand side of any
5380unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same
5381thing, which should really be called UNPACK_SEQUENCE.)
5382
5383- classes: Allow assignments to an instance's __dict__ or __class__,
5384so you can change ivars (including shared ivars -- shock horror) and
5385change classes dynamically. Also make the check on read-only
5386attributes of classes less draconic -- only the specials names
5387__dict__, __bases__, __name__ and __{get,set,del}attr__ can't be
5388assigned.
5389
5390- Two new built-in functions: issubclass() and isinstance(). Both
5391take classes as their second arguments. The former takes a class as
5392the first argument and returns true iff first is second, or is a
5393subclass of second. The latter takes any object as the first argument
5394and returns true iff first is an instance of the second, or any
5395subclass of second.
5396
5397- configure: Added configuration tests for presence of alarm(),
5398pause(), and getpwent().
5399
5400- Doc/Makefile: changed latex2html targets.
5401
5402- classes: Reverse the search order for the Don Beaudry hook so that
5403the first class with an applicable hook wins. Makes more sense.
5404
5405- Changed the checks made in Py_Initialize() and Py_Finalize(). It is
5406now legal to call these more than once. The first call to
5407Py_Initialize() initializes, the first call to Py_Finalize()
5408finalizes. There's also a new API, Py_IsInitalized() which checks
5409whether we are already initialized (in case you want to leave things
5410as they were).
5411
5412- Completely disable the declarations for malloc(), realloc() and
5413free(). Any 90's C compiler has these in header files, and the tests
5414to decide whether to suppress the declarations kept failing on some
5415platforms.
5416
5417- *Before* (instead of after) signalmodule.o is added, remove both
5418intrcheck.o and sigcheck.o. This should get rid of warnings in ar or
5419ld on various systems.
5420
5421- Added reop to PC/config.c
5422
5423- configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms.
5424Removed outdated HP-UX comments from README. Added Cray T3E comments.
5425
5426- Various renames of statically defined functions that had name
5427conflicts on some systems, e.g. strndup (GNU libc), join (Cray),
5428roundup (sys/types.h).
5429
5430- urllib.py: Interpret three slashes in file: URL as local file (for
5431Netscape on Windows/Mac).
5432
5433- copy.py: Make sure the objects returned by __getinitargs__() are
5434kept alive (in the memo) to avoid a certain kind of nasty crash. (Not
5435easily reproducable because it requires a later call to
5436__getinitargs__() to return a tuple that happens to be allocated at
5437the same address.)
5438
5439- Added definition of AR to toplevel Makefile. Renamed @buildno temp
5440file to buildno1.
5441
5442- Moved Include/assert.h to Parser/assert.h, which seems to be the
5443only place where it's needed.
5444
5445- Tweaked the dictionary lookup code again for some more speed
5446(Vladimir Marangozov).
5447
5448- NT build: Changed the way python15.lib is included in the other
5449projects. Per Mark Hammond's suggestion, add it to the extra libs in
5450Settings instead of to the project's source files.
5451
5452- regrtest.py: Change default verbosity so that there are only three
5453levels left: -q, default and -v. In default mode, the name of each
5454test is now printed. -v is the same as the old -vv. -q is more quiet
5455than the old default mode.
5456
5457- Removed the old FAQ from the distribution. You now have to get it
5458from the web!
5459
5460- Removed the PC/make_nt.in file from the distribution; it is no
5461longer needed.
5462
5463- Changed the build sequence so that shared modules are built last.
5464This fixes things for AIX and doesn't hurt elsewhere.
5465
5466- Improved test for GNU MP v1 in mpzmodule.c
5467
5468- fileobject.c: ftell() on Linux discards all buffered data; changed
5469read() code to use lseek() instead to get the same effect
5470
5471- configure.in, configure, importdl.c: NeXT sharedlib fixes
5472
5473- tupleobject.c: PyTuple_SetItem asserts refcnt==1
5474
5475- resource.c: Different strategy regarding whether to declare
5476getrusage() and getpagesize() -- #ifdef doesn't work, Linux has
5477conflicting decls in its headers. Choice: only declare the return
5478type, not the argument prototype, and not on Linux.
5479
5480- importdl.c, configure*: set sharedlib extensions properly for NeXT
5481
5482- configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries
5483fixed; moved addition of PURIFY to LINKCC to configure
5484
5485- reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts
5486added to shup up various compilers.
5487
5488- _tkinter.c: removed buggy mac #ifndef
5489
5490- Doc: various Mac documentation changes, added docs for 'ic' module
5491
5492- PC/make_nt.in: deleted
5493
5494- test_time.py, test_strftime.py: tweaks to catch %Z (which may return
5495"")
5496
5497- test_rotor.py: print b -> print `b`
5498
5499- Tkinter.py: (tagOrId) -> (tagOrId,)
5500
5501- Tkinter.py: the Tk class now also has a configure() method and
5502friends (they have been moved to the Misc class to accomplish this).
5503
5504- dict.get(key[, default]) returns dict[key] if it exists, or default
5505if it doesn't. The default defaults to None. This is quicker for
5506some applications than using either has_key() or try:...except
5507KeyError:....
5508
5509- Tools/webchecker/: some small changes to webchecker.py; added
5510websucker.py (a simple web site mirroring script).
5511
5512- Dictionary objects now have a get() method (also in UserDict.py).
5513dict.get(key, default) returns dict[key] if it exists and default
5514otherwise; default defaults to None.
5515
5516- Tools/scripts/logmerge.py: print the author, too.
5517
5518- Changes to import: support for "import a.b.c" is now built in. See
5519http://grail.cnri.reston.va.us/python/essays/packages.html
5520for more info. Most important deviations from "ni.py": __init__.py is
5521executed in the package's namespace instead of as a submodule; and
5522there's no support for "__" or "__domain__". Note that "ni.py" is not
5523changed to match this -- it is simply declared obsolete (while at the
5524same time, it is documented...:-( ).
5525Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py"
5526for an example implementation of hierarchical module import written in
5527Python).
5528
5529- More changes to import: the site.py module is now imported by
5530default when Python is initialized; use -S to disable it. The site.py
5531module extends the path with several more directories: site-packages
5532inside the lib/python1.5/ directory, site-python in the lib/
5533directory, and pathnames mentioned in *.pth files found in either of
5534those directories. See
5535http://grail.cnri.reston.va.us/python/essays/packages.html
5536for more info.
5537
5538- Changes to standard library subdirectory names: those subdirectories
5539that are not packages have been renamed with a hypen in their name,
5540e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3.
5541The test suite is now a package -- to run a test, you must now use
5542"import test.test_foo".
5543
5544- A completely new re.py module is provided (thanks to Andrew
5545Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's
5546"pcre" re compiler and engine. For a while, the "old" re.py (which
5547was new in 1.5a3!) will be kept around as re1.py. The "old" regex
5548module and underlying parser and engine are still present -- while
5549regex is now officially obsolete, it will probably take several major
5550release cycles before it can be removed.
5551
5552- The posix module now has a strerror() function which translates an
5553error code to a string.
5554
5555- The emacs.py module (which was long obsolete) has been removed.
5556
5557- The universal makefile Misc/Makefile.pre.in now features an
5558"install" target. By default, installed shared libraries go into
5559$exec_prefix/lib/python$VERSION/site-packages/.
5560
5561- The install-sh script is installed with the other configuration
5562specific files (in the config/ subdirectory).
5563
5564- It turns out whatsound.py and sndhdr.py were identical modules.
5565Since there's also an imghdr.py file, I propose to make sndhdr.py the
5566official one. For compatibility, whatsound.py imports * from
5567sndhdr.py.
5568
5569- Class objects have a new attribute, __module__, giving the name of
5570the module in which they were declared. This is useful for pickle and
5571for printing the full name of a class exception.
5572
5573- Many extension modules no longer issue a fatal error when their
5574initialization fails; the importing code now checks whether an error
5575occurred during module initialization, and correctly propagates the
5576exception to the import statement.
5577
5578- Most extension modules now raise class-based exceptions (except when
5579-X is used).
5580
5581- Subtle changes to PyEval_{Save,Restore}Thread(): always swap the
5582thread state -- just don't manipulate the lock if it isn't there.
5583
5584- Fixed a bug in Python/getopt.c that made it do the wrong thing when
5585an option was a single '-'. Thanks to Andrew Kuchling.
5586
5587- New module mimetypes.py will guess a MIME type from a filename's
5588extension.
5589
5590- Windows: the DLL version is now settable via a resource rather than
5591being hardcoded. This can be used for "branding" a binary Python
5592distribution.
5593
5594- urllib.py is now threadsafe -- it now uses re instead of regex, and
5595sys.exc_info() instead of sys.exc_{type,value}.
5596
5597- Many other library modules that used to use
5598sys.exc_{type,value,traceback} are now more thread-safe by virtue of
5599using sys.exc_info().
5600
5601- The functions in popen2 have an optional buffer size parameter.
5602Also, the command argument can now be either a string (passed to the
5603shell) or a list of arguments (passed directly to execv).
5604
5605- Alas, the thread support for _tkinter released with 1.5a3 didn't
5606work. It's been rewritten. The bad news is that it now requires a
5607modified version of a file in the standard Tcl distribution, which you
5608must compile with a -I option pointing to the standard Tcl source
5609tree. For this reason, the thread support is disabled by default.
5610
5611- The errno extension module adds two tables: errorcode maps errno
5612numbers to errno names (e.g. EINTR), and errorstr maps them to
5613message strings. (The latter is redundant because the new call
5614posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg)
5615
5616- The readline extension module now provides some interfaces to
5617internal readline routines that make it possible to write a completer
5618in Python. An example completer, rlcompleter.py, is provided.
5619
5620 When completing a simple identifier, it completes keywords,
5621 built-ins and globals in __main__; when completing
5622 NAME.NAME..., it evaluates (!) the expression up to the last
5623 dot and completes its attributes.
5624
5625 It's very cool to do "import string" type "string.", hit the
5626 completion key (twice), and see the list of names defined by
5627 the string module!
5628
5629 Tip: to use the tab key as the completion key, call
5630
5631 readline.parse_and_bind("tab: complete")
5632
5633- The traceback.py module has a new function tb_lineno() by Marc-Andre
5634Lemburg which extracts the line number from the linenumber table in
5635the code object. Apparently the traceback object doesn't contains the
5636right linenumber when -O is used. Rather than guessing whether -O is
5637on or off, the module itself uses tb_lineno() unconditionally.
5638
5639- Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind()
5640to tag_bind() so it works again.
5641
5642- The pystone script is now a standard library module. Example use:
5643"import test.pystone; test.pystone.main()".
5644
5645- The import of the readline module in interactive mode is now also
5646attempted when -i is specified. (Yes, I know, giving in to Marc-Andre
5647Lemburg, who asked for this. :-)
5648
5649- rfc822.py: Entirely rewritten parseaddr() function by Sjoerd
5650Mullender, to be closer to the standard. This fixes the getaddr()
5651method. Unfortunately, getaddrlist() is as broken as ever, since it
5652splits on commas without regard for RFC 822 quoting conventions.
5653
5654- pprint.py: correctly emit trailing "," in singleton tuples.
5655
5656- _tkinter.c: export names for its type objects, TkappType and
5657TkttType.
5658
5659- pickle.py: use __module__ when defined; fix a particularly hard to
5660reproduce bug that confuses the memo when temporary objects are
5661returned by custom pickling interfaces; and a semantic change: when
5662unpickling the instance variables of an instance, use
5663inst.__dict__.update(value) instead of a for loop with setattr() over
5664the value.keys(). This is more consistent (the pickling doesn't use
5665getattr() either but pickles inst.__dict__) and avoids problems with
5666instances that have a __setattr__ hook. But it *is* a semantic change
5667(because the setattr hook is no longer used). So beware!
5668
5669- config.h is now installed (at last) in
5670$exec_prefix/include/python1.5/. For most sites, this means that it
5671is actually in $prefix/include/python1.5/, with all the other Python
5672include files, since $prefix and $exec_prefix are the same by
5673default.
5674
5675- The imp module now supports parts of the functionality to implement
5676import of hierarchical module names. It now supports find_module()
5677and load_module() for all types of modules. Docstrings have been
5678added for those functions in the built-in imp module that are still
5679relevant (some old interfaces are obsolete). For a sample
5680implementation of hierarchical module import in Python, see the new
5681library module knee.py.
5682
5683- The % operator on string objects now allows arbitrary nested parens
5684in a %(...)X style format. (Brad Howes)
5685
5686- Reverse the order in which Setup and Setup.local are passed to the
5687makesetup script. This allows variable definitions in Setup.local to
5688override definitions in Setup. (But you'll still have to edit Setup
5689if you want to disable modules that are enabled by default, or if such
5690modules need non-standard options.)
5691
5692- Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this
5693is like PyImport_ImporModule(name) but receives the globals and locals
5694dict and the fromlist arguments as well. (The name is a char*; the
5695others are PyObject*s).
5696
5697- The 'p' format in the struct extension module alloded to above is
5698new in 1.5a4.
5699
5700- The types.py module now uses try-except in a few places to make it
5701more likely that it can be imported in restricted mode. Some type
5702names are undefined in that case, e.g. CodeType (inaccessible),
5703FileType (not always accessible), and TracebackType and FrameType
5704(inaccessible).
5705
5706- In urllib.py: added separate administration of temporary files
5707created y URLopener.retrieve() so cleanup() can properly remove them.
5708The old code removed everything in tempcache which was a bad idea if
5709the user had passed a non-temp file into it. Also, in basejoin(),
5710interpret relative paths starting in "../". This is necessary if the
5711server uses symbolic links.
5712
5713- The Windows build procedure and project files are now based on
5714Microsoft Visual C++ 5.x. The build now takes place in the PCbuild
5715directory. It is much more robust, and properly builds separate Debug
5716and Release versions. (The installer will be added shortly.)
5717
5718- Added casts and changed some return types in regexpr.c to avoid
5719compiler warnings or errors on some platforms.
5720
5721- The AIX build tools for shared libraries now supports VPATH. (Donn
5722Cave)
5723
5724- By default, disable the "portable" multimedia modules audioop,
5725imageop, and rgbimg, since they don't work on 64-bit platforms.
5726
5727- Fixed a nasty bug in cStringIO.c when code was actually using the
5728close() method (the destructors would try to free certain fields a
5729second time).
5730
5731- For those who think they need it, there's a "user.py" module. This
5732is *not* imported by default, but can be imported to run user-specific
5733setup commands, ~/.pythonrc.py.
5734
5735- Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg,
5736Vladimir Marangozov, and others.
5737
5738- Added os.altsep; this is '/' on DOS/Windows, and None on systems
5739with a sane filename syntax.
5740
5741- os.py: Write out the dynamic OS choice, to avoid exec statements.
5742Adding support for a new OS is now a bit more work, but I bet that
5743'dos' or 'nt' will cover most situations...
5744
5745- The obsolete exception AccessError is now really gone.
5746
5747- Tools/faqwiz/: New installation instructions show how to maintain
5748multiple FAQs. Removed bootstrap script from end of faqwiz.py module.
5749Added instructions to bootstrap script, too. Version bumped to 0.8.1.
5750Added <html>...</html> feature suggested by Skip Montanaro. Added
5751leading text for Roulette, default to 'Hit Reload ...'. Fix typo in
5752default SRCDIR.
5753
5754- Documentation for the relatively new modules "keyword" and "symbol"
5755has been added (to the end of the section on the parser extension
5756module).
5757
5758- In module bisect.py, but functions have two optional argument 'lo'
5759and 'hi' which allow you to specify a subsequence of the array to
5760operate on.
5761
5762- In ftplib.py, changed most methods to return their status (even when
5763it is always "200 OK") rather than swallowing it.
5764
5765- main() now calls setlocale(LC_ALL, ""), if setlocale() and
5766<locale.h> are defined.
5767
5768- Changes to configure.in, the configure script, and both
5769Makefile.pre.in files, to support SGI's SGI_ABI platform selection
5770environment variable.
5771
5772
5773======================================================================
5774
5775
5776From 1.4 to 1.5a3
5777=================
5778
5779Security
5780--------
5781
5782- If you are using the setuid script C wrapper (Misc/setuid-prog.c),
5783please use the new version. The old version has a huge security leak.
5784
5785Miscellaneous
5786-------------
5787
5788- Because of various (small) incompatible changes in the Python
5789bytecode interpreter, the magic number for .pyc files has changed
5790again.
5791
5792- The default module search path is now much saner. Both on Unix and
5793Windows, it is essentially derived from the path to the executable
5794(which can be overridden by setting the environment variable
5795$PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in
5796front of the default path, like in Unix (instead of overriding the
5797default path). On Windows, the directory containing the executable is
5798added to the end of the path.
5799
5800- A new version of python-mode.el for Emacs has been included. Also,
5801a new file ccpy-style.el has been added to configure Emacs cc-mode for
5802the preferred style in Python C sources.
5803
5804- On Unix, when using sys.argv[0] to insert the script directory in
5805front of sys.path, expand a symbolic link. You can now install a
5806program in a private directory and have a symbolic link to it in a
5807public bin directory, and it will put the private directory in the
5808module search path. Note that the symlink is expanded in sys.path[0]
5809but not in sys.argv[0], so you can still tell the name by which you
5810were invoked.
5811
5812- It is now recommended to use ``#!/usr/bin/env python'' instead of
5813``#!/usr/local/bin/python'' at the start of executable scripts, except
5814for CGI scripts. It has been determined that the use of /usr/bin/env
5815is more portable than that of /usr/local/bin/python -- scripts almost
5816never have to be edited when the Python interpreter lives in a
5817non-standard place. Note that this doesn't work for CGI scripts since
5818the python executable often doesn't live in the HTTP server's default
5819search path.
5820
5821- The silly -s command line option and the corresponding
5822PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global
5823flag in the Python/C API) are gone.
5824
5825- Most problems on 64-bit platforms should now be fixed. Andrew
5826Kuchling helped. Some uncommon extension modules are still not
5827clean (image and audio ops?).
5828
5829- Fixed a bug where multiple anonymous tuple arguments would be mixed up
5830when using the debugger or profiler (reported by Just van Rossum).
5831The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this
5832would print the wrong value when run under the debugger or profiler.
5833
5834- The hacks that the dictionary implementation used to speed up
5835repeated lookups of the same C string were removed; these were a
5836source of subtle problems and don't seem to serve much of a purpose
5837any longer.
5838
5839- All traces of support for the long dead access statement have been
5840removed from the sources.
5841
5842- Plugged the two-byte memory leak in the tokenizer when reading an
5843interactive EOF.
5844
5845- There's a -O option to the interpreter that removes SET_LINENO
5846instructions and assert statements (see below); it uses and produces
5847.pyo files instead of .pyc files. The speedup is only a few percent
5848in most cases. The line numbers are still available in the .pyo file,
5849as a separate table (which is also available in .pyc files). However,
5850the removal of the SET_LINENO instructions means that the debugger
5851(pdb) can't set breakpoints on lines in -O mode. The traceback module
5852contains a function to extract a line number from the code object
5853referenced in a traceback object. In the future it should be possible
5854to write external bytecode optimizers that create better optimized
5855.pyo files, and there should be more control over optimization;
5856consider the -O option a "teaser". Without -O, the assert statement
5857actually generates code that first checks __debug__; if this variable
5858is false, the assertion is not checked. __debug__ is a built-in
5859variable whose value is initialized to track the -O flag (it's true
5860iff -O is not specified). With -O, no code is generated for assert
5861statements, nor for code of the form ``if __debug__: <something>''.
5862Sorry, no further constant folding happens.
5863
5864
5865Performance
5866-----------
5867
5868- It's much faster (almost twice for pystone.py -- see
5869Tools/scripts). See the entry on string interning below.
5870
5871- Some speedup by using separate free lists for method objects (both
5872the C and the Python variety) and for floating point numbers.
5873
5874- Big speedup by allocating frame objects with a single malloc() call.
5875The Python/C API for frames is changed (you shouldn't be using this
5876anyway).
5877
5878- Significant speedup by inlining some common opcodes for common operand
5879types (e.g. i+i, i-i, and list[i]). Fredrik Lundh.
5880
5881- Small speedup by reordering the method tables of some common
5882objects (e.g. list.append is now first).
5883
5884- Big optimization to the read() method of file objects. A read()
5885without arguments now attempts to use fstat to allocate a buffer of
5886the right size; for pipes and sockets, it will fall back to doubling
5887the buffer size. While that the improvement is real on all systems,
5888it is most dramatic on Windows.
5889
5890
5891Documentation
5892-------------
5893
5894- Many new pieces of library documentation were contributed, mostly by
5895Andrew Kuchling. Even cmath is now documented! There's also a
5896chapter of the library manual, "libundoc.tex", which provides a
5897listing of all undocumented modules, plus their status (e.g. internal,
5898obsolete, or in need of documentation). Also contributions by Sue
5899Williams, Skip Montanaro, and some module authors who succumbed to
5900pressure to document their own contributed modules :-). Note that
5901printing the documentation now kills fewer trees -- the margins have
5902been reduced.
5903
5904- I have started documenting the Python/C API. Unfortunately this project
5905hasn't been completed yet. It will be complete before the final release of
5906Python 1.5, though. At the moment, it's better to read the LaTeX source
5907than to attempt to run it through LaTeX and print the resulting dvi file.
5908
5909- The posix module (and hence os.py) now has doc strings! Thanks to Neil
5910Schemenauer. I received a few other contributions of doc strings. In most
5911other places, doc strings are still wishful thinking...
5912
5913
5914Language changes
5915----------------
5916
5917- Private variables with leading double underscore are now a permanent
5918feature of the language. (These were experimental in release 1.4. I have
5919favorable experience using them; I can't label them "experimental"
5920forever.)
5921
5922- There's new string literal syntax for "raw strings". Prefixing a string
5923literal with the letter r (or R) disables all escape processing in the
5924string; for example, r'\n' is a two-character string consisting of a
5925backslash followed by the letter n. This combines with all forms of string
5926quotes; it is actually useful for triple quoted doc strings which might
5927contain references to \n or \t. An embedded quote prefixed with a
5928backslash does not terminate the string, but the backslash is still
5929included in the string; for example, r'\'' is a two-character string
5930consisting of a backslash and a quote. (Raw strings are also
5931affectionately known as Robin strings, after their inventor, Robin
5932Friedrich.)
5933
5934- There's a simple assert statement, and a new exception
5935AssertionError. For example, ``assert foo > 0'' is equivalent to ``if
5936not foo > 0: raise AssertionError''. Sorry, the text of the asserted
5937condition is not available; it would be too complicated to generate
5938code for this (since the code is generated from a parse tree).
5939However, the text is displayed as part of the traceback!
5940
5941- The raise statement has a new feature: when using "raise SomeClass,
5942somevalue" where somevalue is not an instance of SomeClass, it
5943instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an
5944instance of a *derived* class of SomeClass, the exception class raised
5945is set to somevalue.__class__, and SomeClass is ignored after that.
5946
5947- Duplicate keyword arguments are now detected at compile time;
5948f(a=1,a=2) is now a syntax error.
5949
5950
5951Changes to builtin features
5952---------------------------
5953
5954- There's a new exception FloatingPointError (used only by Lee Busby's
5955patches to catch floating point exceptions, at the moment).
5956
5957- The obsolete exception ConflictError (presumably used by the long
5958obsolete access statement) has been deleted.
5959
5960- There's a new function sys.exc_info() which returns the tuple
5961(sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way.
5962
5963- There's a new variable sys.executable, pointing to the executable file
5964for the Python interpreter.
5965
5966- The sort() methods for lists no longer uses the C library qsort(); I
5967wrote my own quicksort implementation, with lots of help (in the form
5968of a kind of competition) from Tim Peters. This solves a bug in
5969dictionary comparisons on some Solaris versions when Python is built
5970with threads, and makes sorting lists even faster.
5971
5972- The semantics of comparing two dictionaries have changed, to make
5973comparison of unequal dictionaries faster. A shorter dictionary is
5974always considered smaller than a larger dictionary. For dictionaries
5975of the same size, the smallest differing element determines the
5976outcome (which yields the same results as before in this case, without
5977explicit sorting). Thanks to Aaron Watters for suggesting something
5978like this.
5979
5980- The semantics of try-except have changed subtly so that calling a
5981function in an exception handler that itself raises and catches an
5982exception no longer overwrites the sys.exc_* variables. This also
5983alleviates the problem that objects referenced in a stack frame that
5984caught an exception are kept alive until another exception is caught
5985-- the sys.exc_* variables are restored to their previous value when
5986returning from a function that caught an exception.
5987
5988- There's a new "buffer" interface. Certain objects (e.g. strings and
5989arrays) now support the "buffer" protocol. Buffer objects are acceptable
5990whenever formerly a string was required for a write operation; mutable
5991buffer objects can be the target of a read operation using the call
5992f.readinto(buffer). A cool feature is that regular expression matching now
5993also work on array objects. Contribution by Jack Jansen. (Needs
5994documentation.)
5995
5996- String interning: dictionary lookups are faster when the lookup
5997string object is the same object as the key in the dictionary, not
5998just a string with the same value. This is done by having a pool of
5999"interned" strings. Most names generated by the interpreter are now
6000automatically interned, and there's a new built-in function intern(s)
6001that returns the interned version of a string. Interned strings are
6002not a different object type, and interning is totally optional, but by
6003interning most keys a speedup of about 15% was obtained for the
6004pystone benchmark.
6005
6006- Dictionary objects have several new methods; clear() and copy() have
6007the obvious semantics, while update(d) merges the contents of another
6008dictionary d into this one, overriding existing keys. The dictionary
6009implementation file is now called dictobject.c rather than the
6010confusing mappingobject.c.
6011
6012- The intrinsic function dir() is much smarter; it looks in __dict__,
6013__members__ and __methods__.
6014
6015- The intrinsic functions int(), long() and float() can now take a
6016string argument and then do the same thing as string.atoi(),
6017string.atol(), and string.atof(). No second 'base' argument is
6018allowed, and complex() does not take a string (nobody cared enough).
6019
6020- When a module is deleted, its globals are now deleted in two phases.
6021In the first phase, all variables whose name begins with exactly one
6022underscore are replaced by None; in the second phase, all variables
6023are deleted. This makes it possible to have global objects whose
6024destructors depend on other globals. The deletion order within each
6025phase is still random.
6026
6027- It is no longer an error for a function to be called without a
6028global variable __builtins__ -- an empty directory will be provided
6029by default.
6030
6031- Guido's corollary to the "Don Beaudry hook": it is now possible to
6032do metaprogramming by using an instance as a base class. Not for the
6033faint of heart; and undocumented as yet, but basically if a base class
6034is an instance, its class will be instantiated to create the new
6035class. Jim Fulton will love it -- it also works with instances of his
6036"extension classes", since it is triggered by the presence of a
6037__class__ attribute on the purported base class. See
6038Demo/metaclasses/index.html for an explanation and see that directory
6039for examples.
6040
6041- Another change is that the Don Beaudry hook is now invoked when
6042*any* base class is special. (Up to 1.5a3, the *last* special base
6043class is used; in 1.5a4, the more rational choice of the *first*
6044special base class is used.)
6045
6046- New optional parameter to the readlines() method of file objects.
6047This indicates the number of bytes to read (the actual number of bytes
6048read will be somewhat larger due to buffering reading until the end of
6049the line). Some optimizations have also been made to speed it up (but
6050not as much as read()).
6051
6052- Complex numbers no longer have the ".conj" pseudo attribute; use
6053z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers
6054now *do* support the __members__ and __methods__ special attributes.
6055
6056- The complex() function now looks for a __complex__() method on class
6057instances before giving up.
6058
6059- Long integers now support arbitrary shift counts, so you can now
6060write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous
6061shift count for this.)
6062
6063- The hex() and oct() functions have been changed so that for regular
6064integers, they never emit a minus sign. For example, on a 32-bit
6065machine, oct(-1) now returns '037777777777' and hex(-1) returns
6066'0xffffffff'. While this may seem inconsistent, it is much more
6067useful. (For long integers, a minus sign is used as before, to fit
6068the result in memory :-)
6069
6070- The hash() function computes better hashes for several data types,
6071including strings, floating point numbers, and complex numbers.
6072
6073
6074New extension modules
6075---------------------
6076
6077- New extension modules cStringIO.c and cPickle.c, written by Jim
6078Fulton and other folks at Digital Creations. These are much more
6079efficient than their Python counterparts StringIO.py and pickle.py,
6080but don't support subclassing. cPickle.c clocks up to 1000 times
6081faster than pickle.py; cStringIO.c's improvement is less dramatic but
6082still significant.
6083
6084- New extension module zlibmodule.c, interfacing to the free zlib
6085library (gzip compatible compression). There's also a module gzip.py
6086which provides a higher level interface. Written by Andrew Kuchling
6087and Jeremy Hylton.
6088
6089- New module readline; see the "miscellaneous" section above.
6090
6091- New Unix extension module resource.c, by Jeremy Hylton, provides
6092access to getrlimit(), getrusage(), setrusage(), getpagesize(), and
6093related symbolic constants.
6094
6095- New extension puremodule.c, by Barry Warsaw, which interfaces to the
6096Purify(TM) C API. See also the file Misc/PURIFY.README. It is also
6097possible to enable Purify by simply setting the PURIFY Makefile
6098variable in the Modules/Setup file.
6099
6100
6101Changes in extension modules
6102----------------------------
6103
6104- The struct extension module has several new features to control byte
6105order and word size. It supports reading and writing IEEE floats even
6106on platforms where this is not the native format. It uses uppercase
6107format codes for unsigned integers of various sizes (always using
6108Python long ints for 'I' and 'L'), 's' with a size prefix for strings,
6109and 'p' for "Pascal strings" (with a leading length byte, included in
6110the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces
6111big-endian data and '<' forces little-endian data; these also select
6112standard data sizes and disable automatic alignment (use pad bytes as
6113needed).
6114
6115- The array module supports uppercase format codes for unsigned data
6116formats (like the struct module).
6117
6118- The fcntl extension module now exports the needed symbolic
6119constants. (Formerly these were in FCNTL.py which was not available
6120or correct for all platforms.)
6121
6122- The extension modules dbm, gdbm and bsddb now check that the
6123database is still open before making any new calls.
6124
6125- The dbhash module is no more. Use bsddb instead. (There's a third
6126party interface for the BSD 2.x code somewhere on the web; support for
6127bsddb will be deprecated.)
6128
6129- The gdbm module now supports a sync() method.
6130
6131- The socket module now has some new functions: getprotobyname(), and
6132the set {ntoh,hton}{s,l}().
6133
6134- Various modules now export their type object: socket.SocketType,
6135array.ArrayType.
6136
6137- The socket module's accept() method now returns unknown addresses as
6138a tuple rather than raising an exception. (This can happen in
6139promiscuous mode.) Theres' also a new function getprotobyname().
6140
6141- The pthread support for the thread module now works on most platforms.
6142
6143- STDWIN is now officially obsolete. Support for it will eventually
6144be removed from the distribution.
6145
6146- The binascii extension module is now hopefully fully debugged.
6147(XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never
6148received.)
6149
6150- audioop.c: added a ratecv() function; better handling of overflow in
6151add().
6152
6153- posixmodule.c: now exports the O_* flags (O_APPEND etc.). On
6154Windows, also O_TEXT and O_BINARY. The 'error' variable (the
6155exception is raises) is renamed -- its string value is now "os.error",
6156so newbies don't believe they have to import posix (or nt) to catch
6157it when they see os.error reported as posix.error. The execve()
6158function now accepts any mapping object for the environment.
6159
6160- A new version of the al (audio library) module for SGI was
6161contributed by Sjoerd Mullender.
6162
6163- The regex module has a new function get_syntax() which retrieves the
6164syntax setting set by set_syntax(). The code was also sanitized,
6165removing worries about unclean error handling. See also below for its
6166successor, re.py.
6167
6168- The "new" module (which creates new objects of various types) once
6169again has a fully functioning new.function() method. Dangerous as
6170ever! Also, new.code() has several new arguments.
6171
6172- A problem has been fixed in the rotor module: on systems with signed
6173characters, rotor-encoded data was not portable when the key contained
61748-bit characters. Also, setkey() now requires its argument rather
6175than having broken code to default it.
6176
6177- The sys.builtin_module_names variable is now a tuple. Another new
6178variables in sys is sys.executable (the full path to the Python
6179binary, if known).
6180
6181- The specs for time.strftime() have undergone some revisions. It
6182appears that not all format characters are supported in the same way
6183on all platforms. Rather than reimplement it, we note these
6184differences in the documentation, and emphasize the shared set of
6185features. There's also a thorough test set (that occasionally finds
6186problems in the C library implementation, e.g. on some Linuxes),
6187thanks to Skip Montanaro.
6188
6189- The nis module seems broken when used with NIS+; unfortunately
6190nobody knows how to fix it. It should still work with old NIS.
6191
6192
6193New library modules
6194-------------------
6195
6196- New (still experimental) Perl-style regular expression module,
6197re.py, which uses a new interface for matching as well as a new
6198syntax; the new interface avoids the thread-unsafety of the regex
6199interface. This comes with a helper extension reopmodule.c and vastly
6200rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim
6201Peters, and Andrew Kuchling. See the documentation libre.tex. In
62021.5, the old regex module is still fully supported; in the future, it
6203will become obsolete.
6204
6205- New module gzip.py; see zlib above.
6206
6207- New module keyword.py exports knowledge about Python's built-in
6208keywords. (New version by Ka-Ping Yee.)
6209
6210- New module pprint.py (with documentation) which supports
6211pretty-printing of lists, tuples, & dictionaries recursively. By Fred
6212Drake.
6213
6214- New module code.py. The function code.compile_command() can
6215determine whether an interactively entered command is complete or not,
6216distinguishing incomplete from invalid input. (XXX Unfortunately,
6217this seems broken at this moment, and I don't have the time to fix
6218it. It's probably better to add an explicit interface to the parser
6219for this.)
6220
6221- There is now a library module xdrlib.py which can read and write the
6222XDR data format as used by Sun RPC, for example. It uses the struct
6223module.
6224
6225
6226Changes in library modules
6227--------------------------
6228
6229- Module codehack.py is now completely obsolete.
6230
6231- The pickle.py module has been updated to make it compatible with the
6232new binary format that cPickle.c produces. By default it produces the
6233old all-ASCII format compatible with the old pickle.py, still much
6234faster than pickle.py; it will read both formats automatically. A few
6235other updates have been made.
6236
6237- A new helper module, copy_reg.py, is provided to register extensions
6238to the pickling code.
6239
6240- Revamped module tokenize.py is much more accurate and has an
6241interface that makes it a breeze to write code to colorize Python
6242source code. Contributed by Ka-Ping Yee.
6243
6244- In ihooks.py, ModuleLoader.load_module() now closes the file under
6245all circumstances.
6246
6247- The tempfile.py module has a new class, TemporaryFile, which creates
6248an open temporary file that will be deleted automatically when
6249closed. This works on Windows and MacOS as well as on Unix. (Jim
6250Fulton.)
6251
6252- Changes to the cgi.py module: Most imports are now done at the
6253top of the module, which provides a speedup when using ni (Jim
6254Fulton). The problem with file upload to a Windows platform is solved
6255by using the new tempfile.TemporaryFile class; temporary files are now
6256always opened in binary mode (Jim Fulton). The cgi.escape() function
6257now takes an optional flag argument that quotes '"' to '&quot;'. It
6258is now possible to invoke cgi.py from a command line script, to test
6259cgi scripts more easily outside an http server. There's an optional
6260limit to the size of uploads to POST (Skip Montanaro). Added a
6261'strict_parsing' option to all parsing functions (Jim Fulton). The
6262function parse_qs() now uses urllib.unquote() on the name as well as
6263the value of fields (Clarence Gardner). The FieldStorage class now
6264has a __len__() method.
6265
6266- httplib.py: the socket object is no longer closed; all HTTP/1.*
6267responses are now accepted; and it is now thread-safe (by not using
6268the regex module).
6269
6270- BaseHTTPModule.py: treat all HTTP/1.* versions the same.
6271
6272- The popen2.py module is now rewritten using a class, which makes
6273access to the standard error stream and the process id of the
6274subprocess possible.
6275
6276- Added timezone support to the rfc822.py module, in the form of a
6277getdate_tz() method and a parsedate_tz() function; also a mktime_tz().
6278Also added recognition of some non-standard date formats, by Lars
6279Wirzenius, and RFC 850 dates (Chris Lawrence).
6280
6281- mhlib.py: various enhancements, including almost compatible parsing
6282of message sequence specifiers without invoking a subprocess. Also
6283added a createmessage() method by Lars Wirzenius.
6284
6285- The StringIO.StringIO class now supports readline(nbytes). (Lars
6286Wirzenius.) (Of course, you should be using cStringIO for performance.)
6287
6288- UserDict.py supports the new dictionary methods as well.
6289
6290- Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to
6291speed it up, and replace 0 seed values by 1 to avoid degeneration.
6292A bug was fixed in the test for invalid arguments.
6293
6294- Module ftplib.py: added support for parsing a .netrc file (Fred
6295Drake). Also added an ntransfercmd() method to the FTP class, which
6296allows access to the expected size of a transfer when available, and a
6297parse150() function to the module which parses the corresponding 150
6298response.
6299
6300- urllib.py: the ftp cache is now limited to 10 entries. Added
6301quote_plus() and unquote_plus() functions which are like quote() and
6302unquote() but also replace spaces with '+' or vice versa, for
6303encoding/decoding CGI form arguments. Catch all errors from the ftp
6304module. HTTP requests now add the Host: header line. The proxy
6305variable names are now mapped to lower case, for Windows. The
6306spliturl() function no longer erroneously throws away all data past
6307the first newline. The basejoin() function now intereprets "../"
6308correctly. I *believe* that the problems with "exception raised in
6309__del__" under certain circumstances have been fixed (mostly by
6310changes elsewher in the interpreter).
6311
6312- In urlparse.py, there is a cache for results in urlparse.urlparse();
6313its size limit is set to 20. Also, new URL schemes shttp, https, and
6314snews are "supported".
6315
6316- shelve.py: use cPickle and cStringIO when available. Also added
6317a sync() method, which calls the database's sync() method if there is
6318one.
6319
6320- The mimetools.py module now uses the available Python modules for
6321decoding quoted-printable, uuencode and base64 formats, rather than
6322creating a subprocess.
6323
6324- The python debugger (pdb.py, and its base class bdb.py) now support
6325conditional breakpoints. See the docs.
6326
6327- The modules base64.py, uu.py and quopri.py can now be used as simple
6328command line utilities.
6329
6330- Various small fixes to the nntplib.py module that I can't bother to
6331document in detail.
6332
6333- Sjoerd Mullender's mimify.py module now supports base64 encoding and
6334includes functions to handle the funny encoding you sometimes see in mail
6335headers. It is now documented.
6336
6337- mailbox.py: Added BabylMailbox. Improved the way the mailbox is
6338gotten from the environment.
6339
6340- Many more modules now correctly open files in binary mode when this
6341is necessary on non-Unix platforms.
6342
6343- The copying functions in the undocumented module shutil.py are
6344smarter.
6345
6346- The Writer classes in the formatter.py module now have a flush()
6347method.
6348
6349- The sgmllib.py module accepts hyphens and periods in the middle of
6350attribute names. While this is against the SGML standard, there is
6351some HTML out there that uses this...
6352
6353- The interface for the Python bytecode disassembler module, dis.py,
6354has been enhanced quite a bit. There's now one main function,
6355dis.dis(), which takes almost any kind of object (function, module,
6356class, instance, method, code object) and disassembles it; without
6357arguments it disassembles the last frame of the last traceback. The
6358other functions have changed slightly, too.
6359
6360- The imghdr.py module recognizes new image types: BMP, PNG.
6361
6362- The string.py module has a new function replace(str, old, new,
6363[maxsplit]) which does substring replacements. It is actually
6364implemented in C in the strop module. The functions [r]find() an
6365[r]index() have an optional 4th argument indicating the end of the
6366substring to search, alsoo implemented by their strop counterparts.
6367(Remember, never import strop -- import string uses strop when
6368available with zero overhead.)
6369
6370- The string.join() function now accepts any sequence argument, not
6371just lists and tuples.
6372
6373- The string.maketrans() requires its first two arguments to be
6374present. The old version didn't require them, but there's not much
6375point without them, and the documentation suggests that they are
6376required, so we fixed the code to match the documentation.
6377
6378- The regsub.py module has a function clear_cache(), which clears its
6379internal cache of compiled regular expressions. Also, the cache now
6380takes the current syntax setting into account. (However, this module
6381is now obsolete -- use the sub() or subn() functions or methods in the
6382re module.)
6383
6384- The undocumented module Complex.py has been removed, now that Python
6385has built-in complex numbers. A similar module remains as
6386Demo/classes/Complex.py, as an example.
6387
6388
6389Changes to the build process
6390----------------------------
6391
6392- The way GNU readline is configured is totally different. The
6393--with-readline configure option is gone. It is now an extension
6394module, which may be loaded dynamically. You must enable it (and
6395specify the correct linraries to link with) in the Modules/Setup file.
6396Importing the module installs some hooks which enable command line
6397editing. When the interpreter shell is invoked interactively, it
6398attempts to import the readline module; when this fails, the default
6399input mechanism is used. The hook variables are PyOS_InputHook and
6400PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with
6401ideas from William Magro.)
6402
6403- New build procedure: a single library, libpython1.5.a, is now built,
6404which contains absolutely everything except for a one-line main()
6405program (which calls Py_Main(argc, argv) to start the interpreter
6406shell). This makes life much simpler for applications that need to
6407embed Python. The serial number of the build is now included in the
6408version string (sys.version).
6409
6410- As far as I can tell, neither gcc -Wall nor the Microsoft compiler
6411emits a single warning any more when compiling Python.
6412
6413- A number of new Makefile variables have been added for special
6414situations, e.g. LDLAST is appended to the link command. These are
6415used by editing the Makefile or passing them on the make command
6416line.
6417
6418- A set of patches from Lee Busby has been integrated that make it
6419possible to catch floating point exceptions. Use the configure option
6420--with-fpectl to enable the patches; the extension modules fpectl and
6421fpetest provide control to enable/disable and test the feature,
6422respectively.
6423
6424- The support for shared libraries under AIX is now simpler and more
6425robust. Thanks to Vladimir Marangozov for revamping his own patches!
6426
6427- The Modules/makesetup script now reads a file Setup.local as well as
6428a file Setup. Most changes to the Setup script can be done by editing
6429Setup.local instead, which makes it easier to carry a particular setup
6430over from one release to the next.
6431
6432- The Modules/makesetup script now copies any "include" lines it
6433encounters verbatim into the output Makefile. It also recognizes .cxx
6434and .cpp as C++ source files.
6435
6436- The configure script is smarter about C compiler options; e.g. with
6437gcc it uses -O2 and -g when possible, and on some other platforms it
6438uses -Olimit 1500 to avoid a warning from the optimizer about the main
6439loop in ceval.c (which has more than 1000 basic blocks).
6440
6441- The configure script now detects whether malloc(0) returns a NULL
6442pointer or a valid block (of length zero). This avoids the nonsense
6443of always adding one byte to all malloc() arguments on most platforms.
6444
6445- The configure script has a new option, --with-dec-threads, to enable
6446DEC threads on DEC Alpha platforms. Also, --with-threads is now an
6447alias for --with-thread (this was the Most Common Typo in configure
6448arguments).
6449
6450- Many changes in Doc/Makefile; amongst others, latex2html is now used
6451to generate HTML from all latex documents.
6452
6453
6454Change to the Python/C API
6455--------------------------
6456
6457- Because some interfaces have changed, the PYTHON_API macro has been
6458bumped. Most extensions built for the old API version will still run,
6459but I can't guarantee this. Python prints a warning message on
6460version mismatches; it dumps core when the version mismatch causes a
6461serious problem :-)
6462
6463- I've completed the Grand Renaming, with the help of Roger Masse and
6464Barry Warsaw. This makes reading or debugging the code much easier.
6465Many other unrelated code reorganizations have also been carried out.
6466The allobjects.h header file is gone; instead, you would have to
6467include Python.h followed by rename2.h. But you're better off running
6468Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit
6469the rename2.h; it will disappear in the next release.
6470
6471- Various and sundry small bugs in the "abstract" interfaces have been
6472fixed. Thanks to all the (involuntary) testers of the Python 1.4
6473version! Some new functions have been added, e.g. PySequence_List(o),
6474equivalent to list(o) in Python.
6475
6476- New API functions PyLong_FromUnsignedLong() and
6477PyLong_AsUnsignedLong().
6478
6479- The API functions in the file cgensupport.c are no longer
6480supported. This file has been moved to Modules and is only ever
6481compiled when the SGI specific 'gl' module is built.
6482
6483- PyObject_Compare() can now raise an exception. Check with
6484PyErr_Occurred(). The comparison function in an object type may also
6485raise an exception.
6486
6487- The slice interface uses an upper bound of INT_MAX when no explicit
6488upper bound is given (e.x. for a[1:]). It used to ask the object for
6489its length and do the calculations.
6490
6491- Support for multiple independent interpreters. See Doc/api.tex,
6492functions Py_NewInterpreter() and Py_EndInterpreter(). Since the
6493documentation is incomplete, also see the new Demo/pysvr example
6494(which shows how to use these in a threaded application) and the
6495source code.
6496
6497- There is now a Py_Finalize() function which "de-initializes"
6498Python. It is possible to completely restart the interpreter
6499repeatedly by calling Py_Finalize() followed by Py_Initialize(). A
6500change of functionality in Py_Initialize() means that it is now a
6501fatal error to call it while the interpreter is already initialized.
6502The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit()
6503is deprecated (it is nothing more than Py_Finalize() followed by
6504exit()).
6505
6506- There are no known memory leaks left. While Py_Finalize() doesn't
6507free *all* allocated memory (some of it is hard to track down),
6508repeated calls to Py_Finalize() and Py_Initialize() do not create
6509unaccessible heap blocks.
6510
6511- There is now explicit per-thread state. (Inspired by, but not the
6512same as, Greg Stein's free threading patches.)
6513
6514- There is now better support for threading C applications. There are
6515now explicit APIs to manipulate the interpreter lock. Read the source
6516or the Demo/pysvr example; the new functions are
6517PyEval_{Acquire,Release}{Lock,Thread}().
6518
6519- The test macro DEBUG has changed to Py_DEBUG, to avoid interference
6520with other libraries' DEBUG macros. Likewise for any other test
6521macros that didn't yet start with Py_.
6522
6523- New wrappers around malloc() and friends: Py_Malloc() etc. call
6524malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call
6525just malloc(). Use of these wrappers could be essential if multiple
6526memory allocators exist (e.g. when using certain DLL setups under
6527Windows). (Idea by Jim Fulton.)
6528
6529- New C API PyImport_Import() which uses whatever __import__() hook
6530that is installed for the current execution environment. By Jim
6531Fulton.
6532
6533- It is now possible for an extension module's init function to fail
6534non-fatally, by calling one of the PyErr_* functions and returning.
6535
6536- The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their
6537argument to the proper type, like the similar PyString macros already
6538did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE
6539and PyList_GET_ITEM.
6540
6541- Some of the Py_Get* function, like Py_GetVersion() (but not yet
6542Py_GetPath()) are now declared as returning a const char *. (More
6543should follow.)
6544
6545- Changed the run-time library to check for exceptions after object
6546comparisons. PyObject_Compare() can now return an exception; use
6547PyErr_Occurred() to check (there is *no* special return value).
6548
6549- PyFile_WriteString() and Py_Flushline() now return error indicators
6550instead of clearing exceptions. This fixes an obscure bug where using
6551these would clear a pending exception, discovered by Just van Rossum.
6552
6553- There's a new function, PyArg_ParseTupleAndKeywords(), which parses
6554an argument list including keyword arguments. Contributed by Geoff
6555Philbrick.
6556
6557- PyArg_GetInt() is gone.
6558
6559- It's no longer necessary to include graminit.h when calling one of
6560the extended parser API functions. The three public grammar start
6561symbols are now in Python.h as Py_single_input, Py_file_input, and
6562Py_eval_input.
6563
6564- The CObject interface has a new function,
6565PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr()
6566on the object referenced by "module.name".
6567
6568
6569Tkinter
6570-------
6571
6572- On popular demand, _tkinter once again installs a hook for readline
6573that processes certain Tk events while waiting for the user to type
6574(using PyOS_InputHook).
6575
6576- A patch by Craig McPheeters plugs the most obnoxious memory leaks,
6577caused by command definitions referencing widget objects beyond their
6578lifetime.
6579
6580- New standard dialog modules: tkColorChooser.py, tkCommonDialog.py,
6581tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface
6582with the new Tk dialog scripts, and provide more "native platform"
6583style file selection dialog boxes on some platforms. Contributed by
6584Fredrik Lundh.
6585
6586- Tkinter.py: when the first Tk object is destroyed, it sets the
6587hiddel global _default_root to None, so that when another Tk object is
6588created it becomes the new default root. Other miscellaneous
6589changes and fixes.
6590
6591- The Image class now has a configure method.
6592
6593- Added a bunch of new winfo options to Tkinter.py; we should now be
6594up to date with Tk 4.2. The new winfo options supported are:
6595mananger, pointerx, pointerxy, pointery, server, viewable, visualid,
6596visualsavailable.
6597
6598- The broken bind() method on Canvas objects defined in the Canvas.py
6599module has been fixed. The CanvasItem and Group classes now also have
6600an unbind() method.
6601
6602- The problem with Tkinter.py falling back to trying to import
6603"tkinter" when "_tkinter" is not found has been fixed -- it no longer
6604tries "tkinter", ever. This makes diagnosing the problem "_tkinter
6605not configured" much easier and will hopefully reduce the newsgroup
6606traffic on this topic.
6607
6608- The ScrolledText module once again supports the 'cnf' parameter, to
6609be compatible with the examples in Mark Lutz' book (I know, I know,
6610too late...)
6611
6612- The _tkinter.c extension module has been revamped. It now support
6613Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It
6614works well under Windows and Mac (with the latest Tk ports to those
6615platforms). It also supports threading -- it is safe for one
6616(Python-created) thread to be blocked in _tkinter.mainloop() while
6617other threads modify widgets. To make the changes visible, those
6618threads must use update_idletasks()method. (The patch for threading
6619in 1.5a3 was broken; in 1.5a4, it is back in a different version,
6620which requires access to the Tcl sources to get it to work -- hence it
6621is disabled by default.)
6622
6623- A bug in _tkinter.c has been fixed, where Split() with a string
6624containing an unmatched '"' could cause an exception or core dump.
6625
6626- Unfortunately, on Windows and Mac, Tk 8.0 no longer supports
6627CreateFileHandler, so _tkinter.createfilehandler is not available on
6628those platforms when using Tk 8.0 or later. I will have to rethink
6629how to interface with Tcl's lower-level event mechanism, or with its
6630channels (which are like Python's file-like objects). Jack Jansen has
6631provided a fix for the Mac, so createfilehandler *is* actually
6632supported there; maybe I can adapt his fix for Windows.
6633
6634
6635Tools and Demos
6636---------------
6637
6638- A new regression test suite is provided, which tests most of the
6639standard and built-in modules. The regression test is run by invoking
6640the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass;
6641he and Roger Masse contributed most of the new tests.
6642
6643- New tool: faqwiz -- the CGI script that is used to maintain the
6644Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In
6645Tools/faqwiz.
6646
6647- New tool: webchecker -- a simple extensible web robot that, when
6648aimed at a web server, checks that server for dead links. Available
6649are a command line utility as well as a Tkinter based GUI version. In
6650Tools/webchecker. A simplified version of this program is dissected
6651in my article in O'Reilly's WWW Journal, the issue on Scripting
6652Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120).
6653Includes a parser for robots.txt files by Skip Montanaro.
6654
6655- New small tools: cvsfiles.py (prints a list of all files under CVS
6656n a particular directory tree), treesync.py (a rather Guido-specific
6657script to synchronize two source trees, one on Windows NT, the other
6658one on Unix under CVS but accessible from the NT box), and logmerge.py
6659(sort a collection of RCS or CVS logs by date). In Tools/scripts.
6660
6661- The freeze script now also works under Windows (NT). Another
6662feature allows the -p option to be pointed at the Python source tree
6663instead of the installation prefix. This was loosely based on part of
6664xfreeze by Sam Rushing and Bill Tutt.
6665
6666- New examples (Demo/extend) that show how to use the generic
6667extension makefile (Misc/Makefile.pre.in).
6668
6669- Tools/scripts/h2py.py now supports C++ comments.
6670
6671- Tools/scripts/pystone.py script is upgraded to version 1.1; there
6672was a bug in version 1.0 (distributed with Python 1.4) that leaked
6673memory. Also, in 1.1, the LOOPS variable is incremented to 10000.
6674
6675- Demo/classes/Rat.py completely rewritten by Sjoerd Mullender.
6676
6677
6678Windows (NT and 95)
6679-------------------
6680
6681- New project files for Developer Studio (Visual C++) 5.0 for Windows
6682NT (the old VC++ 4.2 Makefile is also still supported, but will
6683eventually be withdrawn due to its bulkiness).
6684
6685- See the note on the new module search path in the "Miscellaneous" section
6686above.
6687
6688- Support for Win32s (the 32-bit Windows API under Windows 3.1) is
6689basically withdrawn. If it still works for you, you're lucky.
6690
6691- There's a new extension module, msvcrt.c, which provides various
6692low-level operations defined in the Microsoft Visual C++ Runtime Library.
6693These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and
6694console I/O functions like kbhit(), getch() and putch().
6695
6696- The -u option not only sets the standard I/O streams to unbuffered
6697status, but also sets them in binary mode. (This can also be done
6698using msvcrt.setmode(), by the way.)
6699
6700- The, sys.prefix and sys.exec_prefix variables point to the directory
6701where Python is installed, or to the top of the source tree, if it was run
6702from there.
6703
6704- The various os.path modules (posixpath, ntpath, macpath) now support
6705passing more than two arguments to the join() function, so
6706os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b,
6707c)).
6708
6709- The ntpath module (normally used as os.path) supports ~ to $HOME
6710expansion in expanduser().
6711
6712- The freeze tool now works on Windows.
6713
6714- See also the Tkinter category for a sad note on
6715_tkinter.createfilehandler().
6716
6717- The truncate() method for file objects now works on Windows.
6718
6719- Py_Initialize() is no longer called when the DLL is loaded. You
6720must call it yourself.
6721
6722- The time module's clock() function now has good precision through
6723the use of the Win32 API QueryPerformanceCounter().
6724
6725- Mark Hammond will release Python 1.5 versions of PythonWin and his
6726other Windows specific code: the win32api extensions, COM/ActiveX
6727support, and the MFC interface.
6728
6729
6730Mac
6731---
6732
6733- As always, the Macintosh port will be done by Jack Jansen. He will
6734make a separate announcement for the Mac specific source code and the
6735binary distribution(s) when these are ready.
6736
6737
6738======================================================================
Guido van Rossuma7925f11994-01-26 10:20:16 +00006739
Guido van Rossumaa253861994-10-06 17:18:57 +00006740
Guido van Rossumc30e95f1996-07-30 18:53:51 +00006741=====================================
Guido van Rossum821a5581997-05-23 04:05:31 +00006742==> Release 1.4 (October 25 1996) <==
6743=====================================
6744
6745(Starting in reverse chronological order:)
6746
6747- Changed disclaimer notice.
6748
6749- Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions
6750default to the user's login shell.
6751
6752- In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text
6753widget, and bogus bspace() function.
6754
6755- In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated
6756paragraph.
6757
6758- Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all
6759subprojects, and to remove the (broken) experimental NumPy
6760subprojects.
6761
6762- In Lib/py_compile.py, cast mtime to long() so it will work on Mac
6763(where os.stat() returns mtimes as floats.)
6764- Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to
6765fix POST in CGIHTTPServer.py.
6766
6767- Version 2.83 of Misc/python-mode.el for Emacs is included.
6768
6769- In Modules/regexmodule.c, fixed symcomp() to correctly handle a new
6770group starting immediately after a group tag.
6771
6772- In Lib/SocketServer.py, changed the mode for rfile to unbuffered.
6773
6774- In Objects/stringobject.c, fixed the compare function to do the
6775first char comparison in unsigned mode, for consistency with the way
6776other characters are compared by memcmp().
6777
6778- In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats.
6779
6780- In Lib/urllib.py, fix another case where openedurl wasn't set.
6781
6782(XXX Sorry, the rest is in totally random order. No time to fix it.)
6783
6784- SyntaxError exceptions detected during code generation
6785(e.g. assignment to an expression) now include a line number.
6786
6787- Don't leave trailing / or \ in script directory inserted in front of
6788sys.path.
6789
6790- Added a note to Tools/scripts/classfix.py abouts its historical
6791importance.
6792
6793- Added Misc/Makefile.pre.in, a universal Makefile for extensions
6794built outside the distribution.
6795
6796- Rewritten Misc/faq2html.py, by Ka-Ping Yee.
6797
6798- Install shared modules with mode 555 (needed for performance on some
6799platforms).
6800
6801- Some changes to standard library modules to avoid calling append()
6802with more than one argument -- while supported, this should be
6803outlawed, and I don't want to set a bad example.
6804
6805- bdb.py (and hence pdb.py) supports calling run() with a code object
6806instead of a code string.
6807
6808- Fixed an embarrassing bug cgi.py which prevented correct uploading
6809of binary files from Netscape (which doesn't distinguish between
6810binary and text files). Also added dormant logging support, which
6811makes it easier to debug the cgi module itself.
6812
6813- Added default writer to constructor of NullFormatter class.
6814
6815- Use binary mode for socket.makefile() calls in ftplib.py.
6816
6817- The ihooks module no longer "installs" itself upon import -- this
6818was an experimental feature that helped ironing out some bugs but that
6819slowed down code that imported it without the need to install it
6820(e.g. the rexec module). Also close the file in some cases and add
6821the __file__ attribute to loaded modules.
6822
6823- The test program for mailbox.py is now more useful.
6824
6825- Added getparamnames() to Message class in mimetools.py -- it returns
6826the names of parameters to the content-type header.
6827
6828- Fixed a typo in ni that broke the loop stripping "__." from names.
6829
6830- Fix sys.path[0] for scripts run via pdb.py's new main program.
6831
6832- profile.py can now also run a script, like pdb.
6833
6834- Fix a small bug in pyclbr -- don't add names starting with _ when
6835emulating from ... import *.
6836
6837- Fixed a series of embarrassing typos in rexec's handling of standard
6838I/O redirection. Added some more "safe" built-in modules: cmath,
6839errno, operator.
6840
6841- Fixed embarrassing typo in shelve.py.
6842
6843- Added SliceType and EllipsisType to types.py.
6844
6845- In urllib.py, added handling for error 301 (same as 302); added
6846geturl() method to get the URL after redirection.
6847
6848- Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in
6849for _xdrmodule.c and removed redundant #include from _xdrmodule.c.
6850
6851- Fixed bsddbmodule.c to add binary mode indicator on platforms that
6852have it. This should make it working on Windows NT.
6853
6854- Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32,
6855whatever applies. Also rationalized some other tests for various MS
6856platforms.
6857
6858- Added the sources for the NT installer script used for Python
68591.4beta3. Not tested with this release, but better than nothing.
6860
6861- A compromise in pickle's defenses against Trojan horses: a
6862user-defined function is now okay where a class is expected. A
6863built-in function is not okay, to prevent pickling something that
6864will execute os.system("rm -f *") when unpickling.
6865
6866- dis.py will print the name of local variables referenced by local
6867load/store/delete instructions.
6868
6869- Improved portability of SimpleHTTPServer module to non-Unix
6870platform.
6871
6872- The thread.h interface adds an extra argument to down_sema(). This
6873only affects other C code that uses thread.c; the Python thread module
6874doesn't use semaphores (which aren't provided on all platforms where
6875Python threads are supported). Note: on NT, this change is not
6876implemented.
6877
6878- Fixed some typos in abstract.h; corrected signature of
6879PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in
6880abstract.c's PyObject_CallMethod().
6881
6882- apply(classname, (), {}) now works even if the class has no
6883__init__() method.
6884
6885- Implemented complex remainder and divmod() (these would dump core!).
6886Conversion of complex numbers to int, long int or float now raises an
6887exception, since there is no meaningful way to do it without losing
6888information.
6889
6890- Fixed bug in built-in complex() function which gave the wrong result
6891for two real arguments.
6892
6893- Change the hash algorithm for strings -- the multiplier is now
68941000003 instead of 3, which gives better spread for short strings.
6895
6896- New default path for Windows NT, the registry structure now supports
6897default paths for different install packages. (Mark Hammond -- the
6898next PythonWin release will use this.)
6899
6900- Added more symbols to the python_nt.def file.
6901
6902- When using GNU readline, set rl_readline_name to "python".
6903
6904- The Ellipses built-in name has been renamed to Ellipsis -- this is
6905the correct singular form. Thanks to Ka-Ping Yee, who saved us from
6906eternal embarrassment.
6907
6908- Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses ->
6909Ellipsis name change.
6910
6911- Updated the library reference manual. Added documentation of
6912restricted mode (rexec, Bastion) and the formatter module (for use
6913with the htmllib module). Fixed the documentation of htmllib
6914(finally).
6915
6916- The reference manual is now maintained in FrameMaker.
6917
6918- Upgraded scripts Doc/partparse.py and Doc/texi2html.py.
6919
6920- Slight improvements to Doc/Makefile.
6921
6922- Added fcntl.lockf(). This should be used for Unix file locking
6923instead of the posixfile module; lockf() is more portable.
6924
6925- The getopt module now supports long option names, thanks to Lars
6926Wizenius.
6927
6928- Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake
6929and Nils Fischbeck.
6930
6931- Use more bits of time.time() in whrandom's default seed().
6932
6933- Performance hack for regex module's regs attribute.
6934
6935- Don't close already closed socket in socket module.
6936
6937- Correctly handle separators containing embedded nulls in
6938strop.split, strop.find and strop.rfind. Also added more detail to
6939error message for strop.atoi and friends.
6940
6941- Moved fallback definition for hypot() to Python/hypot.c.
6942
6943- Added fallback definition for strdup, in Python/strdup.c.
6944
6945- Fixed some bugs where a function would return 0 to indicate an error
6946where it should return -1.
6947
6948- Test for error returned by time.localtime(), and rationalized its MS
6949tests.
6950
6951- Added Modules/Setup.local file, which is processed after Setup.
6952
6953- Corrected bug in toplevel Makefile.in -- execution of regen script
6954would not use the right PATH and PYTHONPATH.
6955
6956- Various and sundry NeXT configuration changes (sigh).
6957
6958- Support systems where libreadline needs neither termcap nor curses.
6959
6960- Improved ld_so_aix script and python.exp file (for AIX).
6961
6962- More stringent test for working <stdarg.h> in configure script.
6963
6964- Removed Demo/www subdirectory -- it was totally out of date.
6965
6966- Improved demos and docs for Fred Drake's parser module; fixed one
6967typo in the module itself.
6968
6969
6970=========================================
6971==> Release 1.4beta3 (August 26 1996) <==
6972=========================================
6973
6974
6975(XXX This is less readable that it should. I promise to restructure
6976it for the final 1.4 release.)
6977
6978
6979What's new in 1.4beta3 (since beta2)?
6980-------------------------------------
6981
6982- Name mangling to implement a simple form of class-private variables.
6983A name of the form "__spam" can't easily be used outside the class.
6984(This was added in 1.4beta3, but left out of the 1.4beta3 release
6985message.)
6986
6987- In urllib.urlopen(): HTTP URLs containing user:passwd@host are now
6988handled correctly when using a proxy server.
6989
6990- In ntpath.normpath(): don't truncate to 8+3 format.
6991
6992- In mimetools.choose_boundary(): don't die when getuid() or getpid()
6993aren't defined.
6994
6995- Module urllib: some optimizations to (un)quoting.
6996
6997- New module MimeWriter for writing MIME documents.
6998
6999- More changes to formatter module.
7000
7001- The freeze script works once again and is much more robust (using
7002sys.prefix etc.). It also supports a -o option to specify an
7003output directory.
7004
7005- New module whichdb recognizes dbm, gdbm and bsddb/dbhash files.
7006
7007- The Doc/Makefile targets have been reorganized somewhat to remove the
7008insistence on always generating PostScript.
7009
7010- The texinfo to html filter (Doc/texi2html.py) has been improved somewhat.
7011
7012- "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing
7013name conflict on the Mac.
7014
7015- Linking a module compiled with a different setting for Py_TRACE_REFS now
7016generates a linker error rather than a core dump.
7017
7018- The cgi module has a new convenience function print_exception(), which
7019formats a python exception using HTML. It also fixes a bug in the
7020compatibility code and adds a dubious feature which makes it possible to
7021have two query strings, one in the URL and one in the POST data.
7022
7023- A subtle change in the unpickling of class instances makes it possible
7024to unpickle in restricted execution mode, where the __dict__ attribute is
7025not available (but setattr() is).
7026
7027- Documentation for os.path.splitext() (== posixpath.splitext()) has been
7028cleared up. It splits at the *last* dot.
7029
7030- posixfile locking is now also correctly supported on AIX.
7031
7032- The tempfile module once again honors an initial setting of tmpdir. It
7033now works on Windows, too.
7034
7035- The traceback module has some new functions to extract, format and print
7036the active stack.
7037
7038- Some translation functions in the urllib module have been made a little
7039less sluggish.
7040
7041- The addtag_* methods for Canvas widgets in Tkinter as well as in the
7042separate Canvas class have been fixed so they actually do something
7043meaningful.
7044
7045- A tiny _test() function has been added to Tkinter.py.
7046
7047- A generic Makefile for dynamically loaded modules is provided in the Misc
7048subdirectory (Misc/gMakefile).
7049
7050- A new version of python-mode.el for Emacs is provided. See
7051http://www.python.org/ftp/emacs/pmdetails.html for details. The
7052separate file pyimenu.el is no longer needed, imenu support is folded
7053into python-mode.el.
7054
7055- The configure script can finally correctly find the readline library in a
7056non-standard location. The LDFLAGS variable is passed on the the Makefiles
7057from the configure script.
7058
7059- Shared libraries are now installed as programs (i.e. with executable
7060permission). This is required on HP-UX and won't hurt on other systems.
7061
7062- The objc.c module is no longer part of the distribution. Objective-C
7063support may become available as contributed software on the ftp site.
7064
7065- The sybase module is no longer part of the distribution. A much
7066improved sybase module is available as contributed software from the
7067ftp site.
7068
7069- _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and
7070Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file
7071now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0.
7072
7073- In Setup, you can now write "*shared*" instead of "*noconfig*", and you
7074can use *.so and *.sl as shared libraries.
7075
7076- Some more fidgeting for AIX shared libraries.
7077
7078- The mpz module is now compatible with GMP 2.x. (Not tested by me.)
7079(Note -- a complete replacement by Niels Mo"ller, called gpmodule, is
7080available from the contrib directory on the ftp site.)
7081
7082- A warning is written to sys.stderr when a __del__ method raises an
7083exception (formerly, such exceptions were completely ignored).
7084
7085- The configure script now defines HAVE_OLD_CPP if the C preprocessor is
7086incapable of ANSI style token concatenation and stringification.
7087
7088- All source files (except a few platform specific modules) are once again
7089compatible with K&R C compilers as well as ANSI compilers. In particular,
7090ANSI-isms have been removed or made conditional in complexobject.c,
7091getargs.c and operator.c.
7092
7093- The abstract object API has three new functions, PyObject_DelItem,
7094PySequence_DelItem, and PySequence_DelSlice.
7095
7096- The operator module has new functions delitem and delslice, and the
7097functions "or" and "and" are renamed to "or_" and "and_" (since "or" and
7098"and" are reserved words). ("__or__" and "__and__" are unchanged.)
7099
7100- The environment module is no longer supported; putenv() is now a function
7101in posixmodule (also under NT).
7102
7103- Error in filter(<function>, "") has been fixed.
7104
7105- Unrecognized keyword arguments raise TypeError, not KeyError.
7106
7107- Better portability, fewer bugs and memory leaks, fewer compiler warnings,
7108some more documentation.
7109
7110- Bug in float power boundary case (0.0 to the negative integer power)
7111fixed.
7112
7113- The test of negative number to the float power has been moved from the
7114built-in pow() functin to floatobject.c (so complex numbers can yield the
7115correct result).
7116
7117- The bug introduced in beta2 where shared libraries loaded (using
7118dlopen()) from the current directory would fail, has been fixed.
7119
7120- Modules imported as shared libraries now also have a __file__ attribute,
7121giving the filename from which they were loaded. The only modules without
7122a __file__ attribute now are built-in modules.
7123
7124- On the Mac, dynamically loaded modules can end in either ".slb" or
7125".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb"
7126extension should only be used for "fat" binaries.
7127
7128- C API addition: marshal.c now supports
7129PyMarshal_WriteObjectToString(object).
7130
7131- C API addition: getargs.c now supports
7132PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...)
7133to parse keyword arguments.
7134
7135- The PC versioning scheme (sys.winver) has changed once again. the
7136version number is now "<digit>.<digit>.<digit>.<apiversion>", where the
7137first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4,
7138"1.4.1" for Python 1.4.1 -- the beta level is not included) and
7139<apiversion> is the four-digit PYTHON_API_VERSION (currently 1005).
7140
7141- h2py.py accepts whitespace before the # in CPP directives
7142
7143- On Solaris 2.5, it should now be possible to use either Posix threads or
7144Solaris threads (XXX: how do you select which is used???). (Note: the
7145Python pthreads interface doesn't fully support semaphores yet -- anyone
7146care to fix this?)
7147
7148- Thread support should now work on AIX, using either DCE threads or
7149pthreads.
7150
7151- New file Demo/sockets/unicast.py
7152
7153- Working Mac port, with CFM68K support, with Tk 4.1 support (though not
7154both) (XXX)
7155
7156- New project setup for PC port, now compatible with PythonWin, with
7157_tkinter and NumPy support (XXX)
7158
7159- New module site.py (XXX)
7160
7161- New module xdrlib.py and optional support module _xdrmodule.c (XXX)
7162
7163- parser module adapted to new grammar, complete w/ Doc & Demo (XXX)
7164
7165- regen script fixed (XXX)
7166
7167- new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX)
7168
7169- testall now also tests math module (XXX)
7170
7171- string.atoi c.s. now raise an exception for an empty input string.
7172
7173- At last, it is no longer necessary to define HAVE_CONFIG_H in order to
7174have config.h included at various places.
7175
7176- Unrecognized keyword arguments now raise TypeError rather than KeyError.
7177
7178- The makesetup script recognizes files with extension .so or .sl as
7179(shared) libraries.
7180
7181- 'access' is no longer a reserved word, and all code related to its
7182implementation is gone (or at least #ifdef'ed out). This should make
7183Python a little speedier too!
7184
7185- Performance enhancements suggested by Sjoerd Mullender. This includes
7186the introduction of two new optional function pointers in type object,
7187getattro and setattro, which are like getattr and setattr but take a
7188string object instead of a C string pointer.
7189
7190- New operations in string module: lstrip(s) and rstrip(s) strip whitespace
7191only on the left or only on the right, A new optional third argument to
7192split() specifies the maximum number of separators honored (so
7193splitfields(s, sep, n) returns a list of at most n+1 elements). (Since
71941.3, splitfields(s, None) is totally equivalent to split(s).)
7195string.capwords() has an optional second argument specifying the
7196separator (which is passed to split()).
7197
7198- regsub.split() has the same addition as string.split(). regsub.splitx(s,
7199sep, maxsep) implements the functionality that was regsub.split(s, 1) in
72001.4beta2 (return a list containing the delimiters as well as the words).
7201
7202- Final touch for AIX loading, rewritten Misc/AIX-NOTES.
7203
7204- In Modules/_tkinter.c, when using Tk 4.1 or higher, use className
7205argument to _tkinter.create() to set Tcl's argv0 variable, so X
7206resources use the right resource class again.
7207
7208- Add #undef fabs to Modules/mathmodule.c for macintosh.
7209
7210- Added some macro renames for AIX in Modules/operator.c.
7211
7212- Removed spurious 'E' from Doc/liberrno.tex.
7213
7214- Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new
7215Misc/gMakefile and new version of Misc/python-mode.el.
7216
7217- Fixed typo in Lib/ntpath.py (islink has "return false" which gives a
7218NameError).
7219
7220- Added missing "from types import *" to Lib/tkinter/Canvas.py.
7221
7222- Added hint about using default args for __init__ to pickle docs.
7223
7224- Corrected typo in Inclide/abstract.h: PySequence_Lenth ->
7225PySequence_Length.
7226
7227- Some improvements to Doc/texi2html.py.
7228
7229- In Python/import.c, Cast unsigned char * in struct _frozen to char *
7230in calls to rds_object().
7231
7232- In doc/ref4.tex, added note about scope of lambda bodies.
7233
7234What's new in 1.4beta2 (since beta1)?
7235-------------------------------------
7236
7237- Portability bug in the md5.h header solved.
7238
7239- The PC build procedure now really works, and sets sys.platform to a
7240meaningful value (a few things were botched in beta 1). Lib/dos_8x3
7241is now a standard part of the distribution (alas).
7242
7243- More improvements to the installation procedure. Typing "make install"
7244now inserts the version number in the pathnames of almost everything
7245installed, and creates the machine dependent modules (FCNTL.py etc.) if not
7246supplied by the distribution. (XXX There's still a problem with the latter
7247because the "regen" script requires that Python is installed. Some manual
7248intervention may still be required.) (This has been fixed in 1.4beta3.)
7249
7250- New modules: errno, operator (XXX).
7251
7252- Changes for use with Numerical Python: builtin function slice() and
7253Ellipses object, and corresponding syntax:
7254
7255 x[lo:hi:stride] == x[slice(lo, hi, stride)]
7256 x[a, ..., z] == x[(a, Ellipses, z)]
7257
7258- New documentation for errno and cgi mdoules.
7259
7260- The directory containing the script passed to the interpreter is
7261inserted in from of sys.path; "." is no longer a default path
7262component.
7263
7264- Optional third string argument to string.translate() specifies
7265characters to delete. New function string.maketrans() creates a
7266translation table for translate() or for regex.compile().
7267
7268- Module posix (and hence module os under Unix) now supports putenv().
7269Moreover, module os is enhanced so that if putenv() is supported,
7270assignments to os.environ entries make the appropriate putenv() call.
7271(XXX the putenv() implementation can leak a small amount of memory per
7272call.)
7273
7274- pdb.py can now be invoked from the command line to debug a script:
7275python pdb.py <script> <arg> ...
7276
7277- Much improved parseaddr() in rfc822.
7278
7279- In cgi.py, you can now pass an alternative value for environ to
7280nearly all functions.
7281
7282- You can now assign to instance variables whose name begins and ends
7283with '__'.
7284
7285- New version of Fred Drake's parser module and associates (token,
7286symbol, AST).
7287
7288- New PYTHON_API_VERSION value and .pyc file magic number (again!).
7289
7290- The "complex" internal structure type is now called "Py_complex" to
7291avoid name conflicts.
7292
7293- Numerous small bugs fixed.
7294
7295- Slight pickle speedups.
7296
7297- Some slight speedups suggested by Sjoerd (more coming in 1.4 final).
7298
7299- NeXT portability mods by Bill Bumgarner integrated.
7300
7301- Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been
7302converted to new naming style.
7303
7304
7305What's new in 1.4beta1 (since 1.3)?
7306-----------------------------------
7307
7308- Added sys.platform and sys.exec_platform for Bill Janssen.
7309
7310- Installation has been completely overhauled. "make install" now installs
7311everything, not just the python binary. Installation uses the install-sh
7312script (borrowed from X11) to install each file.
7313
7314- New functions in the posix module: mkfifo, plock, remove (== unlink),
7315and ftruncate. More functions are also available under NT.
7316
7317- New function in the fcntl module: flock.
7318
7319- Shared library support for FreeBSD.
7320
7321- The --with-readline option can now be used without a DIRECTORY argument,
7322for systems where libreadline.* is in one of the standard places. It is
7323also possible for it to be a shared library.
7324
7325- The extension tkinter has been renamed to _tkinter, to avoid confusion
7326with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as
7327well as 4.0.
7328
7329- Author's change of address from CWI in Amsterdam, The Netherlands, to
7330CNRI in Reston, VA, USA.
7331
7332- The math.hypot() function is now always available (if it isn't found in
7333the C math library, Python provides its own implementation).
7334
7335- The latex documentation is now compatible with latex2e, thanks to David
7336Ascher.
7337
7338- The expression x**y is now equivalent to pow(x, y).
7339
7340- The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)].
7341
7342- Complex numbers are now supported. Imaginary constants are written with
7343a 'j' or 'J' prefix, general complex numbers can be formed by adding a real
7344part to an imaginary part, like 3+4j. Complex numbers are always stored in
7345floating point form, so this is equivalent to 3.0+4.0j. It is also
7346possible to create complex numbers with the new built-in function
7347complex(re, [im]). For the footprint-conscious, complex number support can
7348be disabled by defining the symbol WITHOUT_COMPLEX.
7349
7350- New built-in function list() is the long-awaited counterpart of tuple().
7351
7352- There's a new "cmath" module which provides the same functions as the
7353"math" library but with complex arguments and results. (There are very
7354good reasons why math.sqrt(-1) still raises an exception -- you have to use
7355cmath.sqrt(-1) to get 1j for an answer.)
7356
7357- The Python.h header file (which is really the same as allobjects.h except
7358it disables support for old style names) now includes several more files,
7359so you have to have fewer #include statements in the average extension.
7360
7361- The NDEBUG symbol is no longer used. Code that used to be dependent on
7362the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS
7363and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG,
7364respectively. At long last, the source actually compiles and links without
7365errors when this symbol is defined.
7366
7367- Several symbols that didn't follow the new naming scheme have been
7368renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There
7369are no external symbols left without a Py or _Py prefix, not even those
7370defined by sources that were incorporated from elsewhere (regexpr.c,
7371md5c.c). (Macros are a different story...)
7372
7373- There are now typedefs for the structures defined in config.c and
7374frozen.c.
7375
7376- New PYTHON_API_VERSION value and .pyc file magic number.
7377
7378- New module Bastion. (XXX)
7379
7380- Improved performance of StringIO module.
7381
7382- UserList module now supports + and * operators.
7383
7384- The binhex and binascii modules now actually work.
7385
7386- The cgi module has been almost totally rewritten and documented.
7387It now supports file upload and a new data type to handle forms more
7388flexibly.
7389
7390- The formatter module (for use with htmllib) has been overhauled (again).
7391
7392- The ftplib module now supports passive mode and has doc strings.
7393
7394- In (ideally) all places where binary files are read or written, the file
7395is now correctly opened in binary mode ('rb' or 'wb') so the code will work
7396on Mac or PC.
7397
7398- Dummy versions of os.path.expandvars() and expanduser() are now provided
7399on non-Unix platforms.
7400
7401- Module urllib now has two new functions url2pathname and pathname2url
7402which turn local filenames into "file:..." URLs using the same rules as
7403Netscape (why be different). it also supports urlretrieve() with a
7404pathname parameter, and honors the proxy environment variables (http_proxy
7405etc.). The URL parsing has been improved somewhat, too.
7406
7407- Micro improvements to urlparse. Added urlparse.urldefrag() which
7408removes a trailing ``#fragment'' if any.
7409
7410- The mailbox module now supports MH style message delimiters as well.
7411
7412- The mhlib module contains some new functionality: setcontext() to set the
7413current folder and parsesequence() to parse a sequence as commonly passed
7414to MH commands (e.g. 1-10 or last:5).
7415
7416- New module mimify for conversion to and from MIME format of email
7417messages.
7418
7419- Module ni now automatically installs itself when first imported -- this
7420is against the normal rule that modules should define classes and functions
7421but not invoke them, but appears more useful in the case that two
7422different, independent modules want to use ni's features.
7423
7424- Some small performance enhancements in module pickle.
7425
7426- Small interface change to the profile.run*() family of functions -- more
7427sensible handling of return values.
7428
7429- The officially registered Mac creator for Python files is 'Pyth'. This
7430replaces 'PYTH' which was used before but never registered.
7431
7432- Added regsub.capwords(). (XXX)
7433
7434- Added string.capwords(), string.capitalize() and string.translate().
7435(XXX)
7436
7437- Fixed an interface bug in the rexec module: it was impossible to pass a
7438hooks instance to the RExec class. rexec now also supports the dynamic
7439loading of modules from shared libraries. Some other interfaces have been
7440added too.
7441
7442- Module rfc822 now caches the headers in a dictionary for more efficient
7443lookup.
7444
7445- The sgmllib module now understands a limited number of SGML "shorthands"
7446like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...)
7447
7448- The tempfile module actually tries a number of different places to find a
7449usable temporary directory. (This was prompted by certain Linux
7450installations that appear to be missing a /usr/tmp directory.) [A bug in
7451the implementation that would ignore a pre-existing tmpdir global has been
7452fixed in beta3.]
7453
7454- Much improved and enhanved FileDialog module for Tkinter.
7455
7456- Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as
7457well as Tk 4.1).
7458
7459- New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and
7460s.dup(). Sockets now work correctly on Windows. On Windows, the built-in
7461extension is called _socket and a wrapper module win/socket.py provides
7462"makefile()" and "dup()" functionality. On Windows, the select module
7463works only with socket objects.
7464
7465- Bugs in bsddb module fixed (e.g. missing default argument values).
7466
7467- The curses extension now includes <ncurses.h> when available.
7468
7469- The gdbm module now supports opening databases in "fast" mode by
7470specifying 'f' as the second character or the mode string.
7471
7472- new variables sys.prefix and sys.exec_prefix pass corresponding
7473configuration options / Makefile variables to the Python programmer.
7474
7475- The ``new'' module now supports creating new user-defined classes as well
7476as instances thereof.
7477
7478- The soundex module now sports get_soundex() to get the soundex value for an
7479arbitrary string (formerly it would only do soundex-based string
7480comparison) as well as doc strings.
7481
7482- New object type "cobject" to safely wrap void pointers for passing them
7483between various extension modules.
7484
7485- More efficient computation of float**smallint.
7486
7487- The mysterious bug whereby "x.x" (two occurrences of the same
7488one-character name) typed from the commandline would sometimes fail
7489mysteriously.
7490
7491- The initialization of the readline function can now be invoked by a C
7492extension through PyOS_ReadlineInit().
7493
7494- There's now an externally visible pointer PyImport_FrozenModules which
7495can be changed by an embedding application.
7496
7497- The argument parsing functions now support a new format character 'D' to
7498specify complex numbers.
7499
7500- Various memory leaks plugged and bugs fixed.
7501
7502- Improved support for posix threads (now that real implementations are
7503beginning to apepar). Still no fully functioning semaphores.
7504
7505- Some various and sundry improvements and new entries in the Tools
7506directory.
7507
7508
7509=====================================
Guido van Rossumc30e95f1996-07-30 18:53:51 +00007510==> Release 1.3 (13 October 1995) <==
7511=====================================
7512
7513Major change
7514============
7515
7516Two words: Keyword Arguments. See the first section of Chapter 12 of
7517the Tutorial.
7518
7519(The rest of this file is textually the same as the remaining sections
7520of that chapter.)
7521
7522
7523Changes to the WWW and Internet tools
7524=====================================
7525
7526The "htmllib" module has been rewritten in an incompatible fashion.
7527The new version is considerably more complete (HTML 2.0 except forms,
7528but including all ISO-8859-1 entity definitions), and easy to use.
7529Small changes to "sgmllib" have also been made, to better match the
7530tokenization of HTML as recognized by other web tools.
7531
7532A new module "formatter" has been added, for use with the new
7533"htmllib" module.
7534
7535The "urllib"and "httplib" modules have been changed somewhat to allow
7536overriding unknown URL types and to support authentication. They now
7537use "mimetools.Message" instead of "rfc822.Message" to parse headers.
7538The "endrequest()" method has been removed from the HTTP class since
7539it breaks the interaction with some servers.
7540
7541The "rfc822.Message" class has been changed to allow a flag to be
7542passed in that says that the file is unseekable.
7543
7544The "ftplib" module has been fixed to be (hopefully) more robust on
7545Linux.
7546
7547Several new operations that are optionally supported by servers have
7548been added to "nntplib": "xover", "xgtitle", "xpath" and "date".
7549
7550Other Language Changes
7551======================
7552
7553The "raise" statement now takes an optional argument which specifies
7554the traceback to be used when printing the exception's stack trace.
7555This must be a traceback object, such as found in "sys.exc_traceback".
7556When omitted or given as "None", the old behavior (to generate a stack
7557trace entry for the current stack frame) is used.
7558
7559The tokenizer is now more tolerant of alien whitespace. Control-L in
7560the leading whitespace of a line resets the column number to zero,
7561while Control-R just before the end of the line is ignored.
7562
7563Changes to Built-in Operations
7564==============================
7565
7566For file objects, "f.read(0)" and "f.readline(0)" now return an empty
7567string rather than reading an unlimited number of bytes. For the
7568latter, omit the argument altogether or pass a negative value.
7569
7570A new system variable, "sys.platform", has been added. It specifies
7571the current platform, e.g. "sunos5" or "linux1".
7572
7573The built-in functions "input()" and "raw_input()" now use the GNU
7574readline library when it has been configured (formerly, only
7575interactive input to the interpreter itself was read using GNU
7576readline). The GNU readline library provides elaborate line editing
7577and history. The Python debugger ("pdb") is the first beneficiary of
7578this change.
7579
7580Two new built-in functions, "globals()" and "locals()", provide access
7581to dictionaries containming current global and local variables,
7582respectively. (These augment rather than replace "vars()", which
7583returns the current local variables when called without an argument,
7584and a module's global variables when called with an argument of type
7585module.)
7586
7587The built-in function "compile()" now takes a third possible value for
7588the kind of code to be compiled: specifying "'single'" generates code
7589for a single interactive statement, which prints the output of
7590expression statements that evaluate to something else than "None".
7591
7592Library Changes
7593===============
7594
7595There are new module "ni" and "ihooks" that support importing modules
7596with hierarchical names such as "A.B.C". This is enabled by writing
7597"import ni; ni.ni()" at the very top of the main program. These
7598modules are amply documented in the Python source.
7599
7600The module "rexec" has been rewritten (incompatibly) to define a class
7601and to use "ihooks".
7602
7603The "string.split()" and "string.splitfields()" functions are now the
7604same function (the presence or absence of the second argument
7605determines which operation is invoked); similar for "string.join()"
7606and "string.joinfields()".
7607
7608The "Tkinter" module and its helper "Dialog" have been revamped to use
7609keyword arguments. Tk 4.0 is now the standard. A new module
7610"FileDialog" has been added which implements standard file selection
7611dialogs.
7612
7613The optional built-in modules "dbm" and "gdbm" are more coordinated
7614--- their "open()" functions now take the same values for their "flag"
7615argument, and the "flag" and "mode" argument have default values (to
7616open the database for reading only, and to create the database with
7617mode "0666" minuse the umask, respectively). The memory leaks have
7618finally been fixed.
7619
7620A new dbm-like module, "bsddb", has been added, which uses the BSD DB
7621package's hash method.
7622
7623A portable (though slow) dbm-clone, implemented in Python, has been
7624added for systems where none of the above is provided. It is aptly
7625dubbed "dumbdbm".
7626
7627The module "anydbm" provides a unified interface to "bsddb", "gdbm",
7628"dbm", and "dumbdbm", choosing the first one available.
7629
7630A new extension module, "binascii", provides a variety of operations
7631for conversion of text-encoded binary data.
7632
7633There are three new or rewritten companion modules implemented in
7634Python that can encode and decode the most common such formats: "uu"
7635(uuencode), "base64" and "binhex".
7636
7637A module to handle the MIME encoding quoted-printable has also been
7638added: "quopri".
7639
7640The parser module (which provides an interface to the Python parser's
7641abstract syntax trees) has been rewritten (incompatibly) by Fred
7642Drake. It now lets you change the parse tree and compile the result!
7643
7644The \code{syslog} module has been upgraded and documented.
7645
7646Other Changes
7647=============
7648
7649The dynamic module loader recognizes the fact that different filenames
7650point to the same shared library and loads the library only once, so
7651you can have a single shared library that defines multiple modules.
7652(SunOS / SVR4 style shared libraries only.)
7653
7654Jim Fulton's ``abstract object interface'' has been incorporated into
7655the run-time API. For more detailes, read the files
7656"Include/abstract.h" and "Objects/abstract.c".
7657
7658The Macintosh version is much more robust now.
7659
7660Numerous things I have forgotten or that are so obscure no-one will
7661notice them anyway :-)
7662
7663
Guido van Rossumf456b6d1995-01-04 19:20:37 +00007664===================================
Guido van Rossumd462f3d1995-10-09 21:30:37 +00007665==> Release 1.2 (13 April 1995) <==
7666===================================
7667
7668- Changes to Misc/python-mode.el:
7669 - Wrapping and indentation within triple quote strings should work
7670 properly now.
7671 - `Standard' bug reporting mechanism (use C-c C-b)
7672 - py-mark-block was moved to C-c C-m
7673 - C-c C-v shows you the python-mode version
7674 - a basic python-font-lock-keywords has been added for Emacs 19
7675 font-lock colorizations.
7676 - proper interaction with pending-del and del-sel modes.
7677 - New py-electric-colon (:) command for improved outdenting. Also
7678 py-indent-line (TAB) should handle outdented lines better.
7679 - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
7680
7681- The Library Reference has been restructured, and many new and
7682existing modules are now documented, in particular the debugger and
7683the profiler, as well as the persistency and the WWW/Internet support
7684modules.
7685
7686- All known bugs have been fixed. For example the pow(2,2,3L) bug on
7687Linux has been fixed. Also the re-entrancy problems with __del__ have
7688been fixed.
7689
7690- All known memory leaks have been fixed.
7691
7692- Phase 2 of the Great Renaming has been executed. The header files
7693now use the new names (PyObject instead of object, etc.). The linker
7694also sees the new names. Most source files still use the old names,
7695by virtue of the rename2.h header file. If you include Python.h, you
7696only see the new names. Dynamically linked modules have to be
7697recompiled. (Phase 3, fixing the rest of the sources, will be
7698executed gradually with the release later versions.)
7699
7700- The hooks for implementing "safe-python" (better called "restricted
7701execution") are in place. Specifically, the import statement is
7702implemented by calling the built-in function __import__, and the
7703built-in names used in a particular scope are taken from the
7704dictionary __builtins__ in that scope's global dictionary. See also
7705the new (unsupported, undocumented) module rexec.py.
7706
7707- The import statement now supports the syntax "import a.b.c" and
7708"from a.b.c import name". No officially supported implementation
7709exists, but one can be prototyped by replacing the built-in __import__
7710function. A proposal by Ken Manheimer is provided as newimp.py.
7711
7712- All machinery used by the import statement (or the built-in
7713__import__ function) is now exposed through the new built-in module
7714"imp" (see the library reference manual). All dynamic loading
7715machinery is moved to the new file importdl.c.
7716
7717- Persistent storage is supported through the use of the modules
7718"pickle" and "shelve" (implemented in Python). There's also a "copy"
7719module implementing deepcopy and normal (shallow) copy operations.
7720See the library reference manual.
7721
7722- Documentation strings for many objects types are accessible through
7723the __doc__ attribute. Modules, classes and functions support special
7724syntax to initialize the __doc__ attribute: if the first statement
7725consists of just a string literal, that string literal becomes the
7726value of the __doc__ attribute. The default __doc__ attribute is
7727None. Documentation strings are also supported for built-in
7728functions, types and modules; however this feature hasn't been widely
7729used yet. See the 'new' module for an example. (Basically, the type
7730object's tp_doc field contains the doc string for the type, and the
77314th member of the methodlist structure contains the doc string for the
7732method.)
7733
7734- The __coerce__ and __cmp__ methods for user-defined classes once
7735again work as expected. As an example, there's a new standard class
7736Complex in the library.
7737
7738- The functions posix.popen() and posix.fdopen() now have an optional
7739third argument to specify the buffer size, and default their second
7740(mode) argument to 'r' -- in analogy to the builtin open() function.
7741The same applies to posixfile.open() and the socket method makefile().
7742
7743- The thread.exit_thread() function now raises SystemExit so that
7744'finally' clauses are honored and a memory leak is plugged.
7745
7746- Improved X11 and Motif support, by Sjoerd Mullender. This extension
7747is being maintained and distributed separately.
7748
7749- Improved support for the Apple Macintosh, in part by Jack Jansen,
7750e.g. interfaces to (a few) resource mananger functions, get/set file
7751type and creator, gestalt, sound manager, speech manager, MacTCP, comm
7752toolbox, and the think C console library. This is being maintained
7753and distributed separately.
7754
7755- Improved version for Windows NT, by Mark Hammond. This is being
7756maintained and distributed separately.
7757
7758- Used autoconf 2.0 to generate the configure script. Adapted
7759configure.in to use the new features in autoconf 2.0.
7760
7761- It now builds on the NeXT without intervention, even on the 3.3
7762Sparc pre-release.
7763
7764- Characters passed to isspace() and friends are masked to nonnegative
7765values.
7766
7767- Correctly compute pow(-3.0, 3).
7768
7769- Fix portability problems with getopt (configure now checks for a
7770non-GNU getopt).
7771
7772- Don't add frozenmain.o to libPython.a.
7773
7774- Exceptions can now be classes. ALl built-in exceptions are still
7775string objects, but this will change in the future.
7776
7777- The socket module exports a long list of socket related symbols.
7778(More built-in modules will export their symbolic constants instead of
7779relying on a separately generated Python module.)
7780
7781- When a module object is deleted, it clears out its own dictionary.
7782This fixes a circularity in the references between functions and
7783their global dictionary.
7784
7785- Changed the error handling by [new]getargs() e.g. for "O&".
7786
7787- Dynamic loading of modules using shared libraries is supported for
7788several new platforms.
7789
7790- Support "O&", "[...]" and "{...}" in mkvalue().
7791
7792- Extension to findmethod(): findmethodinchain() (where a chain is a
7793linked list of methodlist arrays). The calling interface for
7794findmethod() has changed: it now gets a pointer to the (static!)
7795methodlist structure rather than just to the function name -- this
7796saves copying flags etc. into the (short-lived) method object.
7797
7798- The callable() function is now public.
7799
7800- Object types can define a few new operations by setting function
7801pointers in the type object structure: tp_call defines how an object
7802is called, and tp_str defines how an object's str() is computed.
7803
7804
7805===================================
Guido van Rossumf456b6d1995-01-04 19:20:37 +00007806==> Release 1.1.1 (10 Nov 1994) <==
7807===================================
7808
7809This is a pure bugfix release again. See the ChangeLog file for details.
7810
7811One exception: a few new features were added to tkinter.
7812
7813
7814=================================
7815==> Release 1.1 (11 Oct 1994) <==
7816=================================
7817
7818This release adds several new features, improved configuration and
7819portability, and fixes more bugs than I can list here (including some
7820memory leaks).
7821
7822The source compiles and runs out of the box on more platforms than
7823ever -- including Windows NT. Makefiles or projects for a variety of
7824non-UNIX platforms are provided.
7825
7826APOLOGY: some new features are badly documented or not at all. I had
7827the choice -- postpone the new release indefinitely, or release it
7828now, with working code but some undocumented areas. The problem with
7829postponing the release is that people continue to suffer from existing
7830bugs, and send me patches based on the previous release -- which I
7831can't apply directly because my own source has changed. Also, some
7832new modules (like signal) have been ready for release for quite some
7833time, and people are anxiously waiting for them. In the case of
7834signal, the interface is simple enough to figure out without
7835documentation (if you're anxious enough :-). In this case it was not
7836simple to release the module on its own, since it relies on many small
7837patches elsewhere in the source.
7838
7839For most new Python modules, the source code contains comments that
7840explain how to use them. Documentation for the Tk interface, written
7841by Matt Conway, is available as tkinter-doc.tar.gz from the Python
7842home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the
7843new operator overloading facilities, have a look at Demo/classes:
7844Complex.py and Rat.py show how to implement a numeric type without and
7845with __coerce__ method. Also have a look at the end of the Tutorial
7846document (Doc/tut.tex). If you're still confused: use the newsgroup
7847or mailing list.
7848
7849
7850New language features:
7851
7852 - More flexible operator overloading for user-defined classes
7853 (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial.
7854
7855 - Classes can define methods named __getattr__, __setattr__ and
7856 __delattr__ to trap attribute accesses. See end of tutorial.
7857
7858 - Classes can define method __call__ so instances can be called
7859 directly. See end of tutorial.
7860
7861
7862New support facilities:
7863
7864 - The Makefiles (for the base interpreter as well as for extensions)
7865 now support creating dynamically loadable modules if the platform
7866 supports shared libraries.
7867
7868 - Passing the interpreter a .pyc file as script argument will execute
7869 the code in that file. (On the Mac such files can be double-clicked!)
7870
7871 - New Freeze script, to create independently distributable "binaries"
7872 of Python programs -- look in Demo/freeze
7873
7874 - Improved h2py script (in Demo/scripts) follows #includes and
7875 supports macros with one argument
7876
7877 - New module compileall generates .pyc files for all modules in a
7878 directory (tree) without also executing them
7879
7880 - Threads should work on more platforms
7881
7882
7883New built-in modules:
7884
7885 - tkinter (support for Tcl's Tk widget set) is now part of the base
7886 distribution
7887
7888 - signal allows catching or ignoring UNIX signals (unfortunately still
7889 undocumented -- any taker?)
7890
7891 - termios provides portable access to POSIX tty settings
7892
7893 - curses provides an interface to the System V curses library
7894
7895 - syslog provides an interface to the (BSD?) syslog daemon
7896
7897 - 'new' provides interfaces to create new built-in object types
7898 (e.g. modules and functions)
7899
7900 - sybase provides an interface to SYBASE database
7901
7902
7903New/obsolete built-in methods:
7904
7905 - callable(x) tests whether x can be called
7906
7907 - sockets now have a setblocking() method
7908
7909 - sockets no longer have an allowbroadcast() method
7910
7911 - socket methods send() and sendto() return byte count
7912
7913
7914New standard library modules:
7915
7916 - types.py defines standard names for built-in types, e.g. StringType
7917
7918 - urlparse.py parses URLs according to the latest Internet draft
7919
7920 - uu.py does uuencode/uudecode (not the fastest in the world, but
7921 quicker than installing uuencode on a non-UNIX machine :-)
7922
7923 - New, faster and more powerful profile module.py
7924
7925 - mhlib.py provides interface to MH folders and messages
7926
7927
7928New facilities for extension writers (unfortunately still
7929undocumented):
7930
7931 - newgetargs() supports optional arguments and improved error messages
7932
7933 - O!, O& O? formats for getargs allow more versatile type checking of
7934 non-standard types
7935
7936 - can register pending asynchronous callback, to be called the next
7937 time the Python VM begins a new instruction (Py_AddPendingCall)
7938
7939 - can register cleanup routines to be called when Python exits
7940 (Py_AtExit)
7941
7942 - makesetup script understands C++ files in Setup file (use file.C
7943 or file.cc)
7944
7945 - Make variable OPT is passed on to sub-Makefiles
7946
7947 - An init<module>() routine may signal an error by not entering
7948 the module in the module table and raising an exception instead
7949
7950 - For long module names, instead of foobarbletchmodule.c you can
7951 use foobarbletch.c
7952
7953 - getintvalue() and getfloatvalue() try to convert any object
7954 instead of requiring an "intobject" or "floatobject"
7955
7956 - All the [new]getargs() formats that retrieve an integer value
7957 will now also work if a float is passed
7958
7959 - C function listtuple() converts list to tuple, fast
7960
7961 - You should now call sigcheck() instead of intrcheck();
7962 sigcheck() also sets an exception when it returns nonzero
7963
7964
Guido van Rossumaa253861994-10-06 17:18:57 +00007965====================================
7966==> Release 1.0.3 (14 July 1994) <==
7967====================================
7968
7969This release consists entirely of bug fixes to the C sources; see the
7970head of ../ChangeLog for a complete list. Most important bugs fixed:
7971
7972- Sometimes the format operator (string%expr) would drop the last
7973character of the format string
7974
7975- Tokenizer looped when last line did not end in \n
7976
7977- Bug when triple-quoted string ended in quote plus newline
7978
7979- Typo in socketmodule (listen) (== instead of =)
7980
7981- typing vars() at the >>> prompt would cause recursive output
7982
7983
7984==================================
7985==> Release 1.0.2 (4 May 1994) <==
7986==================================
7987
7988Overview of the most visible changes. Bug fixes are not listed. See
7989also ChangeLog.
7990
7991Tokens
7992------
7993
7994* String literals follow Standard C rules: they may be continued on
7995the next line using a backslash; adjacent literals are concatenated
7996at compile time.
7997
7998* A new kind of string literals, surrounded by triple quotes (""" or
7999'''), can be continued on the next line without a backslash.
8000
8001Syntax
8002------
8003
8004* Function arguments may have a default value, e.g. def f(a, b=1);
8005defaults are evaluated at function definition time. This also applies
8006to lambda.
8007
8008* The try-except statement has an optional else clause, which is
8009executed when no exception occurs in the try clause.
8010
8011Interpreter
8012-----------
8013
8014* The result of a statement-level expression is no longer printed,
8015except_ for expressions entered interactively. Consequently, the -k
8016command line option is gone.
8017
8018* The result of the last printed interactive expression is assigned to
8019the variable '_'.
8020
8021* Access to implicit global variables has been speeded up by removing
8022an always-failing dictionary lookup in the dictionary of local
8023variables (mod suggested by Steve Makewski and Tim Peters).
8024
8025* There is a new command line option, -u, to force stdout and stderr
8026to be unbuffered.
8027
8028* Incorporated Steve Majewski's mods to import.c for dynamic loading
8029under AIX.
8030
8031* Fewer chances of dumping core when trying to reload or re-import
8032static built-in, dynamically loaded built-in, or frozen modules.
8033
8034* Loops over sequences now don't ask for the sequence's length when
8035they start, but try to access items 0, 1, 2, and so on until they hit
8036an IndexError. This makes it possible to create classes that generate
8037infinite or indefinite sequences a la Steve Majewski. This affects
8038for loops, the (not) in operator, and the built-in functions filter(),
8039map(), max(), min(), reduce().
8040
8041Changed Built-in operations
8042---------------------------
8043
8044* The '%' operator on strings (printf-style formatting) supports a new
8045feature (adapted from a patch by Donald Beaudry) to allow
8046'%(<key>)<format>' % {...} to take values from a dictionary by name
8047instead of from a tuple by position (see also the new function
8048vars()).
8049
8050* The '%s' formatting operator is changed to accept any type and
8051convert it to a string using str().
8052
8053* Dictionaries with more than 20,000 entries can now be created
8054(thanks to Steve Kirsch).
8055
8056New Built-in Functions
8057----------------------
8058
8059* vars() returns a dictionary containing the local variables; vars(m)
8060returns a dictionary containing the variables of module m. Note:
8061dir(x) is now equivalent to vars(x).keys().
8062
8063Changed Built-in Functions
8064--------------------------
8065
8066* open() has an optional third argument to specify the buffer size: 0
8067for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0
8068for default.
8069
8070* open()'s second argument is now optional; it defaults to "r".
8071
8072* apply() now checks that its second argument is indeed a tuple.
8073
8074New Built-in Modules
8075--------------------
8076
8077Changed Built-in Modules
8078------------------------
8079
8080The thread module no longer supports exit_prog().
8081
8082New Python Modules
8083------------------
8084
8085* Module addpack contains a standard interface to modify sys.path to
8086find optional packages (groups of related modules).
8087
8088* Module urllib contains a number of functions to access
8089World-Wide-Web files specified by their URL.
8090
8091* Module httplib implements the client side of the HTTP protocol used
8092by World-Wide-Web servers.
8093
8094* Module gopherlib implements the client side of the Gopher protocol.
8095
8096* Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF
8097style mailbox files.
8098
8099* Module random contains various random distributions, e.g. gauss().
8100
8101* Module lockfile locks and unlocks open files using fcntl (inspired
8102by a similar module by Andy Bensky).
8103
8104* Module ntpath (by Jaap Vermeulen) implements path operations for
8105Windows/NT.
8106
8107* Module test_thread (in Lib/test) contains a small test set for the
8108thread module.
8109
8110Changed Python Modules
8111----------------------
8112
8113* The string module's expandvars() function is now documented and is
8114implemented in Python (using regular expressions) instead of forking
8115off a shell process.
8116
8117* Module rfc822 now supports accessing the header fields using the
8118mapping/dictionary interface, e.g. h['subject'].
8119
8120* Module pdb now makes it possible to set a break on a function
8121(syntax: break <expression>, where <expression> yields a function
8122object).
8123
8124Changed Demos
8125-------------
8126
8127* The Demo/scripts/freeze.py script is working again (thanks to Jaap
8128Vermeulen).
8129
8130New Demos
8131---------
8132
8133* Demo/threads/Generator.py is a proposed interface for restartable
8134functions a la Tim Peters.
8135
8136* Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a
8137directory full of HTML pages which between them contain links to all
8138the newsgroups available on your server.
8139
8140* Demo/dns contains a DNS (Domain Name Server) client.
8141
8142* Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a
8143nice enhanced Python shell!!!).
8144
8145* Demo/turing contains a Turing machine by Amrit Prem.
8146
8147Documentation
8148-------------
8149
8150* Documented new language features mentioned above (but not all new
8151modules).
8152
8153* Added a chapter to the Tutorial describing recent additions to
8154Python.
8155
8156* Clarified some sentences in the reference manual,
8157e.g. break/continue, local/global scope, slice assignment.
8158
8159Source Structure
8160----------------
8161
8162* Moved Include/tokenizer.h to Parser/tokenizer.h.
8163
8164* Added Python/getopt.c for systems that don't have it.
8165
8166Emacs mode
8167----------
8168
8169* Indentation of continuated lines is done more intelligently;
8170consequently the variable py-continuation-offset is gone.
8171
Guido van Rossumf2eac992000-09-04 17:24:24 +00008172
Guido van Rossumaa253861994-10-06 17:18:57 +00008173========================================
8174==> Release 1.0.1 (15 February 1994) <==
8175========================================
8176
8177* Many portability fixes should make it painless to build Python on
8178several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows.
8179
8180* Fixed test for <stdarg.h> -- this broke on some platforms.
8181
8182* Fixed test for shared library dynalic loading -- this broke on SunOS
81834.x using the GNU loader.
8184
8185* Changed order and number of SVR4 networking libraries (it is now
8186-lsocket -linet -lnsl, if these libraries exist).
8187
8188* Installing the build intermediate stages with "make libainstall" now
8189also installs config.c.in, Setup and makesetup, which are used by the
8190new Extensions mechanism.
8191
8192* Improved README file contains more hints and new troubleshooting
8193section.
8194
8195* The built-in module strop now defines fast versions of three more
8196functions of the standard string module: atoi(), atol() and atof().
8197The strop versions of atoi() and atol() support an optional second
8198argument to specify the base (default 10). NOTE: you don't have to
8199explicitly import strop to use the faster versions -- the string
8200module contains code to let versions from stop override the default
8201versions.
8202
8203* There is now a working Lib/dospath.py for those who use Python under
8204DOS (or Windows). Thanks, Jaap!
8205
8206* There is now a working Modules/dosmodule.c for DOS (or Windows)
8207system calls.
8208
8209* Lib.os.py has been reorganized (making it ready for more operating
8210systems).
8211
8212* Lib/ospath.py is now obsolete (use os.path instead).
8213
8214* Many fixes to the tutorial to make it match Python 1.0. Thanks,
8215Tim!
8216
8217* Fixed Doc/Makefile, Doc/README and various scripts there.
8218
8219* Added missing description of fdopen to Doc/libposix.tex.
8220
8221* Made cleanup() global, for the benefit of embedded applications.
8222
8223* Added parsing of addresses and dates to Lib/rfc822.py.
8224
8225* Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make
8226them usable at all.
8227
8228* New module Lib/wave.py reads RIFF (*.wav) audio files.
8229
8230* Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it
8231belongs.
8232
8233* New options and comments for Modules/makesetup (used by new
8234Extension mechanism).
8235
8236* Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc
8237and elsewhere.
8238
8239* Fixed coredump in filter(None, 'abcdefg').
8240
8241
8242=======================================
8243==> Release 1.0.0 (26 January 1994) <==
8244=======================================
8245
8246As is traditional, so many things have changed that I can't pretend to
8247be complete in these release notes, but I'll try anyway :-)
8248
8249Note that the very last section is labeled "remaining bugs".
8250
8251
8252Source organization and build process
8253-------------------------------------
8254
8255* The sources have finally been split: instead of a single src
8256subdirectory there are now separate directories Include, Parser,
8257Grammar, Objects, Python and Modules. Other directories also start
8258with a capital letter: Misc, Doc, Lib, Demo.
8259
8260* A few extensions (notably Amoeba and X support) have been moved to a
8261separate subtree Extensions, which is no longer in the core
8262distribution, but separately ftp'able as extensions.tar.Z. (The
8263distribution contains a placeholder Ext-dummy with a description of
8264the Extensions subtree as well as the most recent versions of the
8265scripts used there.)
8266
8267* A few large specialized demos (SGI video and www) have been
8268moved to a separate subdirectory Demo2, which is no longer in the core
8269distribution, but separately ftp'able as demo2.tar.Z.
8270
8271* Parts of the standard library have been moved to subdirectories:
8272there are now standard subdirectories stdwin, test, sgi and sun4.
8273
8274* The configuration process has radically changed: I now use GNU
8275autoconf. This makes it much easier to build on new Unix flavors, as
8276well as fully supporting VPATH (if your Make has it). The scripts
8277Configure.py and Addmodule.sh are no longer needed. Many source files
8278have been adapted in order to work with the symbols that the configure
8279script generated by autoconf defines (or not); the resulting source is
8280much more portable to different C compilers and operating systems,
8281even non Unix systems (a Mac port was done in an afternoon). See the
8282toplevel README file for a description of the new build process.
8283
8284* GNU readline (a slightly newer version) is now a subdirectory of the
8285Python toplevel. It is still not automatically configured (being
8286totally autoconf-unaware :-). One problem has been solved: typing
8287Control-C to a readline prompt will now work. The distribution no
8288longer contains a "super-level" directory (above the python toplevel
8289directory), and dl, dl-dld and GNU dld are no longer part of the
8290Python distribution (you can still ftp them from
8291ftp.cwi.nl:/pub/dynload).
8292
8293* The DOS functions have been taken out of posixmodule.c and moved
8294into a separate file dosmodule.c.
8295
8296* There's now a separate file version.c which contains nothing but
8297the version number.
8298
8299* The actual main program is now contained in config.c (unless NO_MAIN
8300is defined); pythonmain.c now contains a function realmain() which is
8301called from config.c's main().
8302
8303* All files needed to use the built-in module md5 are now contained in
8304the distribution. The module has been cleaned up considerably.
8305
8306
8307Documentation
8308-------------
8309
8310* The library manual has been split into many more small latex files,
8311so it is easier to edit Doc/lib.tex file to create a custom library
8312manual, describing only those modules supported on your system. (This
8313is not automated though.)
8314
8315* A fourth manual has been added, titled "Extending and Embedding the
8316Python Interpreter" (Doc/ext.tex), which collects information about
8317the interpreter which was previously spread over several files in the
8318misc subdirectory.
8319
8320* The entire documentation is now also available on-line for those who
8321have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL
8322"http://www.cwi.nl/~guido/Python.html".
8323
8324
8325Syntax
8326------
8327
8328* Strings may now be enclosed in double quotes as well as in single
8329quotes. There is no difference in interpretation. The repr() of
8330string objects will use double quotes if the string contains a single
8331quote and no double quotes. Thanks to Amrit Prem for these changes!
8332
8333* There is a new keyword 'exec'. This replaces the exec() built-in
8334function. If a function contains an exec statement, local variable
8335optimization is not performed for that particular function, thus
8336making assignment to local variables in exec statements less
8337confusing. (As a consequence, os.exec and python.exec have been
8338renamed to execv.)
8339
8340* There is a new keyword 'lambda'. An expression of the form
8341
8342 lambda <parameters> : <expression>
8343
8344yields an anonymous function. This is really only syntactic sugar;
8345you can just as well define a local function using
8346
8347 def some_temporary_name(<parameters>): return <expression>
8348
8349Lambda expressions are particularly useful in combination with map(),
8350filter() and reduce(), described below. Thanks to Amrit Prem for
8351submitting this code (as well as map(), filter(), reduce() and
8352xrange())!
8353
8354
8355Built-in functions
8356------------------
8357
8358* The built-in module containing the built-in functions is called
8359__builtin__ instead of builtin.
8360
8361* New built-in functions map(), filter() and reduce() perform standard
8362functional programming operations (though not lazily):
8363
8364- map(f, seq) returns a new sequence whose items are the items from
8365seq with f() applied to them.
8366
8367- filter(f, seq) returns a subsequence of seq consisting of those
8368items for which f() is true.
8369
8370- reduce(f, seq, initial) returns a value computed as follows:
8371 acc = initial
8372 for item in seq: acc = f(acc, item)
8373 return acc
8374
8375* New function xrange() creates a "range object". Its arguments are
8376the same as those of range(), and when used in a for loop a range
8377objects also behaves identical. The advantage of xrange() over
8378range() is that its representation (if the range contains many
8379elements) is much more compact than that of range(). The disadvantage
8380is that the result cannot be used to initialize a list object or for
8381the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern
8382architectures, benchmarks have shown that "for i in range(...): ..."
8383actually executes *faster* than "for i in xrange(...): ...", but on
8384memory starved machines like PCs running DOS range(100000) may be just
8385too big to be represented at all...
8386
8387* Built-in function exec() has been replaced by the exec statement --
8388see above.
8389
8390
8391The interpreter
8392---------------
8393
8394* Syntax errors are now not printed to stderr by the parser, but
8395rather the offending line and other relevant information are packed up
8396in the SyntaxError exception argument. When the main loop catches a
8397SyntaxError exception it will print the error in the same format as
8398previously, but at the proper position in the stack traceback.
8399
8400* You can now set a maximum to the number of traceback entries
8401printed by assigning to sys.tracebacklimit. The default is 1000.
8402
8403* The version number in .pyc files has changed yet again.
8404
8405* It is now possible to have a .pyc file without a corresponding .py
8406file. (Warning: this may break existing installations if you have an
8407old .pyc file lingering around somewhere on your module search path
8408without a corresponding .py file, when there is a .py file for a
8409module of the same name further down the path -- the new interpreter
8410will find the first .pyc file and complain about it, while the old
8411interpreter would ignore it and use the .py file further down.)
8412
8413* The list sys.builtin_module_names is now sorted and also contains
8414the names of a few hardwired built-in modules (sys, __main__ and
8415__builtin__).
8416
8417* A module can now find its own name by accessing the global variable
8418__name__. Assigning to this variable essentially renames the module
8419(it should also be stored under a different key in sys.modules).
8420A neat hack follows from this: a module that wants to execute a main
8421program when called as a script no longer needs to compare
8422sys.argv[0]; it can simply do "if __name__ == '__main__': main()".
8423
8424* When an object is printed by the print statement, its implementation
8425of str() is used. This means that classes can define __str__(self) to
8426direct how their instances are printed. This is different from
8427__repr__(self), which should define an unambigous string
8428representation of the instance. (If __str__() is not defined, it
8429defaults to __repr__().)
8430
8431* Functions and code objects can now be compared meaningfully.
8432
8433* On systems supporting SunOS or SVR4 style shared libraries, dynamic
8434loading of modules using shared libraries is automatically configured.
8435Thanks to Bill Jansen and Denis Severson for contributing this change!
8436
8437
8438Built-in objects
8439----------------
8440
8441* File objects have acquired a new method writelines() which is the
8442reverse of readlines(). (It does not actually write lines, just a
8443list of strings, but the symmetry makes the choice of name OK.)
8444
8445
8446Built-in modules
8447----------------
8448
8449* Socket objects no longer support the avail() method. Use the select
8450module instead, or use this function to replace it:
8451
8452 def avail(f):
8453 import select
8454 return f in select.select([f], [], [], 0)[0]
8455
8456* Initialization of stdwin is done differently. It actually modifies
8457sys.argv (taking out the options the X version of stdwin recognizes)
8458the first time it is imported.
8459
8460* A new built-in module parser provides a rudimentary interface to the
8461python parser. Corresponding standard library modules token and symbol
8462defines the numeric values of tokens and non-terminal symbols.
8463
8464* The posix module has aquired new functions setuid(), setgid(),
8465execve(), and exec() has been renamed to execv().
8466
8467* The array module is extended with 8-byte object swaps, the 'i'
8468format character, and a reverse() method. The read() and write()
8469methods are renamed to fromfile() and tofile().
8470
8471* The rotor module has freed of portability bugs. This introduces a
8472backward compatibility problem: strings encoded with the old rotor
8473module can't be decoded by the new version.
8474
8475* For select.select(), a timeout (4th) argument of None means the same
8476as leaving the timeout argument out.
8477
8478* Module strop (and hence standard library module string) has aquired
8479a new function: rindex(). Thanks to Amrit Prem!
8480
8481* Module regex defines a new function symcomp() which uses an extended
8482regular expression syntax: parenthesized subexpressions may be labeled
8483using the form "\(<labelname>...\)", and the group() method can return
8484sub-expressions by name. Thanks to Tracy Tims for these changes!
8485
8486* Multiple threads are now supported on Solaris 2. Thanks to Sjoerd
8487Mullender!
8488
8489
8490Standard library modules
8491------------------------
8492
8493* The library is now split in several subdirectories: all stuff using
8494stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff
8495is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all
8496test modules are in Lib/test. The default module search path will
8497include all relevant subdirectories by default.
8498
8499* Module os now knows about trying to import dos. It defines
8500functions execl(), execle(), execlp() and execvp().
8501
8502* New module dospath (should be attacked by a DOS hacker though).
8503
8504* All modules defining classes now define __init__() constructors
8505instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE!
8506
8507* Some minor changes and bugfixes module ftplib (mostly Steve
8508Majewski's suggestions); the debug() method is renamed to
8509set_debuglevel().
8510
8511* Some new test modules (not run automatically by testall though):
8512test_audioop, test_md5, test_rgbimg, test_select.
8513
8514* Module string now defines rindex() and rfind() in analogy of index()
8515and find(). It also defines atof() and atol() (and corresponding
8516exceptions) in analogy to atoi().
8517
8518* Added help() functions to modules profile and pdb.
8519
8520* The wdb debugger (now in Lib/stdwin) now shows class or instance
8521variables on a double click. Thanks to Sjoerd Mullender!
8522
8523* The (undocumented) module lambda has gone -- you couldn't import it
8524any more, and it was basically more a demo than a library module...
8525
8526
8527Multimedia extensions
8528---------------------
8529
8530* The optional built-in modules audioop and imageop are now standard
8531parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen
8532for contributing this code!
8533
8534* There's a new operation in audioop: minmax().
8535
8536* There's a new built-in module called rgbimg which supports portable
8537efficient reading of SGI RCG image files. Thanks also to Paul
8538Haeberli for the original code! (Who will contribute a GIF reader?)
8539
8540* The module aifc is gone -- you should now always use aifc, which has
8541received a facelift.
8542
8543* There's a new module sunau., for reading Sun (and NeXT) audio files.
8544
8545* There's a new module audiodev which provides a uniform interface to
8546(SGI Indigo and Sun Sparc) audio hardware.
8547
8548* There's a new module sndhdr which recognizes various sound files by
8549looking in their header and checking for various magic words.
8550
8551
8552Optimizations
8553-------------
8554
8555* Most optimizations below can be configured by compile-time flags.
8556Thanks to Sjoerd Mullender for submitting these optimizations!
8557
8558* Small integers (default -1..99) are shared -- i.e. if two different
8559functions compute the same value it is possible (but not
8560guaranteed!!!) that they return the same *object*. Python programs
8561can detect this but should *never* rely on it.
8562
8563* Empty tuples (which all compare equal) are shared in the same
8564manner.
8565
8566* Tuples of size up to 20 (default) are put in separate free lists
8567when deallocated.
8568
8569* There is a compile-time option to cache a string's hash function,
8570but this appeared to have a negligeable effect, and as it costs 4
8571bytes per string it is disabled by default.
8572
8573
8574Embedding Python
8575----------------
8576
8577* The initialization interface has been simplified somewhat. You now
8578only call "initall()" to initialize the interpreter.
8579
8580* The previously announced renaming of externally visible identifiers
8581has not been carried out. It will happen in a later release. Sorry.
8582
8583
8584Miscellaneous bugs that have been fixed
8585---------------------------------------
8586
8587* All known portability bugs.
8588
8589* Version 0.9.9 dumped core in <listobject>.sort() which has been
8590fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix
8591on the mailing list while I was away!
8592
8593* Core dump on a format string ending in '%', e.g. in the expression
8594'%' % None.
8595
8596* The array module yielded a bogus result for concatenation (a+b would
8597yield a+a).
8598
8599* Some serious memory leaks in strop.split() and strop.splitfields().
8600
8601* Several problems with the nis module.
8602
8603* Subtle problem when copying a class method from another class
8604through assignment (the method could not be called).
8605
8606
8607Remaining bugs
8608--------------
8609
8610* One problem with 64-bit machines remains -- since .pyc files are
8611portable and use only 4 bytes to represent an integer object, 64-bit
8612integer literals are silently truncated when written into a .pyc file.
8613Work-around: use eval('123456789101112').
8614
8615* The freeze script doesn't work any more. A new and more portable
8616one can probably be cooked up using tricks from Extensions/mkext.py.
8617
8618* The dos support hasn't been tested yet. (Really Soon Now we should
8619have a PC with a working C compiler!)
8620
8621
Guido van Rossuma7925f11994-01-26 10:20:16 +00008622===================================
8623==> Release 0.9.9 (29 Jul 1993) <==
8624===================================
8625
8626I *believe* these are the main user-visible changes in this release,
8627but there may be others. SGI users may scan the {src,lib}/ChangeLog
8628files for improvements of some SGI specific modules, e.g. aifc and
8629cl. Developers of extension modules should also read src/ChangeLog.
8630
8631
8632Naming of C symbols used by the Python interpreter
8633--------------------------------------------------
8634
8635* This is the last release using the current naming conventions. New
8636naming conventions are explained in the file misc/NAMING.
8637Summarizing, all externally visible symbols get (at least) a "Py"
8638prefix, and most functions are renamed to the standard form
8639PyModule_FunctionName.
8640
8641* Writers of extensions are urged to start using the new naming
8642conventions. The next release will use the new naming conventions
8643throughout (it will also have a different source directory
8644structure).
8645
8646* As a result of the preliminary work for the great renaming, many
8647functions that were accidentally global have been made static.
8648
8649
8650BETA X11 support
8651----------------
8652
8653* There are now modules interfacing to the X11 Toolkit Intrinsics, the
8654Athena widgets, and the Motif 1.1 widget set. These are not yet
8655documented except through the examples and README file in the demo/x11
8656directory. It is expected that this interface will be replaced by a
8657more powerful and correct one in the future, which may or may not be
8658backward compatible. In other words, this part of the code is at most
8659BETA level software! (Note: the rest of Python is rock solid as ever!)
8660
8661* I understand that the above may be a bit of a disappointment,
8662however my current schedule does not allow me to change this situation
8663before putting the release out of the door. By releasing it
8664undocumented and buggy, at least some of the (working!) demo programs,
8665like itr (my Internet Talk Radio browser) become available to a larger
8666audience.
8667
8668* There are also modules interfacing to SGI's "Glx" widget (a GL
8669window wrapped in a widget) and to NCSA's "HTML" widget (which can
8670format HyperText Markup Language, the document format used by the
8671World Wide Web).
8672
8673* I've experienced some problems when building the X11 support. In
8674particular, the Xm and Xaw widget sets don't go together, and it
8675appears that using X11R5 is better than using X11R4. Also the threads
8676module and its link time options may spoil things. My own strategy is
8677to build two Python binaries: one for use with X11 and one without
8678it, which can contain a richer set of built-in modules. Don't even
8679*think* of loading the X11 modules dynamically...
8680
8681
8682Environmental changes
8683---------------------
8684
8685* Compiled files (*.pyc files) created by this Python version are
8686incompatible with those created by the previous version. Both
8687versions detect this and silently create a correct version, but it
8688means that it is not a good idea to use the same library directory for
8689an old and a new interpreter, since they will start to "fight" over
8690the *.pyc files...
8691
8692* When a stack trace is printed, the exception is printed last instead
8693of first. This means that if the beginning of the stack trace
8694scrolled out of your window you can still see what exception caused
8695it.
8696
8697* Sometimes interrupting a Python operation does not work because it
8698hangs in a blocking system call. You can now kill the interpreter by
8699interrupting it three times. The second time you interrupt it, a
8700message will be printed telling you that the third interrupt will kill
8701the interpreter. The "sys.exitfunc" feature still makes limited
8702clean-up possible in this case.
8703
8704
8705Changes to the command line interface
8706-------------------------------------
8707
8708* The python usage message is now much more informative.
8709
8710* New option -i enters interactive mode after executing a script --
8711useful for debugging.
8712
8713* New option -k raises an exception when an expression statement
8714yields a value other than None.
8715
8716* For each option there is now also a corresponding environment
8717variable.
8718
8719
8720Using Python as an embedded language
8721------------------------------------
8722
8723* The distribution now contains (some) documentation on the use of
8724Python as an "embedded language" in other applications, as well as a
8725simple example. See the file misc/EMBEDDING and the directory embed/.
8726
8727
8728Speed improvements
8729------------------
8730
8731* Function local variables are now generally stored in an array and
8732accessed using an integer indexing operation, instead of through a
8733dictionary lookup. (This compensates the somewhat slower dictionary
8734lookup caused by the generalization of the dictionary module.)
8735
8736
8737Changes to the syntax
8738---------------------
8739
8740* Continuation lines can now *sometimes* be written without a
8741backslash: if the continuation is contained within nesting (), [] or
8742{} brackets the \ may be omitted. There's a much improved
8743python-mode.el in the misc directory which knows about this as well.
8744
8745* You can no longer use an empty set of parentheses to define a class
8746without base classes. That is, you no longer write this:
8747
8748 class Foo(): # syntax error
8749 ...
8750
8751You must write this instead:
8752
8753 class Foo:
8754 ...
8755
8756This was already the preferred syntax in release 0.9.8 but many
8757people seemed not to have picked it up. There's a Python script that
8758fixes old code: demo/scripts/classfix.py.
8759
8760* There's a new reserved word: "access". The syntax and semantics are
8761still subject of of research and debate (as well as undocumented), but
8762the parser knows about the keyword so you must not use it as a
8763variable, function, or attribute name.
8764
8765
8766Changes to the semantics of the language proper
8767-----------------------------------------------
8768
8769* The following compatibility hack is removed: if a function was
8770defined with two or more arguments, and called with a single argument
8771that was a tuple with just as many arguments, the items of this tuple
8772would be used as the arguments. This is no longer supported.
8773
8774
8775Changes to the semantics of classes and instances
8776-------------------------------------------------
8777
8778* Class variables are now also accessible as instance variables for
8779reading (assignment creates an instance variable which overrides the
8780class variable of the same name though).
8781
8782* If a class attribute is a user-defined function, a new kind of
8783object is returned: an "unbound method". This contains a pointer to
8784the class and can only be called with a first argument which is a
8785member of that class (or a derived class).
8786
8787* If a class defines a method __init__(self, arg1, ...) then this
8788method is called when a class instance is created by the classname()
8789construct. Arguments passed to classname() are passed to the
8790__init__() method. The __init__() methods of base classes are not
8791automatically called; the derived __init__() method must call these if
8792necessary (this was done so the derived __init__() method can choose
8793the call order and arguments for the base __init__() methods).
8794
8795* If a class defines a method __del__(self) then this method is called
8796when an instance of the class is about to be destroyed. This makes it
8797possible to implement clean-up of external resources attached to the
8798instance. As with __init__(), the __del__() methods of base classes
8799are not automatically called. If __del__ manages to store a reference
8800to the object somewhere, its destruction is postponed; when the object
8801is again about to be destroyed its __del__() method will be called
8802again.
8803
8804* Classes may define a method __hash__(self) to allow their instances
8805to be used as dictionary keys. This must return a 32-bit integer.
8806
8807
8808Minor improvements
8809------------------
8810
8811* Function and class objects now know their name (the name given in
8812the 'def' or 'class' statement that created them).
8813
8814* Class instances now know their class name.
8815
8816
8817Additions to built-in operations
8818--------------------------------
8819
8820* The % operator with a string left argument implements formatting
8821similar to sprintf() in C. The right argument is either a single
8822value or a tuple of values. All features of Standard C sprintf() are
8823supported except %p.
8824
8825* Dictionaries now support almost any key type, instead of just
8826strings. (The key type must be an immutable type or must be a class
8827instance where the class defines a method __hash__(), in order to
8828avoid losing track of keys whose value may change.)
8829
8830* Built-in methods are now compared properly: when comparing x.meth1
8831and y.meth2, if x is equal to y and the methods are defined by the
8832same function, x.meth1 compares equal to y.meth2.
8833
8834
8835Additions to built-in functions
8836-------------------------------
8837
8838* str(x) returns a string version of its argument. If the argument is
8839a string it is returned unchanged, otherwise it returns `x`.
8840
8841* repr(x) returns the same as `x`. (Some users found it easier to
8842have this as a function.)
8843
8844* round(x) returns the floating point number x rounded to an whole
8845number, represented as a floating point number. round(x, n) returns x
8846rounded to n digits.
8847
8848* hasattr(x, name) returns true when x has an attribute with the given
8849name.
8850
8851* hash(x) returns a hash code (32-bit integer) of an arbitrary
8852immutable object's value.
8853
8854* id(x) returns a unique identifier (32-bit integer) of an arbitrary
8855object.
8856
8857* compile() compiles a string to a Python code object.
8858
8859* exec() and eval() now support execution of code objects.
8860
8861
8862Changes to the documented part of the library (standard modules)
8863----------------------------------------------------------------
8864
8865* os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so
8866the border case '/foo/..' returns '/' instead of ''.
8867
8868* A new function string.find() is added with similar semantics to
8869string.index(); however when it does not find the given substring it
8870returns -1 instead of raising string.index_error.
8871
8872
8873Changes to built-in modules
8874---------------------------
8875
8876* New optional module 'array' implements operations on sequences of
8877integers or floating point numbers of a particular size. This is
8878useful to manipulate large numerical arrays or to read and write
8879binary files consisting of numerical data.
8880
8881* Regular expression objects created by module regex now support a new
8882method named group(), which returns one or more \(...\) groups by number.
8883The number of groups is increased from 10 to 100.
8884
8885* Function compile() in module regex now supports an optional mapping
8886argument; a variable casefold is added to the module which can be used
8887as a standard uppercase to lowercase mapping.
8888
8889* Module time now supports many routines that are defined in the
8890Standard C time interface (<time.h>): gmtime(), localtime(),
8891asctime(), ctime(), mktime(), as well as these variables (taken from
8892System V): timezone, altzone, daylight and tzname. (The corresponding
8893functions in the undocumented module calendar have been removed; the
8894undocumented and unfinished module tzparse is now obsolete and will
8895disappear in a future release.)
8896
8897* Module strop (the fast built-in version of standard module string)
8898now uses C's definition of whitespace instead of fixing it to space,
8899tab and newline; in practice this usually means that vertical tab,
8900form feed and return are now also considered whitespace. It exports
8901the string of characters that are considered whitespace as well as the
8902characters that are considered lowercase or uppercase.
8903
8904* Module sys now defines the variable builtin_module_names, a list of
8905names of modules built into the current interpreter (including not
8906yet imported, but excluding two special modules that always have to be
8907defined -- sys and builtin).
8908
8909* Objects created by module sunaudiodev now also support flush() and
8910close() methods.
8911
8912* Socket objects created by module socket now support an optional
8913flags argument for their methods sendto() and recvfrom().
8914
8915* Module marshal now supports dumping to and loading from strings,
8916through the functions dumps() and loads().
8917
8918* Module stdwin now supports some new functionality. You may have to
8919ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.)
8920
8921
8922Bugs fixed
8923----------
8924
8925* Fixed comparison of negative long integers.
8926
8927* The tokenizer no longer botches input lines longer than BUFSIZ.
8928
8929* Fixed several severe memory leaks in module select.
8930
8931* Fixed memory leaks in modules socket and sv.
8932
8933* Fixed memory leak in divmod() for long integers.
8934
8935* Problems with definition of floatsleep() on Suns fixed.
8936
8937* Many portability bugs fixed (and undoubtedly new ones added :-).
8938
8939
8940Changes to the build procedure
8941------------------------------
8942
8943* The Makefile supports some new targets: "make default" and "make
8944all". Both are by normally equivalent to "make python".
8945
8946* The Makefile no longer uses $> since it's not supported by all
8947versions of Make.
8948
8949* The header files now all contain #ifdef constructs designed to make
8950it safe to include the same header file twice, as well as support for
8951inclusion from C++ programs (automatic extern "C" { ... } added).
8952
8953
8954Freezing Python scripts
8955-----------------------
8956
8957* There is now some support for "freezing" a Python script as a
8958stand-alone executable binary file. See the script
8959demo/scripts/freeze.py. It will require some site-specific tailoring
8960of the script to get this working, but is quite worthwhile if you write
8961Python code for other who may not have built and installed Python.
8962
8963
8964MS-DOS
8965------
8966
8967* A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks,
8968Marcel van der Peijl! This requires fewer compatibility hacks in
8969posixmodule.c. The executable is not yet available but will be soon
8970(check the mailing list).
8971
8972* The default PYTHONPATH has changed.
8973
8974
8975Changes for developers of extension modules
8976-------------------------------------------
8977
8978* Read src/ChangeLog for full details.
8979
8980
8981SGI specific changes
8982--------------------
8983
8984* Read src/ChangeLog for full details.
8985
Guido van Rossumaa253861994-10-06 17:18:57 +00008986
Guido van Rossuma7925f11994-01-26 10:20:16 +00008987==================================
8988==> Release 0.9.8 (9 Jan 1993) <==
8989==================================
8990
8991I claim no completeness here, but I've tried my best to scan the log
8992files throughout my source tree for interesting bits of news. A more
8993complete account of the changes is to be found in the various
8994ChangeLog files. See also "News for release 0.9.7beta" below if you're
8995still using release 0.9.6, and the file HISTORY if you have an even
8996older release.
8997
8998 --Guido
8999
9000
9001Changes to the language proper
9002------------------------------
9003
9004There's only one big change: the conformance checking for function
9005argument lists (of user-defined functions only) is stricter. Earlier,
9006you could get away with the following:
9007
9008 (a) define a function of one argument and call it with any
9009 number of arguments; if the actual argument count wasn't
9010 one, the function would receive a tuple containing the
9011 arguments arguments (an empty tuple if there were none).
9012
9013 (b) define a function of two arguments, and call it with more
9014 than two arguments; if there were more than two arguments,
9015 the second argument would be passed as a tuple containing
9016 the second and further actual arguments.
9017
9018(Note that an argument (formal or actual) that is a tuple is counted as
9019one; these rules don't apply inside such tuples, only at the top level
9020of the argument list.)
9021
9022Case (a) was needed to accommodate variable-length argument lists;
9023there is now an explicit "varargs" feature (precede the last argument
9024with a '*'). Case (b) was needed for compatibility with old class
9025definitions: up to release 0.9.4 a method with more than one argument
9026had to be declared as "def meth(self, (arg1, arg2, ...)): ...".
9027Version 0.9.6 provide better ways to handle both casees, bot provided
9028backward compatibility; version 0.9.8 retracts the compatibility hacks
9029since they also cause confusing behavior if a function is called with
9030the wrong number of arguments.
9031
9032There's a script that helps converting classes that still rely on (b),
9033provided their methods' first argument is called "self":
9034demo/scripts/methfix.py.
9035
9036If this change breaks lots of code you have developed locally, try
9037#defining COMPAT_HACKS in ceval.c.
9038
9039(There's a third compatibility hack, which is the reverse of (a): if a
9040function is defined with two or more arguments, and called with a
9041single argument that is a tuple with just as many arguments, the items
9042of this tuple will be used as the arguments. Although this can (and
9043should!) be done using the built-in function apply() instead, it isn't
9044withdrawn yet.)
9045
9046
9047One minor change: comparing instance methods works like expected, so
9048that if x is an instance of a user-defined class and has a method m,
9049then (x.m==x.m) yields 1.
9050
9051
9052The following was already present in 0.9.7beta, but not explicitly
9053mentioned in the NEWS file: user-defined classes can now define types
9054that behave in almost allrespects like numbers. See
9055demo/classes/Rat.py for a simple example.
9056
9057
9058Changes to the build process
9059----------------------------
9060
9061The Configure.py script and the Makefile has been made somewhat more
9062bullet-proof, after reports of (minor) trouble on certain platforms.
9063
9064There is now a script to patch Makefile and config.c to add a new
9065optional built-in module: Addmodule.sh. Read the script before using!
9066
9067Useing Addmodule.sh, all optional modules can now be configured at
9068compile time using Configure.py, so there are no modules left that
9069require dynamic loading.
9070
9071The Makefile has been fixed to make it easier to use with the VPATH
9072feature of some Make versions (e.g. SunOS).
9073
9074
9075Changes affecting portability
9076-----------------------------
9077
9078Several minor portability problems have been solved, e.g. "malloc.h"
9079has been renamed to "mymalloc.h", "strdup.c" is no longer used, and
9080the system now tolerates malloc(0) returning 0.
9081
9082For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now
9083distributed with Python. This solves several minor problems, in
9084particular scripts invoked using #! can now use dynamic loading.
9085
9086
9087Changes to the interpreter interface
9088------------------------------------
9089
9090On popular demand, there's finally a "profile" feature for interactive
9091use of the interpreter. If the environment variable $PYTHONSTARTUP is
9092set to the name of an existing file, Python statements in this file
9093are executed when the interpreter is started in interactive mode.
9094
9095There is a new clean-up mechanism, complementing try...finally: if you
9096assign a function object to sys.exitfunc, it will be called when
9097Python exits or receives a SIGTERM or SIGHUP signal.
9098
9099The interpreter is now generally assumed to live in
9100/usr/local/bin/python (as opposed to /usr/local/python). The script
9101demo/scripts/fixps.py will update old scripts in place (you can easily
9102modify it to do other similar changes).
9103
9104Most I/O that uses sys.stdin/stdout/stderr will now use any object
9105assigned to those names as long as the object supports readline() or
9106write() methods.
9107
9108The parser stack has been increased to 500 to accommodate more
9109complicated expressions (7 levels used to be the practical maximum,
9110it's now about 38).
9111
9112The limit on the size of the *run-time* stack has completely been
9113removed -- this means that tuple or list displays can contain any
9114number of elements (formerly more than 50 would crash the
9115interpreter).
9116
9117
9118Changes to existing built-in functions and methods
9119--------------------------------------------------
9120
9121The built-in functions int(), long(), float(), oct() and hex() now
9122also apply to class instalces that define corresponding methods
9123(__int__ etc.).
9124
9125
9126New built-in functions
9127----------------------
9128
9129The new functions str() and repr() convert any object to a string.
9130The function repr(x) is in all respects equivalent to `x` -- some
9131people prefer a function for this. The function str(x) does the same
9132except if x is already a string -- then it returns x unchanged
9133(repr(x) adds quotes and escapes "funny" characters as octal escapes).
9134
9135The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y.
9136
9137
9138Changes to general built-in modules
9139-----------------------------------
9140
9141The time module's functions are more general: time() returns a
9142floating point number and sleep() accepts one. Their accuracies
9143depends on the precision of the system clock. Millisleep is no longer
9144needed (although it still exists for now), but millitimer is still
9145needed since on some systems wall clock time is only available with
9146seconds precision, while a source of more precise time exists that
9147isn't synchronized with the wall clock. (On UNIX systems that support
9148the BSD gettimeofday() function, time.time() is as time.millitimer().)
9149
9150The string representation of a file object now includes an address:
9151'<file 'filename', mode 'r' at #######>' where ###### is a hex number
9152(the object's address) to make it unique.
9153
9154New functions added to posix: nice(), setpgrp(), and if your system
9155supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp().
9156
9157Improvements to the socket module: socket objects have new methods
9158getpeername() and getsockname(), and the {get,set}sockopt methods can
9159now get/set any kind of option using strings built with the new struct
9160module. And there's a new function fromfd() which creates a socket
9161object given a file descriptor (useful for servers started by inetd,
9162which have a socket connected to stdin and stdout).
9163
9164
9165Changes to SGI-specific built-in modules
9166----------------------------------------
9167
9168The FORMS library interface (fl) now requires FORMS 2.1a. Some new
9169functions have been added and some bugs have been fixed.
9170
9171Additions to al (audio library interface): added getname(),
9172getdefault() and getminmax().
9173
9174The gl modules doesn't call "foreground()" when initialized (this
9175caused some problems) like it dit in 0.9.7beta (but not before).
9176There's a new gl function 'gversion() which returns a version string.
9177
9178The interface to sv (Indigo video interface) has totally changed.
9179(Sorry, still no documentation, but see the examples in
9180demo/sgi/{sv,video}.)
9181
9182
9183Changes to standard library modules
9184-----------------------------------
9185
9186Most functions in module string are now much faster: they're actually
9187implemented in C. The module containing the C versions is called
9188"strop" but you should still import "string" since strop doesn't
9189provide all the interfaces defined in string (and strop may be renamed
9190to string when it is complete in a future release).
9191
9192string.index() now accepts an optional third argument giving an index
9193where to start searching in the first argument, so you can find second
9194and further occurrences (this is similar to the regular expression
9195functions in regex).
9196
9197The definition of what string.splitfields(anything, '') should return
9198is changed for the last time: it returns a singleton list containing
9199its whole first argument unchanged. This is compatible with
9200regsub.split() which also ignores empty delimiter matches.
9201
9202posixpath, macpath: added dirname() and normpath() (and basename() to
9203macpath).
9204
9205The mainloop module (for use with stdwin) can now demultiplex input
9206from other sources, as long as they can be polled with select().
9207
9208
9209New built-in modules
9210--------------------
9211
9212Module struct defines functions to pack/unpack values to/from strings
9213representing binary values in native byte order.
9214
9215Module strop implements C versions of many functions from string (see
9216above).
9217
9218Optional module fcntl defines interfaces to fcntl() and ioctl() --
9219UNIX only. (Not yet properly documented -- see however src/fcntl.doc.)
9220
9221Optional module mpz defines an interface to an altaernative long
9222integer implementation, the GNU MPZ library.
9223
9224Optional module md5 uses the GNU MPZ library to calculate MD5
9225signatures of strings.
9226
9227There are also optional new modules specific to SGI machines: imageop
9228defines some simple operations to images represented as strings; sv
9229interfaces to the Indigo video board; cl interfaces to the (yet
9230unreleased) compression library.
9231
9232
9233New standard library modules
9234----------------------------
9235
9236(Unfortunately the following modules are not all documented; read the
9237sources to find out more about them!)
9238
9239autotest: run testall without showing any output unless it differs
9240from the expected output
9241
9242bisect: use bisection to insert or find an item in a sorted list
9243
9244colorsys: defines conversions between various color systems (e.g. RGB
9245<-> YUV)
9246
9247nntplib: a client interface to NNTP servers
9248
9249pipes: utility to construct pipeline from templates, e.g. for
9250conversion from one file format to another using several utilities.
9251
9252regsub: contains three functions that are more or less compatible with
9253awk functions of the same name: sub() and gsub() do string
9254substitution, split() splits a string using a regular expression to
9255define how separators are define.
9256
9257test_types: test operations on the built-in types of Python
9258
9259toaiff: convert various audio file formats to AIFF format
9260
9261tzparse: parse the TZ environment parameter (this may be less general
9262than it could be, let me know if you fix it).
9263
9264(Note that the obsolete module "path" no longer exists.)
9265
9266
9267New SGI-specific library modules
9268--------------------------------
9269
9270CL: constants for use with the built-in compression library interface (cl)
9271
9272Queue: a multi-producer, multi-consumer queue class implemented for
9273use with the built-in thread module
9274
9275SOCKET: constants for use with built-in module socket, e.g. to set/get
9276socket options. This is SGI-specific because the constants to be
9277passed are system-dependent. You can generate a version for your own
9278system by running the script demo/scripts/h2py.py with
9279/usr/include/sys/socket.h as input.
9280
9281cddb: interface to the database used the the CD player
9282
9283torgb: convert various image file types to rgb format (requires pbmplus)
9284
9285
9286New demos
9287---------
9288
9289There's an experimental interface to define Sun RPC clients and
9290servers in demo/rpc.
9291
9292There's a collection of interfaces to WWW, WAIS and Gopher (both
9293Python classes and program providing a user interface) in demo/www.
9294This includes a program texi2html.py which converts texinfo files to
9295HTML files (the format used hy WWW).
9296
9297The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse.
9298
9299For SGI systems, there's a whole collection of programs and classes
9300that make use of the Indigo video board in demo/sgi/{sv,video}. This
9301represents a significant amount of work that we're giving away!
9302
9303There are demos "rsa" and "md5test" that exercise the mpz and md5
9304modules, respectively. The rsa demo is a complete implementation of
9305the RSA public-key cryptosystem!
9306
9307A bunch of games and examples submitted by Stoffel Erasmus have been
9308included in demo/stoffel.
9309
9310There are miscellaneous new files in some existing demo
9311subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py,
9312sgi/al/cmpaf.py, sockets/{mcast,gopher}.py.
9313
9314There are also many minor changes to existing files, but I'm too lazy
9315to run a diff and note the differences -- you can do this yourself if
9316you save the old distribution's demos. One highlight: the
9317stdwin/python.py demo is much improved!
9318
9319
9320Changes to the documentation
9321----------------------------
9322
9323The LaTeX source for the library uses different macros to enable it to
9324be converted to texinfo, and from there to INFO or HTML format so it
9325can be browsed as a hypertext. The net result is that you can now
9326read the Python library documentation in Emacs info mode!
9327
9328
9329Changes to the source code that affect C extension writers
9330----------------------------------------------------------
9331
9332The function strdup() no longer exists (it was used only in one places
9333and is somewhat of a a portability problem sice some systems have the
9334same function in their C library.
9335
9336The functions NEW() and RENEW() allocate one spare byte to guard
9337against a NULL return from malloc(0) being taken for an error, but
9338this should not be relied upon.
9339
9340
9341=========================
9342==> Release 0.9.7beta <==
9343=========================
9344
9345
9346Changes to the language proper
9347------------------------------
9348
9349User-defined classes can now implement operations invoked through
9350special syntax, such as x[i] or `x` by defining methods named
9351__getitem__(self, i) or __repr__(self), etc.
9352
9353
9354Changes to the build process
9355----------------------------
9356
9357Instead of extensive manual editing of the Makefile to select
9358compile-time options, you can now run a Configure.py script.
9359The Makefile as distributed builds a minimal interpreter sufficient to
9360run Configure.py. See also misc/BUILD
9361
9362The Makefile now includes more "utility" targets, e.g. install and
9363tags/TAGS
9364
9365Using the provided strtod.c and strtol.c are now separate options, as
9366on the Sun the provided strtod.c dumps core :-(
9367
9368The regex module is now an option chosen by the Makefile, since some
9369(old) C compilers choke on regexpr.c
9370
9371
9372Changes affecting portability
9373-----------------------------
9374
9375You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin
9376interface
9377
9378Dynamic loading is now supported for Sun (and other non-COFF systems)
9379throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's
9380DL is out, 1.4)
9381
9382The system-dependent code for the use of the select() system call is
9383moved to one file: myselect.h
9384
9385Thanks to Jaap Vermeulen, the code should now port cleanly to the
9386SEQUENT
9387
9388
9389Changes to the interpreter interface
9390------------------------------------
9391
9392The interpretation of $PYTHONPATH in the environment is different: it
9393is inserted in front of the default path instead of overriding it
9394
9395
9396Changes to existing built-in functions and methods
9397--------------------------------------------------
9398
9399List objects now support an optional argument to their sort() method,
9400which is a comparison function similar to qsort(3) in C
9401
9402File objects now have a method fileno(), used by the new select module
9403(see below)
9404
9405
9406New built-in function
9407---------------------
9408
9409coerce(x, y): take two numbers and return a tuple containing them
9410both converted to a common type
9411
9412
9413Changes to built-in modules
9414---------------------------
9415
9416sys: fixed core dumps in settrace() and setprofile()
9417
9418socket: added socket methods setsockopt() and getsockopt(); and
9419fileno(), used by the new select module (see below)
9420
9421stdwin: added fileno() == connectionnumber(), in support of new module
9422select (see below)
9423
9424posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function.
9425
9426gl: added qgetfd()
9427
9428fl: added several new functions, fixed several obscure bugs, adapted
9429to FORMS 2.1
9430
9431
9432Changes to standard modules
9433---------------------------
9434
9435posixpath: changed implementation of ismount()
9436
9437string: atoi() no longer mistakes leading zero for octal number
9438
9439...
9440
9441
9442New built-in modules
9443--------------------
9444
9445Modules marked "dynamic only" are not configured at compile time but
9446can be loaded dynamically. You need to turn on the DL or DLD option in
9447the Makefile for support dynamic loading of modules (this requires
9448external code).
9449
9450select: interfaces to the BSD select() system call
9451
9452dbm: interfaces to the (new) dbm library (dynamic only)
9453
9454nis: interfaces to some NIS functions (aka yellow pages)
9455
9456thread: limited form of multiple threads (sgi only)
9457
9458audioop: operations useful for audio programs, e.g. u-LAW and ADPCM
9459coding (dynamic only)
9460
9461cd: interface to Indigo SCSI CDROM player audio library (sgi only)
9462
9463jpeg: read files in JPEG format (dynamic only, sgi only; needs
9464external code)
9465
9466imgfile: read SGI image files (dynamic only, sgi only)
9467
9468sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only)
9469
9470sv: interface to Indigo video library (sgi only)
9471
9472pc: a minimal set of MS-DOS interfaces (MS-DOS only)
9473
9474rotor: encryption, by Lance Ellinghouse (dynamic only)
9475
9476
9477New standard modules
9478--------------------
9479
9480Not all these modules are documented. Read the source:
9481lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains
9482additional documentation.
9483
9484imghdr: recognizes image file headers
9485
9486sndhdr: recognizes sound file headers
9487
9488profile: print run-time statistics of Python code
9489
9490readcd, cdplayer: companion modules for built-in module cd (sgi only)
9491
9492emacs: interface to Emacs using py-connect.el (see below).
9493
9494SOCKET: symbolic constant definitions for socket options
9495
9496SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only)
9497
9498SV: symbolic constat definitions for sv (sgi only)
9499
9500CD: symbolic constat definitions for cd (sgi only)
9501
9502
9503New demos
9504---------
9505
9506scripts/pp.py: execute Python as a filter with a Perl-like command
9507line interface
9508
9509classes/: examples using the new class features
9510
9511threads/: examples using the new thread module
9512
9513sgi/cd/: examples using the new cd module
9514
9515
9516Changes to the documentation
9517----------------------------
9518
9519The last-minute syntax changes of release 0.9.6 are now reflected
9520everywhere in the manuals
9521
9522The reference manual has a new section (3.2) on implementing new kinds
9523of numbers, sequences or mappings with user classes
9524
9525Classes are now treated extensively in the tutorial (chapter 9)
9526
9527Slightly restructured the system-dependent chapters of the library
9528manual
9529
9530The file misc/EXTENDING incorporates documentation for mkvalue() and
9531a new section on error handling
9532
9533The files misc/CLASSES and misc/ERRORS are no longer necessary
9534
9535The doc/Makefile now creates PostScript files automatically
9536
9537
9538Miscellaneous changes
9539---------------------
9540
9541Incorporated Tim Peters' changes to python-mode.el, it's now version
95421.06
9543
9544A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python
9545program running in an Emacs buffer execute Emacs lisp code. The
9546necessary Python code is in lib/emacs.py. The Emacs code is
9547misc/py-connect.el (it needs some external Emacs lisp code)
9548
9549
9550Changes to the source code that affect C extension writers
9551----------------------------------------------------------
9552
9553New service function mkvalue() to construct a Python object from C
9554values according to a "format" string a la getargs()
9555
9556Most functions from pythonmain.c moved to new pythonrun.c which is
9557in libpython.a. This should make embedded versions of Python easier
9558
9559ceval.h is split in eval.h (which needs compile.h and only declares
9560eval_code) and ceval.h (which doesn't need compile.hand declares the
9561rest)
9562
9563ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to
9564improve the parallellism of multi-threaded programs by letting other
9565Python code run when a blocking system call or something similar is
9566made)
9567
9568In structmember.[ch], new member types BYTE, CHAR and unsigned
9569variants have been added
9570
9571New file xxmodule.c is a template for new extension modules.
9572
Guido van Rossumaa253861994-10-06 17:18:57 +00009573
Guido van Rossuma7925f11994-01-26 10:20:16 +00009574==================================
Guido van Rossumf2eac992000-09-04 17:24:24 +00009575==> Release 0.9.6 (6 Apr 1992) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +00009576==================================
9577
9578Misc news in 0.9.6:
9579- Restructured the misc subdirectory
9580- Reference manual completed, library manual much extended (with indexes!)
9581- the GNU Readline library is now distributed standard with Python
9582- the script "../demo/scripts/classfix.py" fixes Python modules using old
9583 class syntax
9584- Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!)
9585- Because of the GNU copyleft business I am not using the GNU regular
9586 expression implementation but a free re-implementation by Tatu Ylonen
9587 that recently appeared in comp.sources.misc (Bravo, Tatu!)
9588
9589New features in 0.9.6:
9590- stricter try stmt syntax: cannot mix except and finally clauses on 1 try
9591- New module 'os' supplants modules 'mac' and 'posix' for most cases;
9592 module 'path' is replaced by 'os.path'
9593- os.path.split() return value differs from that of old path.split()
9594- sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception
9595 currently being handled
9596- sys.last_type, sys.last_value, sys.last_traceback remember last unhandled
9597 exception
9598- New function string.expandtabs() expands tabs in a string
9599- Added times() interface to posix (user & sys time of process & children)
9600- Added uname() interface to posix (returns OS type, hostname, etc.)
9601- New built-in function execfile() is like exec() but from a file
9602- Functions exec() and eval() are less picky about whitespace/newlines
9603- New built-in functions getattr() and setattr() access arbitrary attributes
9604- More generic argument handling in built-in functions (see "./EXTENDING")
9605- Dynamic loading of modules written in C or C++ (see "./DYNLOAD")
9606- Division and modulo for long and plain integers with negative operands
9607 have changed; a/b is now floor(float(a)/float(b)) and a%b is defined
9608 as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as
9609 (a/b, a%b) for integers. For floats, % is also changed, but of course
9610 / is unchanged, and divmod(x,y) does not yield (x/y, x%y)...
9611- A function with explicit variable-length argument list can be declared
9612 like this: def f(*args): ...; or even like this: def f(a, b, *rest): ...
9613- Code tracing and profiling features have been added, and two source
9614 code debuggers are provided in the library (pdb.py, tty-oriented,
9615 and wdb, window-oriented); you can now step through Python programs!
9616 See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc"
9617- '==' is now the only equality operator; "../demo/scripts/eqfix.py" is
9618 a script that fixes old Python modules
9619- Plain integer right shift now uses sign extension
9620- Long integer shift/mask operations now simulate 2's complement
9621 to give more useful results for negative operands
9622- Changed/added range checks for long/plain integer shifts
9623- Options found after "-c command" are now passed to the command in sys.argv
9624 (note subtle incompatiblity with "python -c command -- -options"!)
9625- Module stdwin is better protected against touching objects after they've
9626 been closed; menus can now also be closed explicitly
9627- Stdwin now uses its own exception (stdwin.error)
9628
9629New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992):
9630- dictionary objects can now be compared properly; e.g., {}=={} is true
9631- new exception SystemExit causes termination if not caught;
9632 it is raised by sys.exit() so that 'finally' clauses can clean up,
9633 and it may even be caught. It does work interactively!
9634- new module "regex" implements GNU Emacs style regular expressions;
9635 module "regexp" is rewritten in Python for backward compatibility
9636- formal parameter lists may contain trailing commas
9637
9638Bugs fixed in 0.9.6:
9639- assigning to or deleting a list item with a negative index dumped core
9640- divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L)
9641
9642Bugs fixed in 0.9.5:
9643- masking operations involving negative long integers gave wrong results
9644
9645
9646===================================
Guido van Rossumf2eac992000-09-04 17:24:24 +00009647==> Release 0.9.4 (24 Dec 1991) <==
Guido van Rossuma7925f11994-01-26 10:20:16 +00009648===================================
9649
9650- new function argument handling (see below)
9651- built-in apply(func, args) means func(args[0], args[1], ...)
9652- new, more refined exceptions
9653- new exception string values (NameError = 'NameError' etc.)
9654- better checking for math exceptions
9655- for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i]
9656- fixed list assignment bug: "a[1:1] = a" now works correctly
9657- new class syntax, without extraneous parentheses
9658- new 'global' statement to assign global variables from within a function
9659
9660
9661New class syntax
9662----------------
9663
9664You can now declare a base class as follows:
9665
9666 class B: # Was: class B():
9667 def some_method(self): ...
9668 ...
9669
9670and a derived class thusly:
9671
9672 class D(B): # Was: class D() = B():
9673 def another_method(self, arg): ...
9674
9675Multiple inheritance looks like this:
9676
9677 class M(B, D): # Was: class M() = B(), D():
9678 def this_or_that_method(self, arg): ...
9679
9680The old syntax is still accepted by Python 0.9.4, but will disappear
9681in Python 1.0 (to be posted to comp.sources).
9682
9683
9684New 'global' statement
9685----------------------
9686
9687Every now and then you have a global variable in a module that you
9688want to change from within a function in that module -- say, a count
9689of calls to a function, or an option flag, etc. Until now this was
9690not directly possible. While several kludges are known that
9691circumvent the problem, and often the need for a global variable can
9692be avoided by rewriting the module as a class, this does not always
9693lead to clearer code.
9694
9695The 'global' statement solves this dilemma. Its occurrence in a
9696function body means that, for the duration of that function, the
9697names listed there refer to global variables. For instance:
9698
9699 total = 0.0
9700 count = 0
9701
9702 def add_to_total(amount):
9703 global total, count
9704 total = total + amount
9705 count = count + 1
9706
9707'global' must be repeated in each function where it is needed. The
9708names listed in a 'global' statement must not be used in the function
9709before the statement is reached.
9710
9711Remember that you don't need to use 'global' if you only want to *use*
9712a global variable in a function; nor do you need ot for assignments to
9713parts of global variables (e.g., list or dictionary items or
9714attributes of class instances). This has not changed; in fact
9715assignment to part of a global variable was the standard workaround.
9716
9717
9718New exceptions
9719--------------
9720
9721Several new exceptions have been defined, to distinguish more clearly
9722between different types of errors.
9723
9724name meaning was
9725
9726AttributeError reference to non-existing attribute NameError
9727IOError unexpected I/O error RuntimeError
9728ImportError import of non-existing module or name NameError
9729IndexError invalid string, tuple or list index RuntimeError
9730KeyError key not in dictionary RuntimeError
9731OverflowError numeric overflow RuntimeError
9732SyntaxError invalid syntax RuntimeError
9733ValueError invalid argument value RuntimeError
9734ZeroDivisionError division by zero RuntimeError
9735
9736The string value of each exception is now its name -- this makes it
9737easier to experimentally find out which operations raise which
9738exceptions; e.g.:
9739
9740 >>> KeyboardInterrupt
9741 'KeyboardInterrupt'
9742 >>>
9743
9744
9745New argument passing semantics
9746------------------------------
9747
9748Off-line discussions with Steve Majewski and Daniel LaLiberte have
9749convinced me that Python's parameter mechanism could be changed in a
9750way that made both of them happy (I hope), kept me happy, fixed a
9751number of outstanding problems, and, given some backward compatibility
9752provisions, would only break a very small amount of existing code --
9753probably all mine anyway. In fact I suspect that most Python users
9754will hardly notice the difference. And yet it has cost me at least
9755one sleepless night to decide to make the change...
9756
9757Philosophically, the change is quite radical (to me, anyway): a
9758function is no longer called with either zero or one argument, which
9759is a tuple if there appear to be more arguments. Every function now
9760has an argument list containing 0, 1 or more arguments. This list is
9761always implemented as a tuple, and it is a (run-time) error if a
9762function is called with a different number of arguments than expected.
9763
9764What's the difference? you may ask. The answer is, very little unless
9765you want to write variadic functions -- functions that may be called
9766with a variable number of arguments. Formerly, you could write a
9767function that accepted one or more arguments with little trouble, but
9768writing a function that could be called with either 0 or 1 argument
9769(or more) was next to impossible. This is now a piece of cake: you
9770can simply declare an argument that receives the entire argument
9771tuple, and check its length -- it will be of size 0 if there are no
9772arguments.
9773
9774Another anomaly of the old system was the way multi-argument methods
9775(in classes) had to be declared, e.g.:
9776
9777 class Point():
9778 def init(self, (x, y, color)): ...
9779 def setcolor(self, color): ...
9780 dev moveto(self, (x, y)): ...
9781 def draw(self): ...
9782
9783Using the new scheme there is no need to enclose the method arguments
9784in an extra set of parentheses, so the above class could become:
9785
9786 class Point:
9787 def init(self, x, y, color): ...
9788 def setcolor(self, color): ...
9789 dev moveto(self, x, y): ...
9790 def draw(self): ...
9791
9792That is, the equivalence rule between methods and functions has
9793changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y)
9794while formerly it was equivalent to Point.moveto(p,(x,y)).
9795
9796A special backward compatibility rule makes that the old version also
9797still works: whenever a function with exactly two arguments (at the top
9798level) is called with more than two arguments, the second and further
9799arguments are packed into a tuple and passed as the second argument.
9800This rule is invoked independently of whether the function is actually a
9801method, so there is a slight chance that some erroneous calls of
9802functions expecting two arguments with more than that number of
9803arguments go undetected at first -- when the function tries to use the
9804second argument it may find it is a tuple instead of what was expected.
9805Note that this rule will be removed from future versions of the
9806language; it is a backward compatibility provision *only*.
9807
9808Two other rules and a new built-in function handle conversion between
9809tuples and argument lists:
9810
9811Rule (a): when a function with more than one argument is called with a
9812single argument that is a tuple of the right size, the tuple's items
9813are used as arguments.
9814
9815Rule (b): when a function with exactly one argument receives no
9816arguments or more than one, that one argument will receive a tuple
9817containing the arguments (the tuple will be empty if there were no
9818arguments).
9819
9820
9821A new built-in function, apply(), was added to support functions that
9822need to call other functions with a constructed argument list. The call
9823
9824 apply(function, tuple)
9825
9826is equivalent to
9827
9828 function(tuple[0], tuple[1], ..., tuple[len(tuple)-1])
9829
9830
9831While no new argument syntax was added in this phase, it would now be
9832quite sensible to add explicit syntax to Python for default argument
9833values (as in C++ or Modula-3), or a "rest" argument to receive the
9834remaining arguments of a variable-length argument list.
9835
9836
9837========================================================
9838==> Release 0.9.3 (never made available outside CWI) <==
9839========================================================
9840
9841- string sys.version shows current version (also printed on interactive entry)
9842- more detailed exceptions, e.g., IOError, ZeroDivisionError, etc.
9843- 'global' statement to declare module-global variables assigned in functions.
9844- new class declaration syntax: class C(Base1, Base2, ...): suite
9845 (the old syntax is still accepted -- be sure to convert your classes now!)
9846- C shifting and masking operators: << >> ~ & ^ | (for ints and longs).
9847- C comparison operators: == != (the old = and <> remain valid).
9848- floating point numbers may now start with a period (e.g., .14).
9849- definition of integer division tightened (always truncates towards zero).
9850- new builtins hex(x), oct(x) return hex/octal string from (long) integer.
9851- new list method l.count(x) returns the number of occurrences of x in l.
9852- new SGI module: al (Indigo and 4D/35 audio library).
9853- the FORMS interface (modules fl and FL) now uses FORMS 2.0
9854- module gl: added lrect{read,write}, rectzoom and pixmode;
9855 added (non-GL) functions (un)packrect.
9856- new socket method: s.allowbroadcast(flag).
9857- many objects support __dict__, __methods__ or __members__.
9858- dir() lists anything that has __dict__.
9859- class attributes are no longer read-only.
9860- classes support __bases__, instances support __class__ (and __dict__).
9861- divmod() now also works for floats.
9862- fixed obscure bug in eval('1 ').
9863
9864
9865===================================
9866==> Release 0.9.2 (Autumn 1991) <==
9867===================================
9868
9869Highlights
9870----------
9871
9872- tutorial now (almost) complete; library reference reorganized
9873- new syntax: continue statement; semicolons; dictionary constructors;
9874 restrictions on blank lines in source files removed
9875- dramatically improved module load time through precompiled modules
9876- arbitrary precision integers: compute 2 to the power 1000 and more...
9877- arithmetic operators now accept mixed type operands, e.g., 3.14/4
9878- more operations on list: remove, index, reverse; repetition
9879- improved/new file operations: readlines, seek, tell, flush, ...
9880- process management added to the posix module: fork/exec/wait/kill etc.
9881- BSD socket operations (with example servers and clients!)
9882- many new STDWIN features (color, fonts, polygons, ...)
9883- new SGI modules: font manager and FORMS library interface
9884
9885
9886Extended list of changes in 0.9.2
9887---------------------------------
9888
9889Here is a summary of the most important user-visible changes in 0.9.2,
9890in somewhat arbitrary order. Changes in later versions are listed in
9891the "highlights" section above.
9892
9893
98941. Changes to the interpreter proper
9895
9896- Simple statements can now be separated by semicolons.
9897 If you write "if t: s1; s2", both s1 and s2 are executed
9898 conditionally.
9899- The 'continue' statement was added, with semantics as in C.
9900- Dictionary displays are now allowed on input: {key: value, ...}.
9901- Blank lines and lines bearing only a comment no longer need to
9902 be indented properly. (A completely empty line still ends a multi-
9903 line statement interactively.)
9904- Mixed arithmetic is supported, 1 compares equal to 1.0, etc.
9905- Option "-c command" to execute statements from the command line
9906- Compiled versions of modules are cached in ".pyc" files, giving a
9907 dramatic improvement of start-up time
9908- Other, smaller speed improvements, e.g., extracting characters from
9909 strings, looking up single-character keys, and looking up global
9910 variables
9911- Interrupting a print operation raises KeyboardInterrupt instead of
9912 only cancelling the print operation
9913- Fixed various portability problems (it now passes gcc with only
9914 warnings -- more Standard C compatibility will be provided in later
9915 versions)
9916- Source is prepared for porting to MS-DOS
9917- Numeric constants are now checked for overflow (this requires
9918 standard-conforming strtol() and strtod() functions; a correct
9919 strtol() implementation is provided, but the strtod() provided
9920 relies on atof() for everything, including error checking
9921
9922
99232. Changes to the built-in types, functions and modules
9924
9925- New module socket: interface to BSD socket primitives
9926- New modules pwd and grp: access the UNIX password and group databases
9927- (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager
9928- (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library
9929- New numeric type: long integer, for unlimited precision
9930 - integer constants suffixed with 'L' or 'l' are long integers
9931 - new built-in function long(x) converts int or float to long
9932 - int() and float() now also convert from long integers
9933- New built-in function:
9934 - pow(x, y) returns x to the power y
9935- New operation and methods for lists:
9936 - l*n returns a new list consisting of n concatenated copies of l
9937 - l.remove(x) removes the first occurrence of the value x from l
9938 - l.index(x) returns the index of the first occurrence of x in l
9939 - l.reverse() reverses l in place
9940- New operation for tuples:
9941 - t*n returns a tuple consisting of n concatenated copies of t
9942- Improved file handling:
9943 - f.readline() no longer restricts the line length, is faster,
9944 and isn't confused by null bytes; same for raw_input()
9945 - f.read() without arguments reads the entire (rest of the) file
9946 - mixing of print and sys.stdout.write() has different effect
9947- New methods for files:
9948 - f.readlines() returns a list containing the lines of the file,
9949 as read with f.readline()
9950 - f.flush(), f.tell(), f.seek() call their stdio counterparts
9951 - f.isatty() tests for "tty-ness"
9952- New posix functions:
9953 - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait()
9954 - popen() returns a file object connected to a pipe
9955 - utime() replaces utimes() (the latter is not a POSIX name)
9956- New stdwin features, including:
9957 - font handling
9958 - color drawing
9959 - scroll bars made optional
9960 - polygons
9961 - filled and xor shapes
9962 - text editing objects now have a 'settext' method
9963
9964
99653. Changes to the standard library
9966
9967- Name change: the functions path.cat and macpath.cat are now called
9968 path.join and macpath.join
9969- Added new modules: formatter, mutex, persist, sched, mainloop
9970- Added some modules and functionality to the "widget set" (which is
9971 still under development, so please bear with me):
9972 DirList, FormSplit, TextEdit, WindowSched
9973- Fixed module testall to work non-interactively
9974- Module string:
9975 - added functions join() and joinfields()
9976 - fixed center() to work correct and make it "transitive"
9977- Obsolete modules were removed: util, minmax
9978- Some modules were moved to the demo directory
9979
9980
99814. Changes to the demonstration programs
9982
9983- Added new useful scipts: byteyears, eptags, fact, from, lfact,
9984 objgraph, pdeps, pi, primes, ptags, which
9985- Added a bunch of socket demos
9986- Doubled the speed of ptags
9987- Added new stdwin demos: microedit, miniedit
9988- Added a windowing interface to the Python interpreter: python (most
9989 useful on the Mac)
9990- Added a browser for Emacs info files: demo/stdwin/ibrowse
9991 (yes, I plan to put all STDWIN and Python documentation in texinfo
9992 form in the future)
9993
9994
99955. Other changes to the distribution
9996
9997- An Emacs Lisp file "python.el" is provided to facilitate editing
9998 Python programs in GNU Emacs (slightly improved since posted to
9999 gnu.emacs.sources)
10000- Some info on writing an extension in C is provided
10001- Some info on building Python on non-UNIX platforms is provided
10002
10003
10004=====================================
10005==> Release 0.9.1 (February 1991) <==
10006=====================================
10007
10008- Micro changes only
10009- Added file "patchlevel.h"
10010
10011
10012=====================================
10013==> Release 0.9.0 (February 1991) <==
10014=====================================
10015
10016Original posting to alt.sources.