Guido van Rossum | a598c93 | 2000-09-04 16:26:03 +0000 | [diff] [blame] | 1 | Python History |
Guido van Rossum | a7925f1 | 1994-01-26 10:20:16 +0000 | [diff] [blame] | 2 | -------------- |
| 3 | |
Guido van Rossum | 439d1fa | 1998-12-21 21:41:14 +0000 | [diff] [blame] | 4 | This file contains the release messages for previous Python releases. |
| 5 | As you read on you go back to the dark ages of Python's history. |
| 6 | |
| 7 | |
| 8 | ====================================================================== |
| 9 | |
| 10 | |
Anthony Baxter | 24078c5 | 2006-03-20 06:30:41 +0000 | [diff] [blame] | 11 | What's New in Python 2.4 final? |
| 12 | =============================== |
| 13 | |
| 14 | *Release date: 30-NOV-2004* |
| 15 | |
| 16 | Core and builtins |
| 17 | ----------------- |
| 18 | |
| 19 | - Bug 875692: Improve signal handling, especially when using threads, by |
| 20 | forcing an early re-execution of PyEval_EvalFrame() "periodic" code when |
| 21 | things_to_do is not cleared by Py_MakePendingCalls(). |
| 22 | |
| 23 | |
| 24 | What's New in Python 2.4 (release candidate 1) |
| 25 | ============================================== |
| 26 | |
| 27 | *Release date: 18-NOV-2004* |
| 28 | |
| 29 | Core and builtins |
| 30 | ----------------- |
| 31 | |
| 32 | - Bug 1061968: Fixes in 2.4a3 to address thread bug 1010677 reintroduced |
| 33 | the years-old thread shutdown race bug 225673. Numeric history lesson |
| 34 | aside, all bugs in all three reports are fixed now. |
| 35 | |
| 36 | |
| 37 | Library |
| 38 | ------- |
| 39 | |
| 40 | - Bug 1052242: If exceptions are raised by an atexit handler function an |
| 41 | attempt is made to execute the remaining handlers. The last exception |
| 42 | raised is re-raised. |
| 43 | |
| 44 | - ``doctest``'s new support for adding ``pdb.set_trace()`` calls to |
| 45 | doctests was broken in a dramatic but shallow way. Fixed. |
| 46 | |
| 47 | - Bug 1065388: ``calendar``'s ``day_name``, ``day_abbr``, ``month_name``, |
| 48 | and ``month_abbr`` attributes emulate sequences of locale-correct |
| 49 | spellings of month and day names. Because the locale can change at |
| 50 | any time, the correct spelling is recomputed whenever one of these is |
| 51 | indexed. In the worst case, the index may be a slice object, so these |
| 52 | recomputed every day or month name each time they were indexed. This is |
| 53 | much slower than necessary in the usual case, when the index is just an |
| 54 | integer. In that case, only the single spelling needed is recomputed |
| 55 | now; and, when the index is a slice object, only the spellings needed |
| 56 | by the slice are recomputed now. |
| 57 | |
| 58 | - Patch 1061679: Added ``__all__`` to pickletools.py. |
| 59 | |
| 60 | Build |
| 61 | ----- |
| 62 | |
| 63 | - Bug 1034277 / Patch 1035255: Remove compilation of core against CoreServices |
| 64 | and CoreFoundation on OS X. Involved removing PyMac_GetAppletScriptFile() |
| 65 | which has no known users. Thanks Bob Ippolito. |
| 66 | |
| 67 | C API |
| 68 | ----- |
| 69 | |
| 70 | - The PyRange_New() function is deprecated. |
| 71 | |
| 72 | |
| 73 | What's New in Python 2.4 beta 2? |
| 74 | ================================ |
| 75 | |
| 76 | *Release date: 03-NOV-2004* |
| 77 | |
| 78 | License |
| 79 | ------- |
| 80 | |
| 81 | The Python Software Foundation changed the license under which Python |
| 82 | is released, to remove Python version numbers. There were no other |
| 83 | changes to the license. So, for example, wherever the license for |
| 84 | Python 2.3 said "Python 2.3", the new license says "Python". The |
| 85 | intent is to make it possible to refer to the PSF license in a more |
| 86 | durable way. For example, some people say they're confused by that |
| 87 | the Open Source Initiative's entry for the Python Software Foundation |
| 88 | License:: |
| 89 | |
| 90 | http://www.opensource.org/licenses/PythonSoftFoundation.php |
| 91 | |
| 92 | says "Python 2.1.1" all over it, wondering whether it applies only |
| 93 | to Python 2.1.1. |
| 94 | |
| 95 | The official name of the new license is the Python Software Foundation |
| 96 | License Version 2. |
| 97 | |
| 98 | Core and builtins |
| 99 | ----------------- |
| 100 | |
| 101 | - Bug #1055820 Cyclic garbage collection was not protecting against that |
| 102 | calling a live weakref to a piece of cyclic trash could resurrect an |
| 103 | insane mutation of the trash if any Python code ran during gc (via |
| 104 | running a dead object's __del__ method, running another callback on a |
| 105 | weakref to a dead object, or via any Python code run in any other thread |
| 106 | that managed to obtain the GIL while a __del__ or callback was running |
| 107 | in the thread doing gc). The most likely symptom was "impossible" |
| 108 | ``AttributeError`` exceptions, appearing seemingly at random, on weakly |
| 109 | referenced objects. The cure was to clear all weakrefs to unreachable |
| 110 | objects before allowing any callbacks to run. |
| 111 | |
| 112 | - Bug #1054139 _PyString_Resize() now invalidates its cached hash value. |
| 113 | |
| 114 | Extension Modules |
| 115 | ----------------- |
| 116 | |
| 117 | - Bug #1048870: the compiler now generates distinct code objects for |
| 118 | functions with identical bodies. This was producing confusing |
| 119 | traceback messages which pointed to the function where the code |
| 120 | object was first defined rather than the function being executed. |
| 121 | |
| 122 | Library |
| 123 | ------- |
| 124 | |
| 125 | - Patch #1056967 changes the semantics of Template.safe_substitute() so that |
| 126 | no ValueError is raised on an 'invalid' match group. Now the delimiter is |
| 127 | returned. |
| 128 | |
| 129 | - Bug #1052503 pdb.runcall() was not passing along keyword arguments. |
| 130 | |
| 131 | - Bug #902037: XML.sax.saxutils.prepare_input_source() now combines relative |
| 132 | paths with a base path before checking os.path.isfile(). |
| 133 | |
| 134 | - The whichdb module can now be run from the command line. |
| 135 | |
| 136 | - Bug #1045381: time.strptime() can now infer the date using %U or %W (week of |
| 137 | the year) when the day of the week and year are also specified. |
| 138 | |
| 139 | - Bug #1048816: fix bug in Ctrl-K at start of line in curses.textpad.Textbox |
| 140 | |
| 141 | - Bug #1017553: fix bug in tarfile.filemode() |
| 142 | |
| 143 | - Patch #737473: fix bug that old source code is shown in tracebacks even if |
| 144 | the source code is updated and reloaded. |
| 145 | |
| 146 | Build |
| 147 | ----- |
| 148 | |
| 149 | - Patch #1044395: --enable-shared is allowed in FreeBSD also. |
| 150 | |
| 151 | What's New in Python 2.4 beta 1? |
| 152 | ================================ |
| 153 | |
| 154 | *Release date: 15-OCT-2004* |
| 155 | |
| 156 | Core and builtins |
| 157 | ----------------- |
| 158 | |
| 159 | - Patch #975056: Restartable signals were not correctly disabled on |
| 160 | BSD systems. Consistently use PyOS_setsig() instead of signal(). |
| 161 | |
| 162 | - The internal portable implementation of thread-local storage (TLS), used |
| 163 | by the ``PyGILState_Ensure()``/``PyGILState_Release()`` API, was not |
| 164 | thread-correct. This could lead to a variety of problems, up to and |
| 165 | including segfaults. See bug 1041645 for an example. |
| 166 | |
| 167 | - Added a command line option, -m module, which searches sys.path for the |
| 168 | module and then runs it. (Contributed by Nick Coghlan.) |
| 169 | |
| 170 | - The bytecode optimizer now folds tuples of constants into a single |
| 171 | constant. |
| 172 | |
| 173 | - SF bug #513866: Float/long comparison anomaly. Prior to 2.4b1, when |
| 174 | an integer was compared to a float, the integer was coerced to a float. |
| 175 | That could yield spurious overflow errors (if the integer was very |
| 176 | large), and to anomalies such as |
| 177 | ``long(1e200)+1 == 1e200 == long(1e200)-1``. Coercion to float is no |
| 178 | longer performed, and cases like ``long(1e200)-1 < 1e200``, |
| 179 | ``long(1e200)+1 > 1e200`` and ``(1 << 20000) > 1e200`` are computed |
| 180 | correctly now. |
| 181 | |
| 182 | Extension modules |
| 183 | ----------------- |
| 184 | |
| 185 | - ``collections.deque`` objects didn't play quite right with garbage |
| 186 | collection, which could lead to a segfault in a release build, or |
| 187 | an assert failure in a debug build. Also, added overflow checks, |
| 188 | better detection of mutation during iteration, and shielded deque |
| 189 | comparisons from unusual subclass overrides of the __iter__() method. |
| 190 | |
| 191 | Library |
| 192 | ------- |
| 193 | |
| 194 | - Patch 1046644: distutils build_ext grew two new options - --swig for |
| 195 | specifying the swig executable to use, and --swig-opts to specify |
| 196 | options to pass to swig. --swig-opts="-c++" is the new way to spell |
| 197 | --swig-cpp. |
| 198 | |
| 199 | - Patch 983206: distutils now obeys environment variable LDSHARED, if |
| 200 | it is set. |
| 201 | |
| 202 | - Added Peter Astrand's subprocess.py module. See PEP 324 for details. |
| 203 | |
| 204 | - time.strptime() now properly escapes timezones and all other locale-specific |
| 205 | strings for regex-specific symbols. Was breaking under Japanese Windows when |
| 206 | the timezone was specified as "Tokyo (standard time)". |
| 207 | Closes bug #1039270. |
| 208 | |
| 209 | - Updates for the email package: |
| 210 | |
| 211 | + email.Utils.formatdate() grew a 'usegmt' argument for HTTP support. |
| 212 | + All deprecated APIs that in email 2.x issued warnings have been removed: |
| 213 | _encoder argument to the MIMEText constructor, Message.add_payload(), |
| 214 | Utils.dump_address_pair(), Utils.decode(), Utils.encode() |
| 215 | + New deprecations: Generator.__call__(), Message.get_type(), |
| 216 | Message.get_main_type(), Message.get_subtype(), the 'strict' argument to |
| 217 | the Parser constructor. These will be removed in email 3.1. |
| 218 | + Support for Python earlier than 2.3 has been removed (see PEP 291). |
| 219 | + All defect classes have been renamed to end in 'Defect'. |
| 220 | + Some FeedParser fixes; also a MultipartInvariantViolationDefect will be |
| 221 | added to messages that claim to be multipart but really aren't. |
| 222 | + Updates to documentation. |
| 223 | |
| 224 | - re's findall() and finditer() functions now take an optional flags argument |
| 225 | just like the compile(), search(), and match() functions. Also, documented |
| 226 | the previously existing start and stop parameters for the findall() and |
| 227 | finditer() methods of regular expression objects. |
| 228 | |
| 229 | - rfc822 Messages now support iterating over the headers. |
| 230 | |
| 231 | - The (undocumented) tarfile.Tarfile.membernames has been removed; |
| 232 | applications should use the getmember function. |
| 233 | |
| 234 | - httplib now offers symbolic constants for the HTTP status codes. |
| 235 | |
| 236 | - SF bug #1028306: Trying to compare a ``datetime.date`` to a |
| 237 | ``datetime.datetime`` mistakenly compared only the year, month and day. |
| 238 | Now it acts like a mixed-type comparison: ``False`` for ``==``, |
| 239 | ``True`` for ``!=``, and raises ``TypeError`` for other comparison |
| 240 | operators. Because datetime is a subclass of date, comparing only the |
| 241 | base class (date) members can still be done, if that's desired, by |
| 242 | forcing using of the approprate date method; e.g., |
| 243 | ``a_date.__eq__(a_datetime)`` is true if and only if the year, month |
| 244 | and day members of ``a_date`` and ``a_datetime`` are equal. |
| 245 | |
| 246 | - bdist_rpm now supports command line options --force-arch, |
| 247 | {pre,post}-install, {pre,post}-uninstall, and |
| 248 | {prep,build,install,clean,verify}-script. |
| 249 | |
| 250 | - SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support |
| 251 | decoding incomplete input (when the input stream is temporarily exhausted). |
| 252 | ``codecs.StreamReader`` now implements buffering, which enables proper |
| 253 | readline support for the UTF-16 decoders. ``codecs.StreamReader.read()`` |
| 254 | has a new argument ``chars`` which specifies the number of characters to |
| 255 | return. ``codecs.StreamReader.readline()`` and |
| 256 | ``codecs.StreamReader.readlines()`` have a new argument ``keepends``. |
| 257 | Trailing "\n"s will be stripped from the lines if ``keepends`` is false. |
| 258 | |
| 259 | - The documentation for doctest is greatly expanded, and now covers all |
| 260 | the new public features (of which there are many). |
| 261 | |
| 262 | - ``doctest.master`` was put back in, and ``doctest.testmod()`` once again |
| 263 | updates it. This isn't good, because every ``testmod()`` call |
| 264 | contributes to bloating the "hidden" state of ``doctest.master``, but |
| 265 | some old code apparently relies on it. For now, all we can do is |
| 266 | encourage people to stitch doctests together via doctest's unittest |
| 267 | integration features instead. |
| 268 | |
| 269 | - httplib now handles ipv6 address/port pairs. |
| 270 | |
| 271 | - SF bug #1017864: ConfigParser now correctly handles default keys, |
| 272 | processing them with ``ConfigParser.optionxform`` when supplied, |
| 273 | consistent with the handling of config file entries and runtime-set |
| 274 | options. |
| 275 | |
| 276 | - SF bug #997050: Document, test, & check for non-string values in |
| 277 | ConfigParser. Moved the new string-only restriction added in |
| 278 | rev. 1.65 to the SafeConfigParser class, leaving existing |
| 279 | ConfigParser & RawConfigParser behavior alone, and documented the |
| 280 | conditions under which non-string values work. |
| 281 | |
| 282 | Build |
| 283 | ----- |
| 284 | |
| 285 | - Building on darwin now includes /opt/local/include and /opt/local/lib for |
| 286 | building extension modules. This is so as to include software installed as |
| 287 | a DarwinPorts port <http://darwinports.opendarwin.org/> |
| 288 | |
| 289 | - pyport.h now defines a Py_IS_NAN macro. It works as-is when the |
| 290 | platform C computes true for ``x != x`` if and only if X is a NaN. |
| 291 | Other platforms can override the default definition with a platform- |
| 292 | specific spelling in that platform's pyconfig.h. You can also override |
| 293 | pyport.h's default Py_IS_INFINITY definition now. |
| 294 | |
| 295 | C API |
| 296 | ----- |
| 297 | |
| 298 | - SF patch 1044089: New function ``PyEval_ThreadsInitialized()`` returns |
| 299 | non-zero if PyEval_InitThreads() has been called. |
| 300 | |
| 301 | - The undocumented and unused extern int ``_PyThread_Started`` was removed. |
| 302 | |
| 303 | - The C API calls ``PyInterpreterState_New()`` and ``PyThreadState_New()`` |
| 304 | are two of the very few advertised as being safe to call without holding |
| 305 | the GIL. However, this wasn't true in a debug build, as bug 1041645 |
| 306 | demonstrated. In a debug build, Python redirects the ``PyMem`` family |
| 307 | of calls to Python's small-object allocator, to get the benefit of |
| 308 | its extra debugging capabilities. But Python's small-object allocator |
| 309 | isn't threadsafe, relying on the GIL to avoid the expense of doing its |
| 310 | own locking. ``PyInterpreterState_New()`` and ``PyThreadState_New()`` |
| 311 | call the platform ``malloc()`` directly now, regardless of build type. |
| 312 | |
| 313 | - PyLong_AsUnsignedLong[Mask] now support int objects as well. |
| 314 | |
| 315 | - SF patch #998993: ``PyUnicode_DecodeUTF8Stateful`` and |
| 316 | ``PyUnicode_DecodeUTF16Stateful`` have been added, which implement stateful |
| 317 | decoding. |
| 318 | |
| 319 | Tests |
| 320 | ----- |
| 321 | |
| 322 | - test__locale ported to unittest |
| 323 | |
| 324 | Mac |
| 325 | --- |
| 326 | |
| 327 | - ``plistlib`` now supports non-dict root objects. There is also a new |
| 328 | interface for reading and writing plist files: ``readPlist(pathOrFile)`` |
| 329 | and ``writePlist(rootObject, pathOrFile)`` |
| 330 | |
| 331 | Tools/Demos |
| 332 | ----------- |
| 333 | |
| 334 | - The text file comparison scripts ``ndiff.py`` and ``diff.py`` now |
| 335 | read the input files in universal-newline mode. This spares them |
| 336 | from consuming a great deal of time to deduce the useless result that, |
| 337 | e.g., a file with Windows line ends and a file with Linux line ends |
| 338 | have no lines in common. |
| 339 | |
| 340 | |
| 341 | What's New in Python 2.4 alpha 3? |
| 342 | ================================= |
| 343 | |
| 344 | *Release date: 02-SEP-2004* |
| 345 | |
| 346 | Core and builtins |
| 347 | ----------------- |
| 348 | |
| 349 | - SF patch #1007189: ``from ... import ...`` statements now allow the name |
| 350 | list to be surrounded by parentheses. |
| 351 | |
| 352 | - Some speedups for long arithmetic, thanks to Trevor Perrin. Gradeschool |
| 353 | multiplication was sped a little by optimizing the C code. Gradeschool |
| 354 | squaring was sped by about a factor of 2, by exploiting that about half |
| 355 | the digit products are duplicates in a square. Because exponentiation |
| 356 | uses squaring often, this also speeds long power. For example, the time |
| 357 | to compute 17**1000000 dropped from about 14 seconds to 9 on my box due |
| 358 | to this much. The cutoff for Karatsuba multiplication was raised, |
| 359 | since gradeschool multiplication got quicker, and the cutoff was |
| 360 | aggressively small regardless. The exponentiation algorithm was switched |
| 361 | from right-to-left to left-to-right, which is more efficient for small |
| 362 | bases. In addition, if the exponent is large, the algorithm now does |
| 363 | 5 bits (instead of 1 bit) at a time. That cut the time to compute |
| 364 | 17**1000000 on my box in half again, down to about 4.5 seconds. |
| 365 | |
| 366 | - OverflowWarning is no longer generated. PEP 237 scheduled this to |
| 367 | occur in Python 2.3, but since OverflowWarning was disabled by default, |
| 368 | nobody realized it was still being generated. On the chance that user |
| 369 | code is still using them, the Python builtin OverflowWarning, and |
| 370 | corresponding C API PyExc_OverflowWarning, will exist until Python 2.5. |
| 371 | |
| 372 | - Py_InitializeEx has been added. |
| 373 | |
| 374 | - Fix the order of application of decorators. The proper order is bottom-up; |
| 375 | the first decorator listed is the last one called. |
| 376 | |
| 377 | - SF patch #1005778. Fix a seg fault if the list size changed while |
| 378 | calling list.index(). This could happen if a rich comparison function |
| 379 | modified the list. |
| 380 | |
| 381 | - The ``func_name`` (a.k.a. ``__name__``) attribute of user-defined |
| 382 | functions is now writable. |
| 383 | |
| 384 | - code_new (a.k.a new.code()) now checks its arguments sufficiently |
| 385 | carefully that passing them on to PyCode_New() won't trigger calls |
| 386 | to Py_FatalError() or PyErr_BadInternalCall(). It is still the case |
| 387 | that the returned code object might be entirely insane. |
| 388 | |
| 389 | - Subclasses of string can no longer be interned. The semantics of |
| 390 | interning were not clear here -- a subclass could be mutable, for |
| 391 | example -- and had bugs. Explicitly interning a subclass of string |
| 392 | via intern() will raise a TypeError. Internal operations that attempt |
| 393 | to intern a string subclass will have no effect. |
| 394 | |
| 395 | - Bug 1003935: xrange() could report bogus OverflowErrors. Documented |
| 396 | what xrange() intends, and repaired tests accordingly. |
| 397 | |
| 398 | Extension modules |
| 399 | ----------------- |
| 400 | |
| 401 | - difflib now supports HTML side-by-side diff. |
| 402 | |
| 403 | - os.urandom has been added for systems that support sources of random |
| 404 | data. |
| 405 | |
| 406 | - Patch 1012740: truncate() on a writeable cStringIO now resets the |
| 407 | position to the end of the stream. This is consistent with the original |
| 408 | StringIO module and avoids inadvertently resurrecting data that was |
| 409 | supposed to have been truncated away. |
| 410 | |
| 411 | - Added socket.socketpair(). |
| 412 | |
| 413 | - Added CurrentByteIndex, CurrentColumnNumber, CurrentLineNumber |
| 414 | members to xml.parsers.expat.XMLParser object. |
| 415 | |
| 416 | - The mpz, rotor, and xreadlines modules, all deprecated in earlier |
| 417 | versions of Python, have now been removed. |
| 418 | |
| 419 | Library |
| 420 | ------- |
| 421 | |
| 422 | - Patch #934356: if a module defines __all__, believe that rather than using |
| 423 | heuristics for filtering out imported names. |
| 424 | |
| 425 | - Patch #941486: added os.path.lexists(), which returns True for broken |
| 426 | symlinks, unlike os.path.exists(). |
| 427 | |
| 428 | - the random module now uses os.urandom() for seeding if it is available. |
| 429 | Added a new generator based on os.urandom(). |
| 430 | |
| 431 | - difflib and diff.py can now generate HTML. |
| 432 | |
| 433 | - bdist_rpm now includes version and release in the BuildRoot, and |
| 434 | replaces - by ``_`` in version and release. |
| 435 | |
| 436 | - distutils build/build_scripts now has an -e option to specify the |
| 437 | path to the Python interpreter for installed scripts. |
| 438 | |
| 439 | - PEP 292 classes Template and SafeTemplate are added to the string module. |
| 440 | |
| 441 | - tarfile now generates GNU tar files by default. |
| 442 | |
| 443 | - HTTPResponse has now a getheaders method. |
| 444 | |
| 445 | - Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon |
| 446 | Percivall. |
| 447 | |
| 448 | - logging.handlers.SMTPHandler.date_time has been removed; |
| 449 | the class now uses email.Utils.formatdate to generate the time stamp. |
| 450 | |
| 451 | - A new function tkFont.nametofont was added to return an existing |
| 452 | font. The Font class constructor now has an additional exists argument |
| 453 | which, if True, requests to return/configure an existing font, rather |
| 454 | than creating a new one. |
| 455 | |
| 456 | - Updated the decimal package's min() and max() methods to match the |
| 457 | latest revision of the General Decimal Arithmetic Specification. |
| 458 | Quiet NaNs are ignored and equal values are sorted based on sign |
| 459 | and exponent. |
| 460 | |
| 461 | - The decimal package's Context.copy() method now returns deep copies. |
| 462 | |
| 463 | - Deprecated sys.exitfunc in favor of the atexit module. The sys.exitfunc |
| 464 | attribute will be kept around for backwards compatibility and atexit |
| 465 | will just become the one preferred way to do it. |
| 466 | |
| 467 | - patch #675551: Add get_history_item and replace_history_item functions |
| 468 | to the readline module. |
| 469 | |
| 470 | - bug #989672: pdb.doc and the help messages for the help_d and help_u methods |
| 471 | of the pdb.Pdb class gives have been corrected. d(own) goes to a newer |
| 472 | frame, u(p) to an older frame, not the other way around. |
| 473 | |
| 474 | - bug #990669: os.path.realpath() will resolve symlinks before normalizing the |
| 475 | path, as normalizing the path may alter the meaning of the path if it |
| 476 | contains symlinks. |
| 477 | |
| 478 | - bug #851123: shutil.copyfile will raise an exception when trying to copy a |
| 479 | file onto a link to itself. Thanks Gregory Ball. |
| 480 | |
| 481 | - bug #570300: Fix inspect to resolve file locations using os.path.realpath() |
| 482 | so as to properly list all functions in a module when the module itself is |
| 483 | reached through a symlink. Thanks Johannes Gijsbers. |
| 484 | |
| 485 | - doctest refactoring continued. See the docs for details. As part of |
| 486 | this effort, some old and little- (never?) used features are now |
| 487 | deprecated: the Tester class, the module is_private() function, and the |
| 488 | isprivate argument to testmod(). The Tester class supplied a feeble |
| 489 | "by hand" way to combine multiple doctests, if you knew exactly what |
| 490 | you were doing. The newer doctest features for unittest integration |
| 491 | already did a better job of that, are stronger now than ever, and the |
| 492 | new DocTestRunner class is a saner foundation if you want to do it by |
| 493 | hand. The "private name" filtering gimmick was a mistake from the |
| 494 | start, and testmod() changed long ago to ignore it by default. If |
| 495 | you want to filter out tests, the new DocTestFinder class can be used |
| 496 | to return a list of all doctests, and you can filter that list by |
| 497 | any computable criteria before passing it to a DocTestRunner instance. |
| 498 | |
| 499 | - Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)). |
| 500 | |
| 501 | Tools/Demos |
| 502 | ----------- |
| 503 | |
| 504 | - IDLE's shortcut keys for windows are now case insensitive so that |
| 505 | Control-V works the same as Control-v. |
| 506 | |
| 507 | - pygettext.py: Generate POT-Creation-Date header in ISO format. |
| 508 | |
| 509 | Build |
| 510 | ----- |
| 511 | |
| 512 | - Backward incompatibility: longintrepr.h now triggers a compile-time |
| 513 | error if SHIFT (the number of bits in a Python long "digit") isn't |
| 514 | divisible by 5. This new requirement allows simple code for the new |
| 515 | 5-bits-at-a-time long_pow() implementation. If necessary, the |
| 516 | restriction could be removed (by complicating long_pow(), or by |
| 517 | falling back to the 1-bit-at-a-time algorithm), but there are no |
| 518 | plans to do so. |
| 519 | |
| 520 | - bug #991962: When building with --disable-toolbox-glue on Darwin no |
| 521 | attempt to build Mac-specific modules occurs. |
| 522 | |
| 523 | - The --with-tsc flag to configure to enable VM profiling with the |
| 524 | processor's timestamp counter now works on PPC platforms. |
| 525 | |
| 526 | - patch #1006629: Define _XOPEN_SOURCE to 500 on Solaris 8/9 to match |
| 527 | GCC's definition and avoid redefinition warnings. |
| 528 | |
| 529 | - Detect pthreads support (provided by gnu pth pthread emulation) on |
| 530 | GNU/k*BSD systems. |
| 531 | |
| 532 | - bug #1005737, #1007249: Fixed several build problems and warnings |
| 533 | found on old/legacy C compilers of HP-UX, IRIX and Tru64. |
| 534 | |
| 535 | C API |
| 536 | ----- |
| 537 | |
| 538 | .. |
| 539 | |
| 540 | Documentation |
| 541 | ------------- |
| 542 | |
| 543 | - patch #1005936, bug #1009373: fix index entries which contain |
| 544 | an underscore when viewed with Acrobat. |
| 545 | |
| 546 | - bug #990669: os.path.normpath may alter the meaning of a path if |
| 547 | it contains symbolic links. This has been documented in a comment |
| 548 | since 1992, but is now in the library reference as well. |
| 549 | |
| 550 | New platforms |
| 551 | ------------- |
| 552 | |
| 553 | - FreeBSD 6 is now supported. |
| 554 | |
| 555 | Tests |
| 556 | ----- |
| 557 | |
| 558 | .. |
| 559 | |
| 560 | Windows |
| 561 | ------- |
| 562 | |
| 563 | - Boosted the stack reservation for python.exe and pythonw.exe from |
| 564 | the default 1MB to 2MB. Stack frames under VC 7.1 for 2.4 are enough |
| 565 | bigger than under VC 6.0 for 2.3.4 that deeply recursive progams |
| 566 | within the default sys.getrecursionlimit() default value of 1000 were |
| 567 | able to suffer undetected C stack overflows. The standard test program |
| 568 | test_compiler was one such program. If a Python process on Windows |
| 569 | "just vanishes" without a trace, and without an error message of any |
| 570 | kind, but with an exit code of 128, undetected stack overflow may be |
| 571 | the problem. |
| 572 | |
| 573 | Mac |
| 574 | --- |
| 575 | |
| 576 | .. |
| 577 | |
| 578 | |
| 579 | What's New in Python 2.4 alpha 2? |
| 580 | ================================= |
| 581 | |
| 582 | *Release date: 05-AUG-2004* |
| 583 | |
| 584 | Core and builtins |
| 585 | ----------------- |
| 586 | |
| 587 | - Patch #980695: Implements efficient string concatenation for statements |
| 588 | of the form s=s+t and s+=t. This will vary across implementations. |
| 589 | Accordingly, the str.join() method is strongly preferred for performance |
| 590 | sensitive code. |
| 591 | |
| 592 | - PEP-0318, Function Decorators have been added to the language. These are |
| 593 | implemented using the Java-style @decorator syntax, like so:: |
| 594 | |
| 595 | @staticmethod |
| 596 | def foo(bar): |
| 597 | |
| 598 | (The PEP needs to be updated to reflect the current state) |
| 599 | |
| 600 | - When importing a module M raises an exception, Python no longer leaves M |
| 601 | in sys.modules. Before 2.4a2 it did, and a subsequent import of M would |
| 602 | succeed, picking up a module object from sys.modules reflecting as much |
| 603 | of the initialization of M as completed before the exception was raised. |
| 604 | Subsequent imports got no indication that M was in a partially- |
| 605 | initialized state, and the importers could get into arbitrarily bad |
| 606 | trouble as a result (the M they got was in an unintended state, |
| 607 | arbitrarily far removed from M's author's intent). Now subsequent |
| 608 | imports of M will continue raising exceptions (but if, for example, the |
| 609 | source code for M is edited between import attempts, then perhaps later |
| 610 | attempts will succeed, or raise a different exception). |
| 611 | |
| 612 | This can break existing code, but in such cases the code was probably |
| 613 | working before by accident. In the Python source, the only case of |
| 614 | breakage discovered was in a test accidentally relying on a damaged |
| 615 | module remaining in sys.modules. Cases are also known where tests |
| 616 | deliberately provoking import errors remove damaged modules from |
| 617 | sys.modules themselves, and such tests will break now if they do an |
| 618 | unconditional del sys.modules[M]. |
| 619 | |
| 620 | - u'%s' % obj will now try obj.__unicode__() first and fallback to |
| 621 | obj.__str__() if no __unicode__ method can be found. |
| 622 | |
| 623 | - Patch #550732: Add PyArg_VaParseTupleAndKeywords(). Analogous to |
| 624 | PyArg_VaParse(). Both are now documented. Thanks Greg Chapman. |
| 625 | |
| 626 | - Allow string and unicode return types from .encode()/.decode() |
| 627 | methods on string and unicode objects. Added unicode.decode() |
| 628 | which was missing for no apparent reason. |
| 629 | |
| 630 | - An attempt to fix the mess that is Python's behaviour with |
| 631 | signal handlers and threads, complicated by readline's behaviour. |
| 632 | It's quite possible that there are still bugs here. |
| 633 | |
| 634 | - Added C macros Py_CLEAR and Py_VISIT to ease the implementation of |
| 635 | types that support garbage collection. |
| 636 | |
| 637 | - Compiler now treats None as a constant. |
| 638 | |
| 639 | - The type of values returned by __int__, __float__, __long__, |
| 640 | __oct__, and __hex__ are now checked. Returning an invalid type |
| 641 | will cause a TypeError to be raised. This matches the behavior of |
| 642 | Jython. |
| 643 | |
| 644 | - Implemented bind_textdomain_codeset() in locale module. |
| 645 | |
| 646 | - Added a workaround for proper string operations in BSDs. str.split |
| 647 | and str.is* methods can now work correctly with UTF-8 locales. |
| 648 | |
| 649 | - Bug #989185: unicode.iswide() and unicode.width() is dropped and |
| 650 | the East Asian Width support is moved to unicodedata extension |
| 651 | module. |
| 652 | |
| 653 | - Patch #941229: The source code encoding in interactive mode |
| 654 | now refers sys.stdin.encoding not just ISO-8859-1 anymore. This |
| 655 | allows for non-latin-1 users to write unicode strings directly. |
| 656 | |
| 657 | Extension modules |
| 658 | ----------------- |
| 659 | |
| 660 | - cpickle now supports the same keyword arguments as pickle. |
| 661 | |
| 662 | Library |
| 663 | ------- |
| 664 | |
| 665 | - Added new codecs and aliases for ISO_8859-11, ISO_8859-16 and |
| 666 | TIS-620 |
| 667 | |
| 668 | - Thanks to Edward Loper, doctest has been massively refactored, and |
| 669 | many new features were added. Full docs will appear later. For now |
| 670 | the doctest module comments and new test cases give good coverage. |
| 671 | The refactoring provides many hook points for customizing behavior |
| 672 | (such as how to report errors, and how to compare expected to actual |
| 673 | output). New features include a <BLANKLINE> marker for expected |
| 674 | output containing blank lines, options to produce unified or context |
| 675 | diffs when actual output doesn't match expectations, an option to |
| 676 | normalize whitespace before comparing, and an option to use an |
| 677 | ellipsis to signify "don't care" regions of output. |
| 678 | |
| 679 | - Tkinter now supports the wish -sync and -use options. |
| 680 | |
| 681 | - The following methods in time support passing of None: ctime(), gmtime(), |
| 682 | and localtime(). If None is provided, the current time is used (the |
| 683 | same as when the argument is omitted). |
| 684 | [SF bug 658254, patch 663482] |
| 685 | |
| 686 | - nntplib does now allow to ignore a .netrc file. |
| 687 | |
| 688 | - urllib2 now recognizes Basic authentication even if other authentication |
| 689 | schemes are offered. |
| 690 | |
| 691 | - Bug #1001053. wave.open() now accepts unicode filenames. |
| 692 | |
| 693 | - gzip.GzipFile has a new fileno() method, to retrieve the handle of the |
| 694 | underlying file object (provided it has a fileno() method). This is |
| 695 | needed if you want to use os.fsync() on a GzipFile. |
| 696 | |
| 697 | - imaplib has two new methods: deleteacl and myrights. |
| 698 | |
| 699 | - nntplib has two new methods: description and descriptions. They |
| 700 | use a more RFC-compliant way of getting a newsgroup description. |
| 701 | |
| 702 | - Bug #993394. Fix a possible red herring of KeyError in 'threading' being |
| 703 | raised during interpreter shutdown from a registered function with atexit |
| 704 | when dummy_threading is being used. |
| 705 | |
| 706 | - Bug #857297/Patch #916874. Fix an error when extracting a hard link |
| 707 | from a tarfile. |
| 708 | |
| 709 | - Patch #846659. Fix an error in tarfile.py when using |
| 710 | GNU longname/longlink creation. |
| 711 | |
| 712 | - The obsolete FCNTL.py has been deleted. The builtin fcntl module |
| 713 | has been available (on platforms that support fcntl) since Python |
| 714 | 1.5a3, and all FCNTL.py did is export fcntl's names, after generating |
| 715 | a deprecation warning telling you to use fcntl directly. |
| 716 | |
| 717 | - Several new unicode codecs are added: big5hkscs, euc_jis_2004, |
| 718 | iso2022_jp_2004, shift_jis_2004. |
| 719 | |
| 720 | - Bug #788520. Queue.{get, get_nowait, put, put_nowait} have new |
| 721 | implementations, exploiting Conditions (which didn't exist at the time |
| 722 | Queue was introduced). A minor semantic change is that the Full and |
| 723 | Empty exceptions raised by non-blocking calls now occur only if the |
| 724 | queue truly was full or empty at the instant the queue was checked (of |
| 725 | course the Queue may no longer be full or empty by the time a calling |
| 726 | thread sees those exceptions, though). Before, the exceptions could |
| 727 | also be raised if it was "merely inconvenient" for the implementation |
| 728 | to determine the true state of the Queue (because the Queue was locked |
| 729 | by some other method in progress). |
| 730 | |
| 731 | - Bugs #979794 and #980117: difflib.get_grouped_opcodes() now handles the |
| 732 | case of comparing two empty lists. This affected both context_diff() and |
| 733 | unified_diff(), |
| 734 | |
| 735 | - Bug #980938: smtplib now prints debug output to sys.stderr. |
| 736 | |
| 737 | - Bug #930024: posixpath.realpath() now handles infinite loops in symlinks by |
| 738 | returning the last point in the path that was not part of any loop. Thanks |
| 739 | AM Kuchling. |
| 740 | |
| 741 | - Bug #980327: ntpath not handles compressing erroneous slashes between the |
| 742 | drive letter and the rest of the path. Also clearly handles UNC addresses now |
| 743 | as well. Thanks Paul Moore. |
| 744 | |
| 745 | - bug #679953: zipfile.py should now work for files over 2 GB. The packed data |
| 746 | for file sizes (compressed and uncompressed) was being stored as signed |
| 747 | instead of unsigned. |
| 748 | |
| 749 | - decimal.py now only uses signals in the IBM spec. The other conditions are |
| 750 | no longer part of the public API. |
| 751 | |
| 752 | - codecs module now has two new generic APIs: encode() and decode() |
| 753 | which don't restrict the return types (unlike the unicode and |
| 754 | string methods of the same name). |
| 755 | |
| 756 | - Non-blocking SSL sockets work again; they were broken in Python 2.3. |
| 757 | SF patch 945642. |
| 758 | |
| 759 | - doctest unittest integration improvements: |
| 760 | |
| 761 | o Improved the unitest test output for doctest-based unit tests |
| 762 | |
| 763 | o Can now pass setUp and tearDown functions when creating |
| 764 | DocTestSuites. |
| 765 | |
| 766 | - The threading module has a new class, local, for creating objects |
| 767 | that provide thread-local data. |
| 768 | |
| 769 | - Bug #990307: when keep_empty_values is True, cgi.parse_qsl() |
| 770 | no longer returns spurious empty fields. |
| 771 | |
| 772 | - Implemented bind_textdomain_codeset() in gettext module. |
| 773 | |
| 774 | - Introduced in gettext module the l*gettext() family of functions, |
| 775 | which return translation strings encoded in the preferred encoding, |
| 776 | as informed by locale module's getpreferredencoding(). |
| 777 | |
| 778 | - optparse module (and tests) upgraded to Optik 1.5a1. Changes: |
| 779 | |
| 780 | - Add expansion of default values in help text: the string |
| 781 | "%default" in an option's help string is expanded to str() of |
| 782 | that option's default value, or "none" if no default value. |
| 783 | |
| 784 | - Bug #955889: option default values that happen to be strings are |
| 785 | now processed in the same way as values from the command line; this |
| 786 | allows generation of nicer help when using custom types. Can |
| 787 | be disabled with parser.set_process_default_values(False). |
| 788 | |
| 789 | - Bug #960515: don't crash when generating help for callback |
| 790 | options that specify 'type', but not 'dest' or 'metavar'. |
| 791 | |
| 792 | - Feature #815264: change the default help format for short options |
| 793 | that take an argument from e.g. "-oARG" to "-o ARG"; add |
| 794 | set_short_opt_delimiter() and set_long_opt_delimiter() methods to |
| 795 | HelpFormatter to allow (slight) customization of the formatting. |
| 796 | |
| 797 | - Patch #736940: internationalize Optik: all built-in user- |
| 798 | targeted literal strings are passed through gettext.gettext(). (If |
| 799 | you want translations (.po files), they're not included with Python |
| 800 | -- you'll find them in the Optik source distribution from |
| 801 | http://optik.sourceforge.net/ .) |
| 802 | |
| 803 | - Bug #878453: respect $COLUMNS environment variable for |
| 804 | wrapping help output. |
| 805 | |
| 806 | - Feature #988122: expand "%prog" in the 'description' passed |
| 807 | to OptionParser, just like in the 'usage' and 'version' strings. |
| 808 | (This is *not* done in the 'description' passed to OptionGroup.) |
| 809 | |
| 810 | C API |
| 811 | ----- |
| 812 | |
| 813 | - PyImport_ExecCodeModule() and PyImport_ExecCodeModuleEx(): if an |
| 814 | error occurs while loading the module, these now delete the module's |
| 815 | entry from sys.modules. All ways of loading modules eventually call |
| 816 | one of these, so this is an error-case change in semantics for all |
| 817 | ways of loading modules. In rare cases, a module loader may wish |
| 818 | to keep a module object in sys.modules despite that the module's |
| 819 | code cannot be executed. In such cases, the module loader must |
| 820 | arrange to reinsert the name and module object in sys.modules. |
| 821 | PyImport_ReloadModule() has been changed to reinsert the original |
| 822 | module object into sys.modules if the module reload fails, so that |
| 823 | its visible semantics have not changed. |
| 824 | |
| 825 | - A large pile of datetime field-extraction macros is now documented, |
| 826 | thanks to Anthony Tuininga (patch #986010). |
| 827 | |
| 828 | Documentation |
| 829 | ------------- |
| 830 | |
| 831 | - Improved the tutorial on creating types in C. |
| 832 | |
| 833 | - point out the importance of reassigning data members before |
| 834 | assigning their values |
| 835 | |
| 836 | - correct my misconception about return values from visitprocs. Sigh. |
| 837 | |
| 838 | - mention the labor saving Py_VISIT and Py_CLEAR macros. |
| 839 | |
| 840 | - Major rewrite of the math module docs, to address common confusions. |
| 841 | |
| 842 | Tests |
| 843 | ----- |
| 844 | |
| 845 | - The test data files for the decimal test suite are now installed on |
| 846 | platforms that use the Makefile. |
| 847 | |
| 848 | - SF patch 995225: The test file testtar.tar accidentally contained |
| 849 | CVS keywords (like $Id$), which could cause spurious failures in |
| 850 | test_tarfile.py depending on how the test file was checked out. |
| 851 | |
| 852 | |
| 853 | What's New in Python 2.4 alpha 1? |
| 854 | ================================= |
| 855 | |
| 856 | *Release date: 08-JUL-2004* |
| 857 | |
| 858 | Core and builtins |
| 859 | ----------------- |
| 860 | |
| 861 | - weakref.ref is now the type object also known as |
| 862 | weakref.ReferenceType; it can be subclassed like any other new-style |
| 863 | class. There's less per-entry overhead in WeakValueDictionary |
| 864 | objects now (one object instead of three). |
| 865 | |
| 866 | - Bug #951851: Python crashed when reading import table of certain |
| 867 | Windows DLLs. |
| 868 | |
| 869 | - Bug #215126. The locals argument to eval(), execfile(), and exec now |
| 870 | accept any mapping type. |
| 871 | |
| 872 | - marshal now shares interned strings. This change introduces |
| 873 | a new .pyc magic. |
| 874 | |
| 875 | - Bug #966623. classes created with type() in an exec(, {}) don't |
| 876 | have a __module__, but code in typeobject assumed it would always |
| 877 | be there. |
| 878 | |
| 879 | - Python no longer relies on the LC_NUMERIC locale setting to be |
| 880 | the "C" locale; as a result, it no longer tries to prevent changing |
| 881 | the LC_NUMERIC category. |
| 882 | |
| 883 | - Bug #952807: Unpickling pickled instances of subclasses of |
| 884 | datetime.date, datetime.datetime and datetime.time could yield insane |
| 885 | objects. Thanks to Jiwon Seo for a fix. |
| 886 | |
| 887 | - Bug #845802: Python crashes when __init__.py is a directory. |
| 888 | |
| 889 | - Unicode objects received two new methods: iswide() and width(). |
| 890 | These query East Asian width information, as specified in Unicode |
| 891 | TR11. |
| 892 | |
| 893 | - Improved the tuple hashing algorithm to give fewer collisions in |
| 894 | common cases. Fixes bug #942952. |
| 895 | |
| 896 | - Implemented generator expressions (PEP 289). Coded by Jiwon Seo. |
| 897 | |
| 898 | - Enabled the profiling of C extension functions (and builtins) - check |
| 899 | new documentation and modified profile and bdb modules for more details |
| 900 | |
| 901 | - Set file.name to the object passed to open (instead of a new string) |
| 902 | |
| 903 | - Moved tracebackobject into traceback.h and renamed to PyTracebackObject |
| 904 | |
| 905 | - Optimized the byte coding for multiple assignments like "a,b=b,a" and |
| 906 | "a,b,c=1,2,3". Improves their speed by 25% to 30%. |
| 907 | |
| 908 | - Limit the nested depth of a tuple for the second argument to isinstance() |
| 909 | and issubclass() to the recursion limit of the interpreter. |
| 910 | Fixes bug #858016 . |
| 911 | |
| 912 | - Optimized dict iterators, creating separate types for each |
| 913 | and having them reveal their length. Also optimized the |
| 914 | methods: keys(), values(), and items(). |
| 915 | |
| 916 | - Implemented a newcode opcode, LIST_APPEND, that simplifies |
| 917 | the generated bytecode for list comprehensions and further |
| 918 | improves their performance (about 35%). |
| 919 | |
| 920 | - Implemented rich comparisons for floats, which seems to make |
| 921 | comparisons involving NaNs somewhat less surprising when the |
| 922 | underlying C compiler actually implements C99 semantics. |
| 923 | |
| 924 | - Optimized list.extend() to save memory and no longer create |
| 925 | intermediate sequences. Also, extend() now pre-allocates the |
| 926 | needed memory whenever the length of the iterable is known in |
| 927 | advance -- this halves the time to extend the list. |
| 928 | |
| 929 | - Optimized list resize operations to make fewer calls to the system |
| 930 | realloc(). Significantly speeds up list appends, list pops, |
| 931 | list comprehensions, and the list constructor (when the input iterable |
| 932 | length is not known). |
| 933 | |
| 934 | - Changed the internal list over-allocation scheme. For larger lists, |
| 935 | overallocation ranged between 3% and 25%. Now, it is a constant 12%. |
| 936 | For smaller lists (n<8), overallocation was upto eight elements. Now, |
| 937 | the overallocation is no more than three elements -- this improves space |
| 938 | utilization for applications that have large numbers of small lists. |
| 939 | |
| 940 | - Most list bodies now get re-used rather than freed. Speeds up list |
| 941 | instantiation and deletion by saving calls to malloc() and free(). |
| 942 | |
| 943 | - The dict.update() method now accepts all the same argument forms |
| 944 | as the dict() constructor. This now includes item lists and/or |
| 945 | keyword arguments. |
| 946 | |
| 947 | - Support for arbitrary objects supporting the read-only buffer |
| 948 | interface as the co_code field of code objects (something that was |
| 949 | only possible to create from C code) has been removed. |
| 950 | |
| 951 | - Made omitted callback and None equivalent for weakref.ref() and |
| 952 | weakref.proxy(); the None case wasn't handled correctly in all |
| 953 | cases. |
| 954 | |
| 955 | - Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy() |
| 956 | assumed that initial existing entries in an object's weakref list |
| 957 | would not be removed while allocating a new weakref object. Since |
| 958 | GC could be invoked at that time, however, that assumption was |
| 959 | invalid. In a truly obscure case of GC being triggered during |
| 960 | creation for a new weakref object for an referent which already |
| 961 | has a weakref without a callback which is only referenced from |
| 962 | cyclic trash, a memory error can occur. This consistently created a |
| 963 | segfault in a debug build, but provided less predictable behavior in |
| 964 | a release build. |
| 965 | |
| 966 | - input() builtin function now respects compiler flags such as |
| 967 | __future__ statements. SF patch 876178. |
| 968 | |
| 969 | - Removed PendingDeprecationWarning from apply(). apply() remains |
| 970 | deprecated, but the nuisance warning will not be issued. |
| 971 | |
| 972 | - At Python shutdown time (Py_Finalize()), 2.3 called cyclic garbage |
| 973 | collection twice, both before and after tearing down modules. The |
| 974 | call after tearing down modules has been disabled, because too much |
| 975 | of Python has been torn down then for __del__ methods and weakref |
| 976 | callbacks to execute sanely. The most common symptom was a sequence |
| 977 | of uninformative messages on stderr when Python shut down, produced |
| 978 | by threads trying to raise exceptions, but unable to report the nature |
| 979 | of their problems because too much of the sys module had already been |
| 980 | destroyed. |
| 981 | |
| 982 | - Removed FutureWarnings related to hex/oct literals and conversions |
| 983 | and left shifts. (Thanks to Kalle Svensson for SF patch 849227.) |
| 984 | This addresses most of the remaining semantic changes promised by |
| 985 | PEP 237, except for repr() of a long, which still shows the trailing |
| 986 | 'L'. The PEP appears to promise warnings for operations that |
| 987 | changed semantics compared to Python 2.3, but this is not |
| 988 | implemented; we've suffered through enough warnings related to |
| 989 | hex/oct literals and I think it's best to be silent now. |
| 990 | |
| 991 | - For str and unicode objects, the ljust(), center(), and rjust() |
| 992 | methods now accept an optional argument specifying a fill |
| 993 | character other than a space. |
| 994 | |
| 995 | - When method objects have an attribute that can be satisfied either |
| 996 | by the function object or by the method object, the function |
| 997 | object's attribute usually wins. Christian Tismer pointed out that |
| 998 | that this is really a mistake, because this only happens for special |
| 999 | methods (like __reduce__) where the method object's version is |
| 1000 | really more appropriate than the function's attribute. So from now |
| 1001 | on, all method attributes will have precedence over function |
| 1002 | attributes with the same name. |
| 1003 | |
| 1004 | - Critical bugfix, for SF bug 839548: if a weakref with a callback, |
| 1005 | its callback, and its weakly referenced object, all became part of |
| 1006 | cyclic garbage during a single run of garbage collection, the order |
| 1007 | in which they were torn down was unpredictable. It was possible for |
| 1008 | the callback to see partially-torn-down objects, leading to immediate |
| 1009 | segfaults, or, if the callback resurrected garbage objects, to |
| 1010 | resurrect insane objects that caused segfaults (or other surprises) |
| 1011 | later. In one sense this wasn't surprising, because Python's cyclic gc |
| 1012 | had no knowledge of Python's weakref objects. It does now. When |
| 1013 | weakrefs with callbacks become part of cyclic garbage now, those |
| 1014 | weakrefs are cleared first. The callbacks don't trigger then, |
| 1015 | preventing the problems. If you need callbacks to trigger, then just |
| 1016 | as when cyclic gc is not involved, you need to write your code so |
| 1017 | that weakref objects outlive the objects they weakly reference. |
| 1018 | |
| 1019 | - Critical bugfix, for SF bug 840829: if cyclic garbage collection |
| 1020 | happened to occur during a weakref callback for a new-style class |
| 1021 | instance, subtle memory corruption was the result (in a release build; |
| 1022 | in a debug build, a segfault occurred reliably very soon after). |
| 1023 | This has been repaired. |
| 1024 | |
| 1025 | - Compiler flags set in PYTHONSTARTUP are now active in __main__. |
| 1026 | |
| 1027 | - Added two builtin types, set() and frozenset(). |
| 1028 | |
| 1029 | - Added a reversed() builtin function that returns a reverse iterator |
| 1030 | over a sequence. |
| 1031 | |
| 1032 | - Added a sorted() builtin function that returns a new sorted list |
| 1033 | from any iterable. |
| 1034 | |
| 1035 | - CObjects are now mutable (on the C level) through PyCObject_SetVoidPtr. |
| 1036 | |
| 1037 | - list.sort() now supports three keyword arguments: cmp, key, and reverse. |
| 1038 | The key argument can be a function of one argument that extracts a |
| 1039 | comparison key from the original record: mylist.sort(key=str.lower). |
| 1040 | The reverse argument is a boolean value and if True will change the |
| 1041 | sort order as if the comparison arguments were reversed. In addition, |
| 1042 | the documentation has been amended to provide a guarantee that all sorts |
| 1043 | starting with Py2.3 are guaranteed to be stable (the relative order of |
| 1044 | records with equal keys is unchanged). |
| 1045 | |
| 1046 | - Added test whether wchar_t is signed or not. A signed wchar_t is not |
| 1047 | usable as internal unicode type base for Py_UNICODE since the |
| 1048 | unicode implementation assumes an unsigned type. |
| 1049 | |
| 1050 | - Fixed a bug in the cache of length-one Unicode strings that could |
| 1051 | lead to a seg fault. The specific problem occurred when an earlier, |
| 1052 | non-fatal error left an uninitialized Unicode object in the |
| 1053 | freelist. |
| 1054 | |
| 1055 | - The % formatting operator now supports '%F' which is equivalent to |
| 1056 | '%f'. This has always been documented but never implemented. |
| 1057 | |
| 1058 | - complex(obj) could leak a little memory if obj wasn't a string or |
| 1059 | number. |
| 1060 | |
| 1061 | - zip() with no arguments now returns an empty list instead of raising |
| 1062 | a TypeError exception. |
| 1063 | |
| 1064 | - obj.__contains__() now returns True/False instead of 1/0. SF patch |
| 1065 | 820195. |
| 1066 | |
| 1067 | - Python no longer tries to be smart about recursive comparisons. |
| 1068 | When comparing containers with cyclic references to themselves it |
| 1069 | will now just hit the recursion limit. See SF patch 825639. |
| 1070 | |
| 1071 | - str and unicode builtin types now have an rsplit() method that is |
| 1072 | same as split() except that it scans the string from the end |
| 1073 | working towards the beginning. See SF feature request 801847. |
| 1074 | |
| 1075 | - Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure |
| 1076 | to clear the error when attempts to get the __getstate__ attribute |
| 1077 | fail caused intermittent errors and odd behavior. |
| 1078 | |
| 1079 | - buffer objects based on other objects no longer cache a pointer to |
| 1080 | the data and the data length. Instead, the appropriate tp_as_buffer |
| 1081 | method is called as necessary. |
| 1082 | |
| 1083 | - fixed: if a file is opened with an explicit buffer size >= 1, repeated |
| 1084 | close() calls would attempt to free() the buffer already free()ed on |
| 1085 | the first call. |
| 1086 | |
| 1087 | |
| 1088 | Extension modules |
| 1089 | ----------------- |
| 1090 | |
| 1091 | - Added socket.getservbyport(), and make the second argument in |
| 1092 | getservbyname() and getservbyport() optional. |
| 1093 | |
| 1094 | - time module code that deals with input POSIX timestamps will now raise |
| 1095 | ValueError if more than a second is lost in precision when the |
| 1096 | timestamp is cast to the platform C time_t type. There's no chance |
| 1097 | that the platform will do anything sensible with the result in such |
| 1098 | cases. This includes ctime(), localtime() and gmtime(). Assorted |
| 1099 | fromtimestamp() and utcfromtimestamp() methods in the datetime module |
| 1100 | were also protected. Closes bugs #919012 and 975996. |
| 1101 | |
| 1102 | - fcntl.ioctl now warns if the mutate flag is not specified. |
| 1103 | |
| 1104 | - nt now properly allows to refer to UNC roots, e.g. in nt.stat(). |
| 1105 | |
| 1106 | - the weakref module now supports additional objects: array.array, |
| 1107 | sre.pattern_objects, file objects, and sockets. |
| 1108 | |
| 1109 | - operator.isMappingType() and operator.isSequenceType() now give |
| 1110 | fewer false positives. |
| 1111 | |
| 1112 | - socket.sslerror is now a subclass of socket.error . Also added |
| 1113 | socket.error to the socket module's C API. |
| 1114 | |
| 1115 | - Bug #920575: A problem where the _locale module segfaults on |
| 1116 | nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed. |
| 1117 | |
| 1118 | - array objects now support the copy module. Also, their resizing |
| 1119 | scheme has been updated to match that used for list objects. This improves |
| 1120 | the performance (speed and memory usage) of append() operations. |
| 1121 | Also, array.array() and array.extend() now accept any iterable argument |
| 1122 | for repeated appends without needing to create another temporary array. |
| 1123 | |
| 1124 | - cStringIO.writelines() now accepts any iterable argument and writes |
| 1125 | the lines one at a time rather than joining them and writing once. |
| 1126 | Made a parallel change to StringIO.writelines(). Saves memory and |
| 1127 | makes suitable for use with generator expressions. |
| 1128 | |
| 1129 | - time.strftime() now checks that the values in its time tuple argument |
| 1130 | are within the proper boundaries to prevent possible crashes from the |
| 1131 | platform's C library implementation of strftime(). Can possibly |
| 1132 | break code that uses values outside the range that didn't cause |
| 1133 | problems previously (such as sitting day of year to 0). Fixes bug |
| 1134 | #897625. |
| 1135 | |
| 1136 | - The socket module now supports Bluetooth sockets, if the |
| 1137 | system has <bluetooth/bluetooth.h> |
| 1138 | |
| 1139 | - Added a collections module containing a new datatype, deque(), |
| 1140 | offering high-performance, thread-safe, memory friendly appends |
| 1141 | and pops on either side of the deque. |
| 1142 | |
| 1143 | - Several modules now take advantage of collections.deque() for |
| 1144 | improved performance: Queue, mutex, shlex, threading, and pydoc. |
| 1145 | |
| 1146 | - The operator module has two new functions, attrgetter() and |
| 1147 | itemgetter() which are useful for creating fast data extractor |
| 1148 | functions for map(), list.sort(), itertools.groupby(), and |
| 1149 | other functions that expect a function argument. |
| 1150 | |
| 1151 | - socket.SHUT_{RD,WR,RDWR} was added. |
| 1152 | |
| 1153 | - os.getsid was added. |
| 1154 | |
| 1155 | - The pwd module incorrectly advertised its struct type as |
| 1156 | struct_pwent; this has been renamed to struct_passwd. (The old name |
| 1157 | is still supported for backwards compatibility.) |
| 1158 | |
| 1159 | - The xml.parsers.expat module now provides Expat 1.95.7. |
| 1160 | |
| 1161 | - socket.IPPROTO_IPV6 was added. |
| 1162 | |
| 1163 | - readline.clear_history was added. |
| 1164 | |
| 1165 | - select.select() now accepts sequences for its first three arguments. |
| 1166 | |
| 1167 | - cStringIO now supports the f.closed attribute. |
| 1168 | |
| 1169 | - The signal module now exposes SIGRTMIN and SIGRTMAX (if available). |
| 1170 | |
| 1171 | - curses module now supports use_default_colors(). [patch #739124] |
| 1172 | |
| 1173 | - Bug #811028: ncurses.h breakage on FreeBSD/MacOS X |
| 1174 | |
| 1175 | - Bug #814613: INET_ADDRSTRLEN fix needed for all compilers on SGI |
| 1176 | |
| 1177 | - Implemented non-recursive SRE matching scheme (#757624). |
| 1178 | |
| 1179 | - Implemented (?(id/name)yes|no) support in SRE (#572936). |
| 1180 | |
| 1181 | - random.seed() with no arguments or None uses time.time() as a default |
| 1182 | seed. Modified to match Py2.2 behavior and use fractional seconds so |
| 1183 | that successive runs are more likely to produce different sequences. |
| 1184 | |
| 1185 | - random.Random has a new method, getrandbits(k), which returns an int |
| 1186 | with k random bits. This method is now an optional part of the API |
| 1187 | for user defined generators. Any generator that defines genrandbits() |
| 1188 | can now use randrange() for ranges with a length >= 2**53. Formerly, |
| 1189 | randrange would return only even numbers for ranges that large (see |
| 1190 | SF bug #812202). Generators that do not define genrandbits() now |
| 1191 | issue a warning when randrange() is called with a range that large. |
| 1192 | |
| 1193 | - itertools has a new function, groupby() for aggregating iterables |
| 1194 | into groups sharing the same key (as determined by a key function). |
| 1195 | It offers some of functionality of SQL's groupby keyword and of |
| 1196 | the Unix uniq filter. |
| 1197 | |
| 1198 | - itertools now has a new tee() function which produces two independent |
| 1199 | iterators from a single iterable. |
| 1200 | |
| 1201 | - itertools.izip() with no arguments now returns an empty iterator instead |
| 1202 | of raising a TypeError exception. |
| 1203 | |
| 1204 | - Fixed #853061: allow BZ2Compressor.compress() to receive an empty string |
| 1205 | as parameter. |
| 1206 | |
| 1207 | Library |
| 1208 | ------- |
| 1209 | |
| 1210 | - Added a new module: cProfile, a C profiler with the same interface as the |
| 1211 | profile module. cProfile avoids some of the drawbacks of the hotshot |
| 1212 | profiler and provides a bit more information than the other two profilers. |
| 1213 | Based on "lsprof" (patch #1212837). |
| 1214 | |
| 1215 | - Bug #1266283: The new function "lexists" is now in os.path.__all__. |
| 1216 | |
| 1217 | - Bug #981530: Fix UnboundLocalError in shutil.rmtree(). This affects |
| 1218 | the documented behavior: the function passed to the onerror() |
| 1219 | handler can now also be os.listdir. |
| 1220 | |
| 1221 | - Bug #754449: threading.Thread objects no longer mask exceptions raised during |
| 1222 | interpreter shutdown with another exception from attempting to handle the |
| 1223 | original exception. |
| 1224 | |
| 1225 | - Added decimal.py per PEP 327. |
| 1226 | |
| 1227 | - Bug #981299: rsync is now a recognized protocol in urlparse that uses a |
| 1228 | "netloc" portion of a URL. |
| 1229 | |
| 1230 | - Bug #919012: shutil.move() will not try to move a directory into itself. |
| 1231 | Thanks Johannes Gijsbers. |
| 1232 | |
| 1233 | - Bug #934282: pydoc.stripid() is now case-insensitive. Thanks Robin Becker. |
| 1234 | |
| 1235 | - Bug #823209: cmath.log() now takes an optional base argument so that its |
| 1236 | API matches math.log(). |
| 1237 | |
| 1238 | - Bug #957381: distutils bdist_rpm no longer fails on recent RPM versions |
| 1239 | that generate a -debuginfo.rpm |
| 1240 | |
| 1241 | - os.path.devnull has been added for all supported platforms. |
| 1242 | |
| 1243 | - Fixed #877165: distutils now picks the right C++ compiler command |
| 1244 | on cygwin and mingw32. |
| 1245 | |
| 1246 | - urllib.urlopen().readline() now handles HTTP/0.9 correctly. |
| 1247 | |
| 1248 | - refactored site.py into functions. Also wrote regression tests for the |
| 1249 | module. |
| 1250 | |
| 1251 | - The distutils install command now supports the --home option and |
| 1252 | installation scheme for all platforms. |
| 1253 | |
| 1254 | - asyncore.loop now has a repeat count parameter that defaults to |
| 1255 | looping forever. |
| 1256 | |
| 1257 | - The distutils sdist command now ignores all .svn directories, in |
| 1258 | addition to CVS and RCS directories. .svn directories hold |
| 1259 | administrative files for the Subversion source control system. |
| 1260 | |
| 1261 | - Added a new module: cookielib. Automatic cookie handling for HTTP |
| 1262 | clients. Also, support for cookielib has been added to urllib2, so |
| 1263 | urllib2.urlopen() can transparently handle cookies. |
| 1264 | |
| 1265 | - stringprep.py now uses built-in set() instead of sets.Set(). |
| 1266 | |
| 1267 | - Bug #876278: Unbounded recursion in modulefinder |
| 1268 | |
| 1269 | - Bug #780300: Swap public and system ID in LexicalHandler.startDTD. |
| 1270 | Applications relying on the wrong order need to be corrected. |
| 1271 | |
| 1272 | - Bug #926075: Fixed a bug that returns a wrong pattern object |
| 1273 | for a string or unicode object in sre.compile() when a different |
| 1274 | type pattern with the same value exists. |
| 1275 | |
| 1276 | - Added countcallers arg to trace.Trace class (--trackcalls command line arg |
| 1277 | when run from the command prompt). |
| 1278 | |
| 1279 | - Fixed a caching bug in platform.platform() where the argument of 'terse' was |
| 1280 | not taken into consideration when caching value. |
| 1281 | |
| 1282 | - Added two new command-line arguments for profile (output file and |
| 1283 | default sort). |
| 1284 | |
| 1285 | - Added global runctx function to profile module |
| 1286 | |
| 1287 | - Add hlist missing entryconfigure and entrycget methods. |
| 1288 | |
| 1289 | - The ptcp154 codec was added for Kazakh character set support. |
| 1290 | |
| 1291 | - Support non-anonymous ftp URLs in urllib2. |
| 1292 | |
| 1293 | - The encodings package will now apply codec name aliases |
| 1294 | first before starting to try the import of the codec module. |
| 1295 | This simplifies overriding built-in codecs with external |
| 1296 | packages, e.g. the included CJK codecs with the JapaneseCodecs |
| 1297 | package, by adjusting the aliases dictionary in encodings.aliases |
| 1298 | accordingly. |
| 1299 | |
| 1300 | - base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and |
| 1301 | decoding standards. |
| 1302 | |
| 1303 | - urllib2 now supports processors. A processor is a handler that |
| 1304 | implements an xxx_request or xxx_response method. These methods are |
| 1305 | called for all requests. |
| 1306 | |
| 1307 | - distutils compilers now compile source files in the same order as |
| 1308 | they are passed to the compiler. |
| 1309 | |
| 1310 | - pprint.pprint() and pprint.pformat() now have additional parameters |
| 1311 | indent, width and depth. |
| 1312 | |
| 1313 | - Patch #750542: pprint now will pretty print subclasses of list, tuple |
| 1314 | and dict too, as long as they don't overwrite __repr__(). |
| 1315 | |
| 1316 | - Bug #848614: distutils' msvccompiler fails to find the MSVC6 |
| 1317 | compiler because of incomplete registry entries. |
| 1318 | |
| 1319 | - httplib.HTTP.putrequest now offers to omit the implicit Accept-Encoding. |
| 1320 | |
| 1321 | - Patch #841977: modulefinder didn't find extension modules in packages |
| 1322 | |
| 1323 | - imaplib.IMAP4.thread was added. |
| 1324 | |
| 1325 | - Plugged a minor hole in tempfile.mktemp() due to the use of |
| 1326 | os.path.exists(), switched to using os.lstat() directly if possible. |
| 1327 | |
| 1328 | - bisect.py and heapq.py now have underlying C implementations |
| 1329 | for better performance. |
| 1330 | |
| 1331 | - heapq.py has two new functions, nsmallest() and nlargest(). |
| 1332 | |
| 1333 | - traceback.format_exc has been added (similar to print_exc but it returns |
| 1334 | a string). |
| 1335 | |
| 1336 | - xmlrpclib.MultiCall has been added. |
| 1337 | |
| 1338 | - poplib.POP3_SSL has been added. |
| 1339 | |
| 1340 | - tmpfile.mkstemp now returns an absolute path even if dir is relative. |
| 1341 | |
| 1342 | - urlparse is RFC 2396 compliant. |
| 1343 | |
| 1344 | - The fieldnames argument to the csv module's DictReader constructor is now |
| 1345 | optional. If omitted, the first row of the file will be used as the |
| 1346 | list of fieldnames. |
| 1347 | |
| 1348 | - encodings.bz2_codec was added for access to bz2 compression |
| 1349 | using "a long string".encode('bz2') |
| 1350 | |
| 1351 | - Various improvements to unittest.py, realigned with PyUnit CVS. |
| 1352 | |
| 1353 | - dircache now passes exceptions to the caller, instead of returning |
| 1354 | empty lists. |
| 1355 | |
| 1356 | - The bsddb module and dbhash module now support the iterator and |
| 1357 | mapping protocols which make them more substitutable for dictionaries |
| 1358 | and shelves. |
| 1359 | |
| 1360 | - The csv module's DictReader and DictWriter classes now accept keyword |
| 1361 | arguments. This was an omission in the initial implementation. |
| 1362 | |
| 1363 | - The email package handles some RFC 2231 parameters with missing |
| 1364 | CHARSET fields better. It also includes a patch to parameter |
| 1365 | parsing when semicolons appear inside quotes. |
| 1366 | |
| 1367 | - sets.py now runs under Py2.2. In addition, the argument restrictions |
| 1368 | for most set methods (but not the operators) have been relaxed to |
| 1369 | allow any iterable. |
| 1370 | |
| 1371 | - _strptime.py now has a behind-the-scenes caching mechanism for the most |
| 1372 | recent TimeRE instance used along with the last five unique directive |
| 1373 | patterns. The overall module was also made more thread-safe. |
| 1374 | |
| 1375 | - random.cunifvariate() and random.stdgamma() were deprecated in Py2.3 |
| 1376 | and removed in Py2.4. |
| 1377 | |
| 1378 | - Bug #823328: urllib2.py's HTTP Digest Auth support works again. |
| 1379 | |
| 1380 | - Patch #873597: CJK codecs are imported into rank of default codecs. |
| 1381 | |
| 1382 | Tools/Demos |
| 1383 | ----------- |
| 1384 | |
| 1385 | - A hotshotmain script was added to the Tools/scripts directory that |
| 1386 | makes it easy to run a script under control of the hotshot profiler. |
| 1387 | |
| 1388 | - The db2pickle and pickle2db scripts can now dump/load gdbm files. |
| 1389 | |
| 1390 | - The file order on the command line of the pickle2db script was reversed. |
| 1391 | It is now [ picklefile ] dbfile. This provides better symmetry with |
| 1392 | db2pickle. The file arguments to both scripts are now source followed by |
| 1393 | destination in situations where both files are given. |
| 1394 | |
| 1395 | - The pydoc script will display a link to the module documentation for |
| 1396 | modules determined to be part of the core distribution. The documentation |
| 1397 | base directory defaults to http://www.python.org/doc/current/lib/ but can |
| 1398 | be changed by setting the PYTHONDOCS environment variable. |
| 1399 | |
| 1400 | - texcheck.py now detects double word errors. |
| 1401 | |
| 1402 | - md5sum.py mistakenly opened input files in text mode by default, a |
| 1403 | silent and dangerous change from previous releases. It once again |
| 1404 | opens input files in binary mode by default. The -t and -b flags |
| 1405 | remain for compatibility with the 2.3 release, but -b is the default |
| 1406 | now. |
| 1407 | |
| 1408 | - py-electric-colon now works when pending-delete/delete-selection mode is |
| 1409 | in effect |
| 1410 | |
| 1411 | - py-help-at-point is no longer bound to the F1 key - it's still bound to |
| 1412 | C-c C-h |
| 1413 | |
| 1414 | - Pynche was fixed to not crash when there is no ~/.pynche file and no |
| 1415 | -d option was given. |
| 1416 | |
| 1417 | Build |
| 1418 | ----- |
| 1419 | |
| 1420 | - Bug #978645: Modules/getpath.c now builds properly in --disable-framework |
| 1421 | build under OS X. |
| 1422 | |
| 1423 | - Profiling using gprof is now available if Python is configured with |
| 1424 | --enable-profiling. |
| 1425 | |
| 1426 | - Profiling the VM using the Pentium TSC is now possible if Python |
| 1427 | is configured --with-tsc. |
| 1428 | |
| 1429 | - In order to find libraries, setup.py now also looks in /lib64, for use |
| 1430 | on AMD64. |
| 1431 | |
| 1432 | - Bug #934635: Fixed a bug where the configure script couldn't detect |
| 1433 | getaddrinfo() properly if the KAME stack had SCTP support. |
| 1434 | |
| 1435 | - Support for missing ANSI C header files (limits.h, stddef.h, etc) was |
| 1436 | removed. |
| 1437 | |
| 1438 | - Systems requiring the D4, D6 or D7 variants of pthreads are no longer |
| 1439 | supported (see PEP 11). |
| 1440 | |
| 1441 | - Universal newline support can no longer be disabled (see PEP 11). |
| 1442 | |
| 1443 | - Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11). |
| 1444 | |
| 1445 | - Support for systems requiring --with-dl-dld or --with-sgi-dl was removed |
| 1446 | (see PEP 11). |
| 1447 | |
| 1448 | - Tests for sizeof(char) were removed since ANSI C mandates that |
| 1449 | sizeof(char) must be 1. |
| 1450 | |
| 1451 | C API |
| 1452 | ----- |
| 1453 | |
| 1454 | - Thanks to Anthony Tuininga, the datetime module now supplies a C API |
| 1455 | containing type-check macros and constructors. See new docs in the |
| 1456 | Python/C API Reference Manual for details. |
| 1457 | |
| 1458 | - Private function _PyTime_DoubleToTimet added, to convert a Python |
| 1459 | timestamp (C double) to platform time_t with some out-of-bounds |
| 1460 | checking. Declared in new header file timefuncs.h. It would be |
| 1461 | good to expose some other internal timemodule.c functions there. |
| 1462 | |
| 1463 | - New public functions PyEval_EvaluateFrame and PyGen_New to expose |
| 1464 | generator objects. |
| 1465 | |
| 1466 | - New public functions Py_IncRef() and Py_DecRef(), exposing the |
| 1467 | functionality of the Py_XINCREF() and Py_XDECREF macros. Useful for |
| 1468 | runtime dynamic embedding of Python. See patch #938302, by Bob |
| 1469 | Ippolito. |
| 1470 | |
| 1471 | - Added a new macro, PySequence_Fast_ITEMS, which retrieves a fast sequence's |
| 1472 | underlying array of PyObject pointers. Useful for high speed looping. |
| 1473 | |
| 1474 | - Created a new method flag, METH_COEXIST, which causes a method to be loaded |
| 1475 | even if already defined by a slot wrapper. This allows a __contains__ |
| 1476 | method, for example, to co-exist with a defined sq_contains slot. This |
| 1477 | is helpful because the PyCFunction can take advantage of optimized calls |
| 1478 | whenever METH_O or METH_NOARGS flags are defined. |
| 1479 | |
| 1480 | - Added a new function, PyDict_Contains(d, k) which is like |
| 1481 | PySequence_Contains() but is specific to dictionaries and executes |
| 1482 | about 10% faster. |
| 1483 | |
| 1484 | - Added three new macros: Py_RETURN_NONE, Py_RETURN_TRUE, and Py_RETURN_FALSE. |
| 1485 | Each return the singleton they mention after Py_INCREF()ing them. |
| 1486 | |
| 1487 | - Added a new function, PyTuple_Pack(n, ...) for constructing tuples from a |
| 1488 | variable length argument list of Python objects without having to invoke |
| 1489 | the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c) |
| 1490 | is equivalent to Py_BuildValue("(OOO)", a, b, c). |
| 1491 | |
| 1492 | Windows |
| 1493 | ------- |
| 1494 | |
| 1495 | - The _winreg module could segfault when reading very large registry |
| 1496 | values, due to unchecked alloca() calls (SF bug 851056). The fix is |
| 1497 | uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n), |
| 1498 | as appropriate, followed by a size check. |
| 1499 | |
| 1500 | - file.truncate() could misbehave if the file was open for update |
| 1501 | (modes r+, rb+, w+, wb+), and the most recent file operation before |
| 1502 | the truncate() call was an input operation. SF bug 801631. |
| 1503 | |
| 1504 | |
| 1505 | What's New in Python 2.3 final? |
| 1506 | =============================== |
| 1507 | |
| 1508 | *Release date: 29-Jul-2003* |
| 1509 | |
| 1510 | IDLE |
| 1511 | ---- |
| 1512 | |
| 1513 | - Bug 778400: IDLE hangs when selecting "Edit with IDLE" from explorer. |
| 1514 | This was unique to Windows, and was fixed by adding an -n switch to |
| 1515 | the command the Windows installer creates to execute "Edit with IDLE" |
| 1516 | context-menu actions. |
| 1517 | |
| 1518 | - IDLE displays a new message upon startup: some "personal firewall" |
| 1519 | kinds of programs (for example, ZoneAlarm) open a dialog of their |
| 1520 | own when any program opens a socket. IDLE does use sockets, talking |
| 1521 | on the computer's internal loopback interface. This connection is not |
| 1522 | visible on any external interface and no data is sent to or received |
| 1523 | from the Internet. So, if you get such a dialog when opening IDLE, |
| 1524 | asking whether to let pythonw.exe talk to address 127.0.0.1, say yes, |
| 1525 | and rest assured no communication external to your machine is taking |
| 1526 | place. If you don't allow it, IDLE won't be able to start. |
| 1527 | |
| 1528 | |
| 1529 | What's New in Python 2.3 release candidate 2? |
| 1530 | ============================================= |
| 1531 | |
| 1532 | *Release date: 24-Jul-2003* |
| 1533 | |
| 1534 | Core and builtins |
| 1535 | ----------------- |
| 1536 | |
| 1537 | - It is now possible to import from zipfiles containing additional |
| 1538 | data bytes before the zip compatible archive. Zipfiles containing a |
| 1539 | comment at the end are still unsupported. |
| 1540 | |
| 1541 | Extension modules |
| 1542 | ----------------- |
| 1543 | |
| 1544 | - A longstanding bug in the parser module's initialization could cause |
| 1545 | fatal internal refcount confusion when the module got initialized more |
| 1546 | than once. This has been fixed. |
| 1547 | |
| 1548 | - Fixed memory leak in pyexpat; using the parser's ParseFile() method |
| 1549 | with open files that aren't instances of the standard file type |
| 1550 | caused an instance of the bound .read() method to be leaked on every |
| 1551 | call. |
| 1552 | |
| 1553 | - Fixed some leaks in the locale module. |
| 1554 | |
| 1555 | Library |
| 1556 | ------- |
| 1557 | |
| 1558 | - Lib/encodings/rot_13.py when used as a script, now more properly |
| 1559 | uses the first Python interpreter on your path. |
| 1560 | |
| 1561 | - Removed caching of TimeRE (and thus LocaleTime) in _strptime.py to |
| 1562 | fix a locale related bug in the test suite. Although another patch |
| 1563 | was needed to actually fix the problem, the cache code was not |
| 1564 | restored. |
| 1565 | |
| 1566 | IDLE |
| 1567 | ---- |
| 1568 | |
| 1569 | - Calltips patches. |
| 1570 | |
| 1571 | Build |
| 1572 | ----- |
| 1573 | |
| 1574 | - For MacOSX, added -mno-fused-madd to BASECFLAGS to fix test_coercion |
| 1575 | on Panther (OSX 10.3). |
| 1576 | |
| 1577 | C API |
| 1578 | ----- |
| 1579 | |
| 1580 | Windows |
| 1581 | ------- |
| 1582 | |
| 1583 | - The tempfile module could do insane imports on Windows if PYTHONCASEOK |
| 1584 | was set, making temp file creation impossible. Repaired. |
| 1585 | |
| 1586 | - Add a patch to workaround pthread_sigmask() bugs in Cygwin. |
| 1587 | |
| 1588 | Mac |
| 1589 | --- |
| 1590 | |
| 1591 | - Various fixes to pimp. |
| 1592 | |
| 1593 | - Scripts runs with pythonw no longer had full window manager access. |
| 1594 | |
| 1595 | - Don't force boot-disk-only install, for reasons unknown it causes |
| 1596 | more problems than it solves. |
| 1597 | |
| 1598 | |
| 1599 | What's New in Python 2.3 release candidate 1? |
| 1600 | ============================================= |
| 1601 | |
| 1602 | *Release date: 18-Jul-2003* |
| 1603 | |
| 1604 | Core and builtins |
| 1605 | ----------------- |
| 1606 | |
| 1607 | - The new function sys.getcheckinterval() returns the last value set |
| 1608 | by sys.setcheckinterval(). |
| 1609 | |
| 1610 | - Several bugs in the symbol table phase of the compiler have been |
| 1611 | fixed. Errors could be lost and compilation could fail without |
| 1612 | reporting an error. SF patch 763201. |
| 1613 | |
| 1614 | - The interpreter is now more robust about importing the warnings |
| 1615 | module. In an executable generated by freeze or similar programs, |
| 1616 | earlier versions of 2.3 would fail if the warnings module could |
| 1617 | not be found on the file system. Fixes SF bug 771097. |
| 1618 | |
| 1619 | - A warning about assignments to module attributes that shadow |
| 1620 | builtins, present in earlier releases of 2.3, has been removed. |
| 1621 | |
| 1622 | - It is not possible to create subclasses of builtin types like str |
| 1623 | and tuple that define an itemsize. Earlier releases of Python 2.3 |
| 1624 | allowed this by mistake, leading to crashes and other problems. |
| 1625 | |
| 1626 | - The thread_id is now initialized to 0 in a non-thread build. SF bug |
| 1627 | 770247. |
| 1628 | |
| 1629 | - SF bug 762891: "del p[key]" on proxy object no longer raises SystemError. |
| 1630 | |
| 1631 | Extension modules |
| 1632 | ----------------- |
| 1633 | |
| 1634 | - weakref.proxy() can now handle "del obj[i]" for proxy objects |
| 1635 | defining __delitem__. Formerly, it generated a SystemError. |
| 1636 | |
| 1637 | - SSL no longer crashes the interpreter when the remote side disconnects. |
| 1638 | |
| 1639 | - On Unix the mmap module can again be used to map device files. |
| 1640 | |
| 1641 | - time.strptime now exclusively uses the Python implementation |
| 1642 | contained within the _strptime module. |
| 1643 | |
| 1644 | - The print slot of weakref proxy objects was removed, because it was |
| 1645 | not consistent with the object's repr slot. |
| 1646 | |
| 1647 | - The mmap module only checks file size for regular files, not |
| 1648 | character or block devices. SF patch 708374. |
| 1649 | |
| 1650 | - The cPickle Pickler garbage collection support was fixed to traverse |
| 1651 | the find_class attribute, if present. |
| 1652 | |
| 1653 | - There are several fixes for the bsddb3 wrapper module. |
| 1654 | |
| 1655 | bsddb3 no longer crashes if an environment is closed before a cursor |
| 1656 | (SF bug 763298). |
| 1657 | |
| 1658 | The DB and DBEnv set_get_returns_none function was extended to take |
| 1659 | a level instead of a boolean flag. The new level 2 means that in |
| 1660 | addition, cursor.set()/.get() methods return None instead of raising |
| 1661 | an exception. |
| 1662 | |
| 1663 | A typo was fixed in DBCursor.join_item(), preventing a crash. |
| 1664 | |
| 1665 | Library |
| 1666 | ------- |
| 1667 | |
| 1668 | - distutils now supports MSVC 7.1 |
| 1669 | |
| 1670 | - doctest now examines all docstrings by default. Previously, it would |
| 1671 | skip over functions with private names (as indicated by the underscore |
| 1672 | naming convention). The old default created too much of a risk that |
| 1673 | user tests were being skipped inadvertently. Note, this change could |
| 1674 | break code in the unlikely case that someone had intentionally put |
| 1675 | failing tests in the docstrings of private functions. The breakage |
| 1676 | is easily fixable by specifying the old behavior when calling testmod() |
| 1677 | or Tester(). |
| 1678 | |
| 1679 | - There were several fixes to the way dumbdbms are closed. It's vital |
| 1680 | that a dumbdbm database be closed properly, else the on-disk data |
| 1681 | and directory files can be left in mutually inconsistent states. |
| 1682 | dumbdbm.py's _Database.__del__() method attempted to close the |
| 1683 | database properly, but a shutdown race in _Database._commit() could |
| 1684 | prevent this from working, so that a program trusting __del__() to |
| 1685 | get the on-disk files in synch could be badly surprised. The race |
| 1686 | has been repaired. A sync() method was also added so that shelve |
| 1687 | can guarantee data is written to disk. |
| 1688 | |
| 1689 | The close() method can now be called more than once without complaint. |
| 1690 | |
| 1691 | - The classes in threading.py are now new-style classes. That they |
| 1692 | weren't before was an oversight. |
| 1693 | |
| 1694 | - The urllib2 digest authentication handlers now define the correct |
| 1695 | auth_header. The earlier versions would fail at runtime. |
| 1696 | |
| 1697 | - SF bug 763023: fix uncaught ZeroDivisionError in difflib ratio methods |
| 1698 | when there are no lines. |
| 1699 | |
| 1700 | - SF bug 763637: fix exception in Tkinter with after_cancel |
| 1701 | which could occur with Tk 8.4 |
| 1702 | |
| 1703 | - SF bug 770601: CGIHTTPServer.py now passes the entire environment |
| 1704 | to child processes. |
| 1705 | |
| 1706 | - SF bug 765238: add filter to fnmatch's __all__. |
| 1707 | |
| 1708 | - SF bug 748201: make time.strptime() error messages more helpful. |
| 1709 | |
| 1710 | - SF patch 764470: Do not dump the args attribute of a Fault object in |
| 1711 | xmlrpclib. |
| 1712 | |
| 1713 | - SF patch 549151: urllib and urllib2 now redirect POSTs on 301 |
| 1714 | responses. |
| 1715 | |
| 1716 | - SF patch 766650: The whichdb module was fixed to recognize dbm files |
| 1717 | generated by gdbm on OS/2 EMX. |
| 1718 | |
| 1719 | - SF bugs 763047 and 763052: fixes bug of timezone value being left as |
| 1720 | -1 when ``time.tzname[0] == time.tzname[1] and not time.daylight`` |
| 1721 | is true when it should only when time.daylight is true. |
| 1722 | |
| 1723 | - SF bug 764548: re now allows subclasses of str and unicode to be |
| 1724 | used as patterns. |
| 1725 | |
| 1726 | - SF bug 763637: In Tkinter, change after_cancel() to handle tuples |
| 1727 | of varying sizes. Tk 8.4 returns a different number of values |
| 1728 | than Tk 8.3. |
| 1729 | |
| 1730 | - SF bug 763023: difflib.ratio() did not catch zero division. |
| 1731 | |
| 1732 | - The Queue module now has an __all__ attribute. |
| 1733 | |
| 1734 | Tools/Demos |
| 1735 | ----------- |
| 1736 | |
| 1737 | - See Lib/idlelib/NEWS.txt for IDLE news. |
| 1738 | |
| 1739 | - SF bug 753592: webchecker/wsgui now handles user supplied directories. |
| 1740 | |
| 1741 | - The trace.py script has been removed. It is now in the standard library. |
| 1742 | |
| 1743 | Build |
| 1744 | ----- |
| 1745 | |
| 1746 | - Python now compiles with -fno-strict-aliasing if possible (SF bug 766696). |
| 1747 | |
| 1748 | - The socket module compiles on IRIX 6.5.10. |
| 1749 | |
| 1750 | - An irix64 system is treated the same way as an irix6 system (SF |
| 1751 | patch 764560). |
| 1752 | |
| 1753 | - Several definitions were missing on FreeBSD 5.x unless the |
| 1754 | __BSD_VISIBLE symbol was defined. configure now defines it as |
| 1755 | needed. |
| 1756 | |
| 1757 | C API |
| 1758 | ----- |
| 1759 | |
| 1760 | - Unicode objects now support mbcs as a built-in encoding, so the C |
| 1761 | API can use it without deferring to the encodings package. |
| 1762 | |
| 1763 | Windows |
| 1764 | ------- |
| 1765 | |
| 1766 | - The Windows implementation of PyThread_start_new_thread() never |
| 1767 | checked error returns from Windows functions correctly. As a result, |
| 1768 | it could claim to start a new thread even when the Microsoft |
| 1769 | _beginthread() function failed (due to "too many threads" -- this is |
| 1770 | on the order of thousands when it happens). In these cases, the |
| 1771 | Python exception :: |
| 1772 | |
| 1773 | thread.error: can't start new thread |
| 1774 | |
| 1775 | is raised now. |
| 1776 | |
| 1777 | - SF bug 766669: Prevent a GPF on interpreter exit when sockets are in |
| 1778 | use. The interpreter now calls WSACleanup() from Py_Finalize() |
| 1779 | instead of from DLL teardown. |
| 1780 | |
| 1781 | Mac |
| 1782 | --- |
| 1783 | |
| 1784 | - Bundlebuilder now inherits default values in the right way. It was |
| 1785 | previously possible for app bundles to get a type of "BNDL" instead |
| 1786 | of "APPL." Other improvements include, a --build-id option to |
| 1787 | specify the CFBundleIdentifier and using the --python option to set |
| 1788 | the executable in the bundle. |
| 1789 | |
| 1790 | - Fixed two bugs in MacOSX framework handling. |
| 1791 | |
| 1792 | - pythonw did not allow user interaction in 2.3rc1, this has been fixed. |
| 1793 | |
| 1794 | - Python is now compiled with -mno-fused-madd, making all tests pass |
| 1795 | on Panther. |
| 1796 | |
| 1797 | What's New in Python 2.3 beta 2? |
| 1798 | ================================ |
| 1799 | |
| 1800 | *Release date: 29-Jun-2003* |
| 1801 | |
| 1802 | Core and builtins |
| 1803 | ----------------- |
| 1804 | |
| 1805 | - A program can now set the environment variable PYTHONINSPECT to some |
| 1806 | string value in Python, and cause the interpreter to enter the |
| 1807 | interactive prompt at program exit, as if Python had been invoked |
| 1808 | with the -i option. |
| 1809 | |
| 1810 | - list.index() now accepts optional start and stop arguments. Similar |
| 1811 | changes were made to UserList.index(). SF feature request 754014. |
| 1812 | |
| 1813 | - SF patch 751998 fixes an unwanted side effect of the previous fix |
| 1814 | for SF bug 742860 (the next item). |
| 1815 | |
| 1816 | - SF bug 742860: "WeakKeyDictionary __delitem__ uses iterkeys". This |
| 1817 | wasn't threadsafe, was very inefficient (expected time O(len(dict)) |
| 1818 | instead of O(1)), and could raise a spurious RuntimeError if another |
| 1819 | thread mutated the dict during __delitem__, or if a comparison function |
| 1820 | mutated it. It also neglected to raise KeyError when the key wasn't |
| 1821 | present; didn't raise TypeError when the key wasn't of a weakly |
| 1822 | referencable type; and broke various more-or-less obscure dict |
| 1823 | invariants by using a sequence of equality comparisons over the whole |
| 1824 | set of dict keys instead of computing the key's hash code to narrow |
| 1825 | the search to those keys with the same hash code. All of these are |
| 1826 | considered to be bugs. A new implementation of __delitem__ repairs all |
| 1827 | that, but note that fixing these bugs may change visible behavior in |
| 1828 | code relying (whether intentionally or accidentally) on old behavior. |
| 1829 | |
| 1830 | - SF bug 734869: Fixed a compiler bug that caused a fatal error when |
| 1831 | compiling a list comprehension that contained another list comprehension |
| 1832 | embedded in a lambda expression. |
| 1833 | |
| 1834 | - SF bug 705231: builtin pow() no longer lets the platform C pow() |
| 1835 | raise -1.0 to integer powers, because (at least) glibc gets it wrong |
| 1836 | in some cases. The result should be -1.0 if the power is odd and 1.0 |
| 1837 | if the power is even, and any float with a sufficiently large exponent |
| 1838 | is (mathematically) an exact even integer. |
| 1839 | |
| 1840 | - SF bug 759227: A new-style class that implements __nonzero__() must |
| 1841 | return a bool or int (but not an int subclass) from that method. This |
| 1842 | matches the restriction on classic classes. |
| 1843 | |
| 1844 | - The encoding attribute has been added for file objects, and set to |
| 1845 | the terminal encoding on Unix and Windows. |
| 1846 | |
| 1847 | - The softspace attribute of file objects became read-only by oversight. |
| 1848 | It's writable again. |
| 1849 | |
| 1850 | - Reverted a 2.3 beta 1 change to iterators for subclasses of list and |
| 1851 | tuple. By default, the iterators now access data elements directly |
| 1852 | instead of going through __getitem__. If __getitem__ access is |
| 1853 | preferred, then __iter__ can be overridden. |
| 1854 | |
| 1855 | - SF bug 735247: The staticmethod and super types participate in |
| 1856 | garbage collection. Before this change, it was possible for leaks to |
| 1857 | occur in functions with non-global free variables that used these types. |
| 1858 | |
| 1859 | Extension modules |
| 1860 | ----------------- |
| 1861 | |
| 1862 | - the socket module has a new exception, socket.timeout, to allow |
| 1863 | timeouts to be handled separately from other socket errors. |
| 1864 | |
| 1865 | - SF bug 751276: cPickle has fixed to propagate exceptions raised in |
| 1866 | user code. In earlier versions, cPickle caught and ignored any |
| 1867 | exception when it performed operations that it expected to raise |
| 1868 | specific exceptions like AttributeError. |
| 1869 | |
| 1870 | - cPickle Pickler and Unpickler objects now participate in garbage |
| 1871 | collection. |
| 1872 | |
| 1873 | - mimetools.choose_boundary() could return duplicate strings at times, |
| 1874 | especially likely on Windows. The strings returned are now guaranteed |
| 1875 | unique within a single program run. |
| 1876 | |
| 1877 | - thread.interrupt_main() raises KeyboardInterrupt in the main thread. |
| 1878 | dummy_thread has also been modified to try to simulate the behavior. |
| 1879 | |
| 1880 | - array.array.insert() now treats negative indices as being relative |
| 1881 | to the end of the array, just like list.insert() does. (SF bug #739313) |
| 1882 | |
| 1883 | - The datetime module classes datetime, time, and timedelta are now |
| 1884 | properly subclassable. |
| 1885 | |
| 1886 | - _tkinter.{get|set}busywaitinterval was added. |
| 1887 | |
| 1888 | - itertools.islice() now accepts stop=None as documented. |
| 1889 | Fixes SF bug #730685. |
| 1890 | |
| 1891 | - the bsddb185 module is built in one restricted instance - |
| 1892 | /usr/include/db.h exists and defines HASHVERSION to be 2. This is true |
| 1893 | for many BSD-derived systems. |
| 1894 | |
| 1895 | |
| 1896 | Library |
| 1897 | ------- |
| 1898 | |
| 1899 | - Some happy doctest extensions from Jim Fulton have been added to |
| 1900 | doctest.py. These are already being used in Zope3. The two |
| 1901 | primary ones: |
| 1902 | |
| 1903 | doctest.debug(module, name) extracts the doctests from the named object |
| 1904 | in the given module, puts them in a temp file, and starts pdb running |
| 1905 | on that file. This is great when a doctest fails. |
| 1906 | |
| 1907 | doctest.DocTestSuite(module=None) returns a synthesized unittest |
| 1908 | TestSuite instance, to be run by the unittest framework, which |
| 1909 | runs all the doctests in the module. This allows writing tests in |
| 1910 | doctest style (which can be clearer and shorter than writing tests |
| 1911 | in unittest style), without losing unittest's powerful testing |
| 1912 | framework features (which doctest lacks). |
| 1913 | |
| 1914 | - For compatibility with doctests created before 2.3, if an expected |
| 1915 | output block consists solely of "1" and the actual output block |
| 1916 | consists solely of "True", it's accepted as a match; similarly |
| 1917 | for "0" and "False". This is quite un-doctest-like, but is practical. |
| 1918 | The behavior can be disabled by passing the new doctest module |
| 1919 | constant DONT_ACCEPT_TRUE_FOR_1 to the new optionflags optional |
| 1920 | argument. |
| 1921 | |
| 1922 | - ZipFile.testzip() now only traps BadZipfile exceptions. Previously, |
| 1923 | a bare except caught to much and reported all errors as a problem |
| 1924 | in the archive. |
| 1925 | |
| 1926 | - The logging module now has a new function, makeLogRecord() making |
| 1927 | LogHandler easier to interact with DatagramHandler and SocketHandler. |
| 1928 | |
| 1929 | - The cgitb module has been extended to support plain text display (SF patch |
| 1930 | 569574). |
| 1931 | |
| 1932 | - A brand new version of IDLE (from the IDLEfork project at |
| 1933 | SourceForge) is now included as Lib/idlelib. The old Tools/idle is |
| 1934 | no more. |
| 1935 | |
| 1936 | - Added a new module: trace (documentation missing). This module used |
| 1937 | to be distributed in Tools/scripts. It uses sys.settrace() to trace |
| 1938 | code execution -- either function calls or individual lines. It can |
| 1939 | generate tracing output during execution or a post-mortem report of |
| 1940 | code coverage. |
| 1941 | |
| 1942 | - The threading module has new functions settrace() and setprofile() |
| 1943 | that cooperate with the functions of the same name in the sys |
| 1944 | module. A function registered with the threading module will |
| 1945 | be used for all threads it creates. The new trace module uses this |
| 1946 | to provide tracing for code running in threads. |
| 1947 | |
| 1948 | - copy.py: applied SF patch 707900, fixing bug 702858, by Steven |
| 1949 | Taschuk. Copying a new-style class that had a reference to itself |
| 1950 | didn't work. (The same thing worked fine for old-style classes.) |
| 1951 | Builtin functions are now treated as atomic, fixing bug #746304. |
| 1952 | |
| 1953 | - difflib.py has two new functions: context_diff() and unified_diff(). |
| 1954 | |
| 1955 | - More fixes to urllib (SF 549151): (a) When redirecting, always use |
| 1956 | GET. This is common practice and more-or-less sanctioned by the |
| 1957 | HTTP standard. (b) Add a handler for 307 redirection, which becomes |
| 1958 | an error for POST, but a regular redirect for GET and HEAD |
| 1959 | |
| 1960 | - Added optional 'onerror' argument to os.walk(), to control error |
| 1961 | handling. |
| 1962 | |
| 1963 | - inspect.is{method|data}descriptor was added, to allow pydoc display |
| 1964 | __doc__ of data descriptors. |
| 1965 | |
| 1966 | - Fixed socket speed loss caused by use of the _socketobject wrapper class |
| 1967 | in socket.py. |
| 1968 | |
| 1969 | - timeit.py now checks the current directory for imports. |
| 1970 | |
| 1971 | - urllib2.py now knows how to order proxy classes, so the user doesn't |
| 1972 | have to insert it in front of other classes, nor do dirty tricks like |
| 1973 | inserting a "dummy" HTTPHandler after a ProxyHandler when building an |
| 1974 | opener with proxy support. |
| 1975 | |
| 1976 | - Iterators have been added for dbm keys. |
| 1977 | |
| 1978 | - random.Random objects can now be pickled. |
| 1979 | |
| 1980 | Tools/Demos |
| 1981 | ----------- |
| 1982 | |
| 1983 | - pydoc now offers help on keywords and topics. |
| 1984 | |
| 1985 | - Tools/idle is gone; long live Lib/idlelib. |
| 1986 | |
| 1987 | - diff.py prints file diffs in context, unified, or ndiff formats, |
| 1988 | providing a command line interface to difflib.py. |
| 1989 | |
| 1990 | - texcheck.py is a new script for making a rough validation of Python LaTeX |
| 1991 | files. |
| 1992 | |
| 1993 | Build |
| 1994 | ----- |
| 1995 | |
| 1996 | - Setting DESTDIR during 'make install' now allows specifying a |
| 1997 | different root directory. |
| 1998 | |
| 1999 | C API |
| 2000 | ----- |
| 2001 | |
| 2002 | - PyType_Ready(): If a type declares that it participates in gc |
| 2003 | (Py_TPFLAGS_HAVE_GC), and its base class does not, and its base class's |
| 2004 | tp_free slot is the default _PyObject_Del, and type does not define |
| 2005 | a tp_free slot itself, _PyObject_GC_Del is assigned to type->tp_free. |
| 2006 | Previously _PyObject_Del was inherited, which could at best lead to a |
| 2007 | segfault. In addition, if even after this magic the type's tp_free |
| 2008 | slot is _PyObject_Del or NULL, and the type is a base type |
| 2009 | (Py_TPFLAGS_BASETYPE), TypeError is raised: since the type is a base |
| 2010 | type, its dealloc function must call type->tp_free, and since the type |
| 2011 | is gc'able, tp_free must not be NULL or _PyObject_Del. |
| 2012 | |
| 2013 | - PyThreadState_SetAsyncExc(): A new API (deliberately accessible only |
| 2014 | from C) to interrupt a thread by sending it an exception. It is |
| 2015 | intentional that you have to write your own C extension to call it |
| 2016 | from Python. |
| 2017 | |
| 2018 | |
| 2019 | New platforms |
| 2020 | ------------- |
| 2021 | |
| 2022 | None this time. |
| 2023 | |
| 2024 | Tests |
| 2025 | ----- |
| 2026 | |
| 2027 | - test_imp rewritten so that it doesn't raise RuntimeError if run as a |
| 2028 | side effect of being imported ("import test.autotest"). |
| 2029 | |
| 2030 | Windows |
| 2031 | ------- |
| 2032 | |
| 2033 | - The Windows installer ships with Tcl/Tk 8.4.3 (upgraded from 8.4.1). |
| 2034 | |
| 2035 | - The installer always suggested that Python be installed on the C: |
| 2036 | drive, due to a hardcoded "C:" generated by the Wise installation |
| 2037 | wizard. People with machines where C: is not the system drive |
| 2038 | usually want Python installed on whichever drive is their system drive |
| 2039 | instead. We removed the hardcoded "C:", and two testers on machines |
| 2040 | where C: is not the system drive report that the installer now |
| 2041 | suggests their system drive. Note that you can always select the |
| 2042 | directory you want in the "Select Destination Directory" dialog -- |
| 2043 | that's what it's for. |
| 2044 | |
| 2045 | Mac |
| 2046 | --- |
| 2047 | |
| 2048 | - There's a new module called "autoGIL", which offers a mechanism to |
| 2049 | automatically release the Global Interpreter Lock when an event loop |
| 2050 | goes to sleep, allowing other threads to run. It's currently only |
| 2051 | supported on OSX, in the Mach-O version. |
| 2052 | - The OSA modules now allow direct access to properties of the |
| 2053 | toplevel application class (in AppleScript terminology). |
| 2054 | - The Package Manager can now update itself. |
| 2055 | |
| 2056 | SourceForge Bugs and Patches Applied |
| 2057 | ------------------------------------ |
| 2058 | |
| 2059 | 430160, 471893, 501716, 542562, 549151, 569574, 595837, 596434, |
| 2060 | 598163, 604210, 604716, 610332, 612627, 614770, 620190, 621891, |
| 2061 | 622042, 639139, 640236, 644345, 649742, 649742, 658233, 660022, |
| 2062 | 661318, 661676, 662807, 662923, 666219, 672855, 678325, 682347, |
| 2063 | 683486, 684981, 685773, 686254, 692776, 692959, 693094, 696777, |
| 2064 | 697989, 700827, 703666, 708495, 708604, 708901, 710733, 711902, |
| 2065 | 713722, 715782, 718286, 719359, 719367, 723136, 723831, 723962, |
| 2066 | 724588, 724767, 724767, 725942, 726150, 726446, 726869, 727051, |
| 2067 | 727719, 727719, 727805, 728277, 728563, 728656, 729096, 729103, |
| 2068 | 729293, 729297, 729300, 729317, 729395, 729622, 729817, 730170, |
| 2069 | 730296, 730594, 730685, 730826, 730963, 731209, 731403, 731504, |
| 2070 | 731514, 731626, 731635, 731643, 731644, 731644, 731689, 732124, |
| 2071 | 732143, 732234, 732284, 732284, 732479, 732761, 732783, 732951, |
| 2072 | 733667, 733781, 734118, 734231, 734869, 735051, 735293, 735527, |
| 2073 | 735613, 735694, 736962, 736962, 737970, 738066, 739313, 740055, |
| 2074 | 740234, 740301, 741806, 742126, 742741, 742860, 742860, 742911, |
| 2075 | 744041, 744104, 744238, 744687, 744877, 745055, 745478, 745525, |
| 2076 | 745620, 746012, 746304, 746366, 746801, 746953, 747348, 747667, |
| 2077 | 747954, 748846, 748849, 748973, 748975, 749191, 749210, 749759, |
| 2078 | 749831, 749911, 750008, 750092, 750542, 750595, 751038, 751107, |
| 2079 | 751276, 751451, 751916, 751941, 751956, 751998, 752671, 753451, |
| 2080 | 753602, 753617, 753845, 753925, 754014, 754340, 754447, 755031, |
| 2081 | 755087, 755147, 755245, 755683, 755987, 756032, 756996, 757058, |
| 2082 | 757229, 757818, 757821, 757822, 758112, 758910, 759227, 759889, |
| 2083 | 760257, 760703, 760792, 761104, 761337, 761519, 761830, 762455 |
| 2084 | |
| 2085 | |
| 2086 | What's New in Python 2.3 beta 1? |
| 2087 | ================================ |
| 2088 | |
| 2089 | *Release date: 25-Apr-2003* |
| 2090 | |
| 2091 | Core and builtins |
| 2092 | ----------------- |
| 2093 | |
| 2094 | - New format codes B, H, I, k and K have been implemented for |
| 2095 | PyArg_ParseTuple and PyBuild_Value. |
| 2096 | |
| 2097 | - New builtin function sum(seq, start=0) returns the sum of all the |
| 2098 | items in iterable object seq, plus start (items are normally numbers, |
| 2099 | and cannot be strings). |
| 2100 | |
| 2101 | - bool() called without arguments now returns False rather than |
| 2102 | raising an exception. This is consistent with calling the |
| 2103 | constructors for the other builtin types -- called without argument |
| 2104 | they all return the false value of that type. (SF patch #724135) |
| 2105 | |
| 2106 | - In support of PEP 269 (making the pgen parser generator accessible |
| 2107 | from Python), some changes to the pgen code structure were made; a |
| 2108 | few files that used to be linked only with pgen are now linked with |
| 2109 | Python itself. |
| 2110 | |
| 2111 | - The repr() of a weakref object now shows the __name__ attribute of |
| 2112 | the referenced object, if it has one. |
| 2113 | |
| 2114 | - super() no longer ignores data descriptors, except __class__. See |
| 2115 | the thread started at |
| 2116 | http://mail.python.org/pipermail/python-dev/2003-April/034338.html |
| 2117 | |
| 2118 | - list.insert(i, x) now interprets negative i as it would be |
| 2119 | interpreted by slicing, so negative values count from the end of the |
| 2120 | list. This was the only place where such an interpretation was not |
| 2121 | placed on a list index. |
| 2122 | |
| 2123 | - range() now works even if the arguments are longs with magnitude |
| 2124 | larger than sys.maxint, as long as the total length of the sequence |
| 2125 | fits. E.g., range(2**100, 2**101, 2**100) is the following list: |
| 2126 | [1267650600228229401496703205376L]. (SF patch #707427.) |
| 2127 | |
| 2128 | - Some horridly obscure problems were fixed involving interaction |
| 2129 | between garbage collection and old-style classes with "ambitious" |
| 2130 | getattr hooks. If an old-style instance didn't have a __del__ method, |
| 2131 | but did have a __getattr__ hook, and the instance became reachable |
| 2132 | only from an unreachable cycle, and the hook resurrected or deleted |
| 2133 | unreachable objects when asked to resolve "__del__", anything up to |
| 2134 | a segfault could happen. That's been repaired. |
| 2135 | |
| 2136 | - dict.pop now takes an optional argument specifying a default |
| 2137 | value to return if the key is not in the dict. If a default is not |
| 2138 | given and the key is not found, a KeyError will still be raised. |
| 2139 | Parallel changes were made to UserDict.UserDict and UserDict.DictMixin. |
| 2140 | [SF patch #693753] (contributed by Michael Stone.) |
| 2141 | |
| 2142 | - sys.getfilesystemencoding() was added to expose |
| 2143 | Py_FileSystemDefaultEncoding. |
| 2144 | |
| 2145 | - New function sys.exc_clear() clears the current exception. This is |
| 2146 | rarely needed, but can sometimes be useful to release objects |
| 2147 | referenced by the traceback held in sys.exc_info()[2]. (SF patch |
| 2148 | #693195.) |
| 2149 | |
| 2150 | - On 64-bit systems, a dictionary could contain duplicate long/int keys |
| 2151 | if the key value was larger than 2**32. See SF bug #689659. |
| 2152 | |
| 2153 | - Fixed SF bug #663074. The codec system was using global static |
| 2154 | variables to store internal data. As a result, any attempts to use the |
| 2155 | unicode system with multiple active interpreters, or successive |
| 2156 | interpreter executions, would fail. |
| 2157 | |
| 2158 | - "%c" % u"a" now returns a unicode string instead of raising a |
| 2159 | TypeError. u"%c" % 0xffffffff now raises a OverflowError instead |
| 2160 | of a ValueError to be consistent with "%c" % 256. See SF patch #710127. |
| 2161 | |
| 2162 | Extension modules |
| 2163 | ----------------- |
| 2164 | |
| 2165 | - The socket module now provides the functions inet_pton and inet_ntop |
| 2166 | for converting between string and packed representation of IP |
| 2167 | addresses. There is also a new module variable, has_ipv6, which is |
| 2168 | True iff the current Python has IPv6 support. See SF patch #658327. |
| 2169 | |
| 2170 | - Tkinter wrappers around Tcl variables now pass objects directly |
| 2171 | to Tcl, instead of first converting them to strings. |
| 2172 | |
| 2173 | - The .*? pattern in the re module is now special-cased to avoid the |
| 2174 | recursion limit. (SF patch #720991 -- many thanks to Gary Herron |
| 2175 | and Greg Chapman.) |
| 2176 | |
| 2177 | - New function sys.call_tracing() allows pdb to debug code |
| 2178 | recursively. |
| 2179 | |
| 2180 | - New function gc.get_referents(obj) returns a list of objects |
| 2181 | directly referenced by obj. In effect, it exposes what the object's |
| 2182 | tp_traverse slot does, and can be helpful when debugging memory |
| 2183 | leaks. |
| 2184 | |
| 2185 | - The iconv module has been removed from this release. |
| 2186 | |
| 2187 | - The platform-independent routines for packing floats in IEEE formats |
| 2188 | (struct.pack's <f, >f, <d, and >d codes; pickle and cPickle's protocol 1 |
| 2189 | pickling of floats) ignored that rounding can cause a carry to |
| 2190 | propagate. The worst consequence was that, in rare cases, <f and >f |
| 2191 | could produce strings that, when unpacked again, were a factor of 2 |
| 2192 | away from the original float. This has been fixed. See SF bug |
| 2193 | #705836. |
| 2194 | |
| 2195 | - New function time.tzset() provides access to the C library tzset() |
| 2196 | function, if supported. (SF patch #675422.) |
| 2197 | |
| 2198 | - Using createfilehandler, deletefilehandler, createtimerhandler functions |
| 2199 | on Tkinter.tkinter (_tkinter module) no longer crashes the interpreter. |
| 2200 | See SF bug #692416. |
| 2201 | |
| 2202 | - Modified the fcntl.ioctl() function to allow modification of a passed |
| 2203 | mutable buffer (for details see the reference documentation). |
| 2204 | |
| 2205 | - Made user requested changes to the itertools module. |
| 2206 | Subsumed the times() function into repeat(). |
| 2207 | Added chain() and cycle(). |
| 2208 | |
| 2209 | - The rotor module is now deprecated; the encryption algorithm it uses |
| 2210 | is not believed to be secure, and including crypto code with Python |
| 2211 | has implications for exporting and importing it in various countries. |
| 2212 | |
| 2213 | - The socket module now always uses the _socketobject wrapper class, even on |
| 2214 | platforms which have dup(2). The makefile() method is built directly |
| 2215 | on top of the socket without duplicating the file descriptor, allowing |
| 2216 | timeouts to work properly. |
| 2217 | |
| 2218 | Library |
| 2219 | ------- |
| 2220 | |
| 2221 | - New generator function os.walk() is an easy-to-use alternative to |
| 2222 | os.path.walk(). See os module docs for details. os.path.walk() |
| 2223 | isn't deprecated at this time, but may become deprecated in a |
| 2224 | future release. |
| 2225 | |
| 2226 | - Added new module "platform" which provides a wide range of tools |
| 2227 | for querying platform dependent features. |
| 2228 | |
| 2229 | - netrc now allows ASCII punctuation characters in passwords. |
| 2230 | |
| 2231 | - shelve now supports the optional writeback argument, and exposes |
| 2232 | pickle protocol versions. |
| 2233 | |
| 2234 | - Several methods of nntplib.NNTP have grown an optional file argument |
| 2235 | which specifies a file where to divert the command's output |
| 2236 | (already supported by the body() method). (SF patch #720468) |
| 2237 | |
| 2238 | - The self-documenting XML server library DocXMLRPCServer was added. |
| 2239 | |
| 2240 | - Support for internationalized domain names has been added through |
| 2241 | the 'idna' and 'punycode' encodings, the 'stringprep' module, the |
| 2242 | 'mkstringprep' tool, and enhancements to the socket and httplib |
| 2243 | modules. |
| 2244 | |
| 2245 | - htmlentitydefs has two new dictionaries: name2codepoint maps |
| 2246 | HTML entity names to Unicode codepoints (as integers). |
| 2247 | codepoint2name is the reverse mapping. See SF patch #722017. |
| 2248 | |
| 2249 | - pdb has a new command, "debug", which lets you step through |
| 2250 | arbitrary code from the debugger's (pdb) prompt. |
| 2251 | |
| 2252 | - unittest.failUnlessEqual and its equivalent unittest.assertEqual now |
| 2253 | return 'not a == b' rather than 'a != b'. This gives the desired |
| 2254 | result for classes that define __eq__ without defining __ne__. |
| 2255 | |
| 2256 | - sgmllib now supports SGML marked sections, in particular the |
| 2257 | MS Office extensions. |
| 2258 | |
| 2259 | - The urllib module now offers support for the iterator protocol. |
| 2260 | SF patch 698520 contributed by Brett Cannon. |
| 2261 | |
| 2262 | - New module timeit provides a simple framework for timing the |
| 2263 | execution speed of expressions and statements. |
| 2264 | |
| 2265 | - sets.Set objects now support mixed-type __eq__ and __ne__, instead |
| 2266 | of raising TypeError. If x is a Set object and y is a non-Set object, |
| 2267 | x == y is False, and x != y is True. This is akin to the change made |
| 2268 | for mixed-type comparisons of datetime objects in 2.3a2; more info |
| 2269 | about the rationale is in the NEWS entry for that. See also SF bug |
| 2270 | report <http://www.python.org/sf/693121>. |
| 2271 | |
| 2272 | - On Unix platforms, if os.listdir() is called with a Unicode argument, |
| 2273 | it now returns Unicode strings. (This behavior was added earlier |
| 2274 | to the Windows NT/2k/XP version of os.listdir().) |
| 2275 | |
| 2276 | - Distutils: both 'py_modules' and 'packages' keywords can now be specified |
| 2277 | in core.setup(). Previously you could supply one or the other, but |
| 2278 | not both of them. (SF patch #695090 from Bernhard Herzog) |
| 2279 | |
| 2280 | - New csv package makes it easy to read/write CSV files. |
| 2281 | |
| 2282 | - Module shlex has been extended to allow posix-like shell parsings, |
| 2283 | including a split() function for easy spliting of quoted strings and |
| 2284 | commands. An iterator interface was also implemented. |
| 2285 | |
| 2286 | Tools/Demos |
| 2287 | ----------- |
| 2288 | |
| 2289 | - New script combinerefs.py helps analyze new PYTHONDUMPREFS output. |
| 2290 | See the module docstring for details. |
| 2291 | |
| 2292 | Build |
| 2293 | ----- |
| 2294 | |
| 2295 | - Fix problem building on OSF1 because the compiler only accepted |
| 2296 | preprocessor directives that start in column 1. (SF bug #691793.) |
| 2297 | |
| 2298 | C API |
| 2299 | ----- |
| 2300 | |
| 2301 | - Added PyGC_Collect(), equivalent to calling gc.collect(). |
| 2302 | |
| 2303 | - PyThreadState_GetDict() was changed not to raise an exception or |
| 2304 | issue a fatal error when no current thread state is available. This |
| 2305 | makes it possible to print dictionaries when no thread is active. |
| 2306 | |
| 2307 | - LONG_LONG was renamed to PY_LONG_LONG. Extensions that use this and |
| 2308 | need compatibility with previous versions can use this: |
| 2309 | |
| 2310 | #ifndef PY_LONG_LONG |
| 2311 | #define PY_LONG_LONG LONG_LONG |
| 2312 | #endif |
| 2313 | |
| 2314 | - Added PyObject_SelfIter() to fill the tp_iter slot for the |
| 2315 | typical case where the method returns its self argument. |
| 2316 | |
| 2317 | - The extended type structure used for heap types (new-style |
| 2318 | classes defined by Python code using a class statement) is now |
| 2319 | exported from object.h as PyHeapTypeObject. (SF patch #696193.) |
| 2320 | |
| 2321 | New platforms |
| 2322 | ------------- |
| 2323 | |
| 2324 | None this time. |
| 2325 | |
| 2326 | Tests |
| 2327 | ----- |
| 2328 | |
| 2329 | - test_timeout now requires -u network to be passed to regrtest to run. |
| 2330 | See SF bug #692988. |
| 2331 | |
| 2332 | Windows |
| 2333 | ------- |
| 2334 | |
| 2335 | - os.fsync() now exists on Windows, and calls the Microsoft _commit() |
| 2336 | function. |
| 2337 | |
| 2338 | - New function winsound.MessageBeep() wraps the Win32 API |
| 2339 | MessageBeep(). |
| 2340 | |
| 2341 | Mac |
| 2342 | --- |
| 2343 | |
| 2344 | - os.listdir() now returns Unicode strings on MacOS X when called with |
| 2345 | a Unicode argument. See the general news item under "Library". |
| 2346 | |
| 2347 | - A new method MacOS.WMAvailable() returns true if it is safe to access |
| 2348 | the window manager, false otherwise. |
| 2349 | |
| 2350 | - EasyDialogs dialogs are now movable-modal, and if the application is |
| 2351 | currently in the background they will ask to be moved to the foreground |
| 2352 | before displaying. |
| 2353 | |
| 2354 | - OSA Scripting support has improved a lot, and gensuitemodule.py can now |
| 2355 | be used by mere mortals. The documentation is now also more or less |
| 2356 | complete. |
| 2357 | |
| 2358 | - The IDE (in a framework build) now includes introductory documentation |
| 2359 | in Apple Help Viewer format. |
| 2360 | |
| 2361 | |
| 2362 | What's New in Python 2.3 alpha 2? |
| 2363 | ================================= |
| 2364 | |
| 2365 | *Release date: 19-Feb-2003* |
| 2366 | |
| 2367 | Core and builtins |
| 2368 | ----------------- |
| 2369 | |
| 2370 | - Negative positions returned from PEP 293 error callbacks are now |
| 2371 | treated as being relative to the end of the input string. Positions |
| 2372 | that are out of bounds raise an IndexError. |
| 2373 | |
| 2374 | - sys.path[0] (the directory from which the script is loaded) is now |
| 2375 | turned into an absolute pathname, unless it is the empty string. |
| 2376 | (SF patch #664376.) |
| 2377 | |
| 2378 | - Finally fixed the bug in compile() and exec where a string ending |
| 2379 | with an indented code block but no newline would raise SyntaxError. |
| 2380 | This would have been a four-line change in parsetok.c... Except |
| 2381 | codeop.py depends on this behavior, so a compilation flag had to be |
| 2382 | invented that causes the tokenizer to revert to the old behavior; |
| 2383 | this required extra changes to 2 .h files, 2 .c files, and 2 .py |
| 2384 | files. (Fixes SF bug #501622.) |
| 2385 | |
| 2386 | - If a new-style class defines neither __new__ nor __init__, its |
| 2387 | constructor would ignore all arguments. This is changed now: the |
| 2388 | constructor refuses arguments in this case. This might break code |
| 2389 | that worked under Python 2.2. The simplest fix is to add a no-op |
| 2390 | __init__: ``def __init__(self, *args, **kw): pass``. |
| 2391 | |
| 2392 | - Through a bytecode optimizer bug (and I bet you didn't even know |
| 2393 | Python *had* a bytecode optimizer :-), "unsigned" hex/oct constants |
| 2394 | with a leading minus sign would come out with the wrong sign. |
| 2395 | ("Unsigned" hex/oct constants are those with a face value in the |
| 2396 | range sys.maxint+1 through sys.maxint*2+1, inclusive; these have |
| 2397 | always been interpreted as negative numbers through sign folding.) |
| 2398 | E.g. 0xffffffff is -1, and -(0xffffffff) is 1, but -0xffffffff would |
| 2399 | come out as -4294967295. This was the case in Python 2.2 through |
| 2400 | 2.2.2 and 2.3a1, and in Python 2.4 it will once again have that |
| 2401 | value, but according to PEP 237 it really needs to be 1 now. This |
| 2402 | will be backported to Python 2.2.3 a well. (SF #660455) |
| 2403 | |
| 2404 | - int(s, base) sometimes sign-folds hex and oct constants; it only |
| 2405 | does this when base is 0 and s.strip() starts with a '0'. When the |
| 2406 | sign is actually folded, as in int("0xffffffff", 0) on a 32-bit |
| 2407 | machine, which returns -1, a FutureWarning is now issued; in Python |
| 2408 | 2.4, this will return 4294967295L, as do int("+0xffffffff", 0) and |
| 2409 | int("0xffffffff", 16) right now. (PEP 347) |
| 2410 | |
| 2411 | - super(X, x): x may now be a proxy for an X instance, i.e. |
| 2412 | issubclass(x.__class__, X) but not issubclass(type(x), X). |
| 2413 | |
| 2414 | - isinstance(x, X): if X is a new-style class, this is now equivalent |
| 2415 | to issubclass(type(x), X) or issubclass(x.__class__, X). Previously |
| 2416 | only type(x) was tested. (For classic classes this was already the |
| 2417 | case.) |
| 2418 | |
| 2419 | - compile(), eval() and the exec statement now fully support source code |
| 2420 | passed as unicode strings. |
| 2421 | |
| 2422 | - int subclasses can be initialized with longs if the value fits in an int. |
| 2423 | See SF bug #683467. |
| 2424 | |
| 2425 | - long(string, base) takes time linear in len(string) when base is a power |
| 2426 | of 2 now. It used to take time quadratic in len(string). |
| 2427 | |
| 2428 | - filter returns now Unicode results for Unicode arguments. |
| 2429 | |
| 2430 | - raw_input can now return Unicode objects. |
| 2431 | |
| 2432 | - List objects' sort() method now accepts None as the comparison function. |
| 2433 | Passing None is semantically identical to calling sort() with no |
| 2434 | arguments. |
| 2435 | |
| 2436 | - Fixed crash when printing a subclass of str and __str__ returned self. |
| 2437 | See SF bug #667147. |
| 2438 | |
| 2439 | - Fixed an invalid RuntimeWarning and an undetected error when trying |
| 2440 | to convert a long integer into a float which couldn't fit. |
| 2441 | See SF bug #676155. |
| 2442 | |
| 2443 | - Function objects now have a __module__ attribute that is bound to |
| 2444 | the name of the module in which the function was defined. This |
| 2445 | applies for C functions and methods as well as functions and methods |
| 2446 | defined in Python. This attribute is used by pickle.whichmodule(), |
| 2447 | which changes the behavior of whichmodule slightly. In Python 2.2 |
| 2448 | whichmodule() returns "__main__" for functions that are not defined |
| 2449 | at the top-level of a module (examples: methods, nested functions). |
| 2450 | Now whichmodule() will return the proper module name. |
| 2451 | |
| 2452 | Extension modules |
| 2453 | ----------------- |
| 2454 | |
| 2455 | - operator.isNumberType() now checks that the object has a nb_int or |
| 2456 | nb_float slot, rather than simply checking whether it has a non-NULL |
| 2457 | tp_as_number pointer. |
| 2458 | |
| 2459 | - The imp module now has ways to acquire and release the "import |
| 2460 | lock": imp.acquire_lock() and imp.release_lock(). Note: this is a |
| 2461 | reentrant lock, so releasing the lock only truly releases it when |
| 2462 | this is the last release_lock() call. You can check with |
| 2463 | imp.lock_held(). (SF bug #580952 and patch #683257.) |
| 2464 | |
| 2465 | - Change to cPickle to match pickle.py (see below and PEP 307). |
| 2466 | |
| 2467 | - Fix some bugs in the parser module. SF bug #678518. |
| 2468 | |
| 2469 | - Thanks to Scott David Daniels, a subtle bug in how the zlib |
| 2470 | extension implemented flush() was fixed. Scott also rewrote the |
| 2471 | zlib test suite using the unittest module. (SF bug #640230 and |
| 2472 | patch #678531.) |
| 2473 | |
| 2474 | - Added an itertools module containing high speed, memory efficient |
| 2475 | looping constructs inspired by tools from Haskell and SML. |
| 2476 | |
| 2477 | - The SSL module now handles sockets with a timeout set correctly (SF |
| 2478 | patch #675750, fixing SF bug #675552). |
| 2479 | |
| 2480 | - os/posixmodule has grown the sysexits.h constants (EX_OK and friends). |
| 2481 | |
| 2482 | - Fixed broken threadstate swap in readline that could cause fatal |
| 2483 | errors when a readline hook was being invoked while a background |
| 2484 | thread was active. (SF bugs #660476 and #513033.) |
| 2485 | |
| 2486 | - fcntl now exposes the strops.h I_* constants. |
| 2487 | |
| 2488 | - Fix a crash on Solaris that occurred when calling close() on |
| 2489 | an mmap'ed file which was already closed. (SF patch #665913) |
| 2490 | |
| 2491 | - Fixed several serious bugs in the zipimport implementation. |
| 2492 | |
| 2493 | - datetime changes: |
| 2494 | |
| 2495 | The date class is now properly subclassable. (SF bug #720908) |
| 2496 | |
| 2497 | The datetime and datetimetz classes have been collapsed into a single |
| 2498 | datetime class, and likewise the time and timetz classes into a single |
| 2499 | time class. Previously, a datetimetz object with tzinfo=None acted |
| 2500 | exactly like a datetime object, and similarly for timetz. This wasn't |
| 2501 | enough of a difference to justify distinct classes, and life is simpler |
| 2502 | now. |
| 2503 | |
| 2504 | today() and now() now round system timestamps to the closest |
| 2505 | microsecond <http://www.python.org/sf/661086>. This repairs an |
| 2506 | irritation most likely seen on Windows systems. |
| 2507 | |
| 2508 | In dt.astimezone(tz), if tz.utcoffset(dt) returns a duration, |
| 2509 | ValueError is raised if tz.dst(dt) returns None (2.3a1 treated it |
| 2510 | as 0 instead, but a tzinfo subclass wishing to participate in |
| 2511 | time zone conversion has to take a stand on whether it supports |
| 2512 | DST; if you don't care about DST, then code dst() to return 0 minutes, |
| 2513 | meaning that DST is never in effect). |
| 2514 | |
| 2515 | The tzinfo methods utcoffset() and dst() must return a timedelta object |
| 2516 | (or None) now. In 2.3a1 they could also return an int or long, but that |
| 2517 | was an unhelpfully redundant leftover from an earlier version wherein |
| 2518 | they couldn't return a timedelta. TOOWTDI. |
| 2519 | |
| 2520 | The example tzinfo class for local time had a bug. It was replaced |
| 2521 | by a later example coded by Guido. |
| 2522 | |
| 2523 | datetime.astimezone(tz) no longer raises an exception when the |
| 2524 | input datetime has no UTC equivalent in tz. For typical "hybrid" time |
| 2525 | zones (a single tzinfo subclass modeling both standard and daylight |
| 2526 | time), this case can arise one hour per year, at the hour daylight time |
| 2527 | ends. See new docs for details. In short, the new behavior mimics |
| 2528 | the local wall clock's behavior of repeating an hour in local time. |
| 2529 | |
| 2530 | dt.astimezone() can no longer be used to convert between naive and aware |
| 2531 | datetime objects. If you merely want to attach, or remove, a tzinfo |
| 2532 | object, without any conversion of date and time members, use |
| 2533 | dt.replace(tzinfo=whatever) instead, where "whatever" is None or a |
| 2534 | tzinfo subclass instance. |
| 2535 | |
| 2536 | A new method tzinfo.fromutc(dt) can be overridden in tzinfo subclasses |
| 2537 | to give complete control over how a UTC time is to be converted to |
| 2538 | a local time. The default astimezone() implementation calls fromutc() |
| 2539 | as its last step, so a tzinfo subclass can affect that too by overriding |
| 2540 | fromutc(). It's expected that the default fromutc() implementation will |
| 2541 | be suitable as-is for "almost all" time zone subclasses, but the |
| 2542 | creativity of political time zone fiddling appears unbounded -- fromutc() |
| 2543 | allows the highly motivated to emulate any scheme expressible in Python. |
| 2544 | |
| 2545 | datetime.now(): The optional tzinfo argument was undocumented (that's |
| 2546 | repaired), and its name was changed to tz ("tzinfo" is overloaded enough |
| 2547 | already). With a tz argument, now(tz) used to return the local date |
| 2548 | and time, and attach tz to it, without any conversion of date and time |
| 2549 | members. This was less than useful. Now now(tz) returns the current |
| 2550 | date and time as local time in tz's time zone, akin to :: |
| 2551 | |
| 2552 | tz.fromutc(datetime.utcnow().replace(tzinfo=utc)) |
| 2553 | |
| 2554 | where "utc" is an instance of a tzinfo subclass modeling UTC. Without |
| 2555 | a tz argument, now() continues to return the current local date and time, |
| 2556 | as a naive datetime object. |
| 2557 | |
| 2558 | datetime.fromtimestamp(): Like datetime.now() above, this had less than |
| 2559 | useful behavior when the optional tinzo argument was specified. See |
| 2560 | also SF bug report <http://www.python.org/sf/660872>. |
| 2561 | |
| 2562 | date and datetime comparison: In order to prevent comparison from |
| 2563 | falling back to the default compare-object-addresses strategy, these |
| 2564 | raised TypeError whenever they didn't understand the other object type. |
| 2565 | They still do, except when the other object has a "timetuple" attribute, |
| 2566 | in which case they return NotImplemented now. This gives other |
| 2567 | datetime objects (e.g., mxDateTime) a chance to intercept the |
| 2568 | comparison. |
| 2569 | |
| 2570 | date, time, datetime and timedelta comparison: When the exception |
| 2571 | for mixed-type comparisons in the last paragraph doesn't apply, if |
| 2572 | the comparison is == then False is returned, and if the comparison is |
| 2573 | != then True is returned. Because dict lookup and the "in" operator |
| 2574 | only invoke __eq__, this allows, for example, :: |
| 2575 | |
| 2576 | if some_datetime in some_sequence: |
| 2577 | |
| 2578 | and :: |
| 2579 | |
| 2580 | some_dict[some_timedelta] = whatever |
| 2581 | |
| 2582 | to work as expected, without raising TypeError just because the |
| 2583 | sequence is heterogeneous, or the dict has mixed-type keys. [This |
| 2584 | seems like a good idea to implement for all mixed-type comparisons |
| 2585 | that don't want to allow falling back to address comparison.] |
| 2586 | |
| 2587 | The constructors building a datetime from a timestamp could raise |
| 2588 | ValueError if the platform C localtime()/gmtime() inserted "leap |
| 2589 | seconds". Leap seconds are ignored now. On such platforms, it's |
| 2590 | possible to have timestamps that differ by a second, yet where |
| 2591 | datetimes constructed from them are equal. |
| 2592 | |
| 2593 | The pickle format of date, time and datetime objects has changed |
| 2594 | completely. The undocumented pickler and unpickler functions no |
| 2595 | longer exist. The undocumented __setstate__() and __getstate__() |
| 2596 | methods no longer exist either. |
| 2597 | |
| 2598 | Library |
| 2599 | ------- |
| 2600 | |
| 2601 | - The logging module was updated slightly; the WARN level was renamed |
| 2602 | to WARNING, and the matching function/method warn() to warning(). |
| 2603 | |
| 2604 | - The pickle and cPickle modules were updated with a new pickling |
| 2605 | protocol (documented by pickletools.py, see below) and several |
| 2606 | extensions to the pickle customization API (__reduce__, __setstate__ |
| 2607 | etc.). The copy module now uses more of the pickle customization |
| 2608 | API to copy objects that don't implement __copy__ or __deepcopy__. |
| 2609 | See PEP 307 for details. |
| 2610 | |
| 2611 | - The distutils "register" command now uses http://www.python.org/pypi |
| 2612 | as the default repository. (See PEP 301.) |
| 2613 | |
| 2614 | - the platform dependent path related variables sep, altsep, extsep, |
| 2615 | pathsep, curdir, pardir and defpath are now defined in the platform |
| 2616 | dependent path modules (e.g. ntpath.py) rather than os.py, so these |
| 2617 | variables are now available via os.path. They continue to be |
| 2618 | available from the os module. |
| 2619 | (see <http://www.python.org/sf/680789>). |
| 2620 | |
| 2621 | - array.array was added to the types repr.py knows about (see |
| 2622 | <http://www.python.org/sf/680789>). |
| 2623 | |
| 2624 | - The new pickletools.py contains lots of documentation about pickle |
| 2625 | internals, and supplies some helpers for working with pickles, such as |
| 2626 | a symbolic pickle disassembler. |
| 2627 | |
| 2628 | - Xmlrpclib.py now supports the builtin boolean type. |
| 2629 | |
| 2630 | - py_compile has a new 'doraise' flag and a new PyCompileError |
| 2631 | exception. |
| 2632 | |
| 2633 | - SimpleXMLRPCServer now supports CGI through the CGIXMLRPCRequestHandler |
| 2634 | class. |
| 2635 | |
| 2636 | - The sets module now raises TypeError in __cmp__, to clarify that |
| 2637 | sets are not intended to be three-way-compared; the comparison |
| 2638 | operators are overloaded as subset/superset tests. |
| 2639 | |
| 2640 | - Bastion.py and rexec.py are disabled. These modules are not safe in |
| 2641 | Python 2.2. or 2.3. |
| 2642 | |
| 2643 | - realpath is now exported when doing ``from poxixpath import *``. |
| 2644 | It is also exported for ntpath, macpath, and os2emxpath. |
| 2645 | See SF bug #659228. |
| 2646 | |
| 2647 | - New module tarfile from Lars Gustäbel provides a comprehensive interface |
| 2648 | to tar archive files with transparent gzip and bzip2 compression. |
| 2649 | See SF patch #651082. |
| 2650 | |
| 2651 | - urlparse can now parse imap:// URLs. See SF feature request #618024. |
| 2652 | |
| 2653 | - Tkinter.Canvas.scan_dragto() provides an optional parameter to support |
| 2654 | the gain value which is passed to Tk. SF bug# 602259. |
| 2655 | |
| 2656 | - Fix logging.handlers.SysLogHandler protocol when using UNIX domain sockets. |
| 2657 | See SF patch #642974. |
| 2658 | |
| 2659 | - The dospath module was deleted. Use the ntpath module when manipulating |
| 2660 | DOS paths from other platforms. |
| 2661 | |
| 2662 | Tools/Demos |
| 2663 | ----------- |
| 2664 | |
| 2665 | - Two new scripts (db2pickle.py and pickle2db.py) were added to the |
| 2666 | Tools/scripts directory to facilitate conversion from the old bsddb module |
| 2667 | to the new one. While the user-visible API of the new module is |
| 2668 | compatible with the old one, it's likely that the version of the |
| 2669 | underlying database library has changed. To convert from the old library, |
| 2670 | run the db2pickle.py script using the old version of Python to convert it |
| 2671 | to a pickle file. After upgrading Python, run the pickle2db.py script |
| 2672 | using the new version of Python to reconstitute your database. For |
| 2673 | example: |
| 2674 | |
| 2675 | % python2.2 db2pickle.py -h some.db > some.pickle |
| 2676 | % python2.3 pickle2db.py -h some.db.new < some.pickle |
| 2677 | |
| 2678 | Run the scripts without any args to get a usage message. |
| 2679 | |
| 2680 | |
| 2681 | Build |
| 2682 | ----- |
| 2683 | |
| 2684 | - The audio driver tests (test_ossaudiodev.py and |
| 2685 | test_linuxaudiodev.py) are no longer run by default. This is |
| 2686 | because they don't always work, depending on your hardware and |
| 2687 | software. To run these tests, you must use an invocation like :: |
| 2688 | |
| 2689 | ./python Lib/test/regrtest.py -u audio test_ossaudiodev |
| 2690 | |
| 2691 | - On systems which build using the configure script, compiler flags which |
| 2692 | used to be lumped together using the OPT flag have been split into two |
| 2693 | groups, OPT and BASECFLAGS. OPT is meant to carry just optimization- and |
| 2694 | debug-related flags like "-g" and "-O3". BASECFLAGS is meant to carry |
| 2695 | compiler flags that are required to get a clean compile. On some |
| 2696 | platforms (many Linux flavors in particular) BASECFLAGS will be empty by |
| 2697 | default. On others, such as Mac OS X and SCO, it will contain required |
| 2698 | flags. This change allows people building Python to override OPT without |
| 2699 | fear of clobbering compiler flags which are required to get a clean build. |
| 2700 | |
| 2701 | - On Darwin/Mac OS X platforms, /sw/lib and /sw/include are added to the |
| 2702 | relevant search lists in setup.py. This allows users building Python to |
| 2703 | take advantage of the many packages available from the fink project |
| 2704 | <http://fink.sf.net/>. |
| 2705 | |
| 2706 | - A new Makefile target, scriptsinstall, installs a number of useful scripts |
| 2707 | from the Tools/scripts directory. |
| 2708 | |
| 2709 | C API |
| 2710 | ----- |
| 2711 | |
| 2712 | - PyEval_GetFrame() is now declared to return a ``PyFrameObject *`` |
| 2713 | instead of a plain ``PyObject *``. (SF patch #686601.) |
| 2714 | |
| 2715 | - PyNumber_Check() now checks that the object has a nb_int or nb_float |
| 2716 | slot, rather than simply checking whether it has a non-NULL |
| 2717 | tp_as_number pointer. |
| 2718 | |
| 2719 | - A C type that inherits from a base type that defines tp_as_buffer |
| 2720 | will now inherit the tp_as_buffer pointer if it doesn't define one. |
| 2721 | (SF #681367) |
| 2722 | |
| 2723 | - The PyArg_Parse functions now issue a DeprecationWarning if a float |
| 2724 | argument is provided when an integer is specified (this affects the 'b', |
| 2725 | 'B', 'h', 'H', 'i', and 'l' codes). Future versions of Python will |
| 2726 | raise a TypeError. |
| 2727 | |
| 2728 | Tests |
| 2729 | ----- |
| 2730 | |
| 2731 | - Several tests weren't being run from regrtest.py (test_timeout.py, |
| 2732 | test_tarfile.py, test_netrc.py, test_multifile.py, |
| 2733 | test_importhooks.py and test_imp.py). Now they are. (Note to |
| 2734 | developers: please read Lib/test/README when creating a new test, to |
| 2735 | make sure to do it right! All tests need to use either unittest or |
| 2736 | pydoc.) |
| 2737 | |
| 2738 | - Added test_posix.py, a test suite for the posix module. |
| 2739 | |
| 2740 | - Added test_hexoct.py, a test suite for hex/oct constant folding. |
| 2741 | |
| 2742 | Windows |
| 2743 | ------- |
| 2744 | |
| 2745 | - The timeout code for socket connect() didn't work right; this has |
| 2746 | now been fixed. test_timeout.py should pass (at least most of the |
| 2747 | time). |
| 2748 | |
| 2749 | - distutils' msvccompiler class now passes the preprocessor options to |
| 2750 | the resource compiler. See SF patch #669198. |
| 2751 | |
| 2752 | - The bsddb module now ships with Sleepycat's 4.1.25.NC, the latest |
| 2753 | release without strong cryptography. |
| 2754 | |
| 2755 | - sys.path[0], if it contains a directory name, is now always an |
| 2756 | absolute pathname. (SF patch #664376.) |
| 2757 | |
| 2758 | - The new logging package is now installed by the Windows installer. It |
| 2759 | wasn't in 2.3a1 due to oversight. |
| 2760 | |
| 2761 | Mac |
| 2762 | --- |
| 2763 | |
| 2764 | - There are new dialogs EasyDialogs.AskFileForOpen, AskFileForSave |
| 2765 | and AskFolder. The old macfs.StandardGetFile and friends are deprecated. |
| 2766 | |
| 2767 | - Most of the standard library now uses pathnames or FSRefs in preference |
| 2768 | of FSSpecs, and use the underlying Carbon.File and Carbon.Folder modules |
| 2769 | in stead of macfs. macfs will probably be deprecated in the future. |
| 2770 | |
| 2771 | - Type Carbon.File.FSCatalogInfo and supporting methods have been implemented. |
| 2772 | This also makes macfs.FSSpec.SetDates() work again. |
| 2773 | |
| 2774 | - There is a new module pimp, the package install manager for Python, and |
| 2775 | accompanying applet PackageManager. These allow you to easily download |
| 2776 | and install pretested extension packages either in source or binary |
| 2777 | form. Only in MacPython-OSX. |
| 2778 | |
| 2779 | - Applets are now built with bundlebuilder in MacPython-OSX, which should make |
| 2780 | them more robust and also provides a path towards BuildApplication. The |
| 2781 | downside of this change is that applets can no longer be run from the |
| 2782 | Terminal window, this will hopefully be fixed in the 2.3b1. |
| 2783 | |
| 2784 | |
| 2785 | What's New in Python 2.3 alpha 1? |
| 2786 | ================================= |
| 2787 | |
| 2788 | *Release date: 31-Dec-2002* |
| 2789 | |
| 2790 | Type/class unification and new-style classes |
| 2791 | -------------------------------------------- |
| 2792 | |
| 2793 | - One can now assign to __bases__ and __name__ of new-style classes. |
| 2794 | |
| 2795 | - dict() now accepts keyword arguments so that dict(one=1, two=2) |
| 2796 | is the equivalent of {"one": 1, "two": 2}. Accordingly, |
| 2797 | the existing (but undocumented) 'items' keyword argument has |
| 2798 | been eliminated. This means that dict(items=someMapping) now has |
| 2799 | a different meaning than before. |
| 2800 | |
| 2801 | - int() now returns a long object if the argument is outside the |
| 2802 | integer range, so int("4" * 1000), int(1e200) and int(1L<<1000) will |
| 2803 | all return long objects instead of raising an OverflowError. |
| 2804 | |
| 2805 | - Assignment to __class__ is disallowed if either the old or the new |
| 2806 | class is a statically allocated type object (such as defined by an |
| 2807 | extension module). This prevents anomalies like 2.__class__ = bool. |
| 2808 | |
| 2809 | - New-style object creation and deallocation have been sped up |
| 2810 | significantly; they are now faster than classic instance creation |
| 2811 | and deallocation. |
| 2812 | |
| 2813 | - The __slots__ variable can now mention "private" names, and the |
| 2814 | right thing will happen (e.g. __slots__ = ["__foo"]). |
| 2815 | |
| 2816 | - The built-ins slice() and buffer() are now callable types. The |
| 2817 | types classobj (formerly class), code, function, instance, and |
| 2818 | instancemethod (formerly instance-method), which have no built-in |
| 2819 | names but are accessible through the types module, are now also |
| 2820 | callable. The type dict-proxy is renamed to dictproxy. |
| 2821 | |
| 2822 | - Cycles going through the __class__ link of a new-style instance are |
| 2823 | now detected by the garbage collector. |
| 2824 | |
| 2825 | - Classes using __slots__ are now properly garbage collected. |
| 2826 | [SF bug 519621] |
| 2827 | |
| 2828 | - Tightened the __slots__ rules: a slot name must be a valid Python |
| 2829 | identifier. |
| 2830 | |
| 2831 | - The constructor for the module type now requires a name argument and |
| 2832 | takes an optional docstring argument. Previously, this constructor |
| 2833 | ignored its arguments. As a consequence, deriving a class from a |
| 2834 | module (not from the module type) is now illegal; previously this |
| 2835 | created an unnamed module, just like invoking the module type did. |
| 2836 | [SF bug 563060] |
| 2837 | |
| 2838 | - A new type object, 'basestring', is added. This is a common base type |
| 2839 | for 'str' and 'unicode', and can be used instead of |
| 2840 | types.StringTypes, e.g. to test whether something is "a string": |
| 2841 | isinstance(x, basestring) is True for Unicode and 8-bit strings. This |
| 2842 | is an abstract base class and cannot be instantiated directly. |
| 2843 | |
| 2844 | - Changed new-style class instantiation so that when C's __new__ |
| 2845 | method returns something that's not a C instance, its __init__ is |
| 2846 | not called. [SF bug #537450] |
| 2847 | |
| 2848 | - Fixed super() to work correctly with class methods. [SF bug #535444] |
| 2849 | |
| 2850 | - If you try to pickle an instance of a class that has __slots__ but |
| 2851 | doesn't define or override __getstate__, a TypeError is now raised. |
| 2852 | This is done by adding a bozo __getstate__ to the class that always |
| 2853 | raises TypeError. (Before, this would appear to be pickled, but the |
| 2854 | state of the slots would be lost.) |
| 2855 | |
| 2856 | Core and builtins |
| 2857 | ----------------- |
| 2858 | |
| 2859 | - Import from zipfiles is now supported. The name of a zipfile placed |
| 2860 | on sys.path causes the import statement to look for importable Python |
| 2861 | modules (with .py, pyc and .pyo extensions) and packages inside the |
| 2862 | zipfile. The zipfile import follows the specification (though not |
| 2863 | the sample implementation) of PEP 273. The semantics of __path__ are |
| 2864 | compatible with those that have been implemented in Jython since |
| 2865 | Jython 2.1. |
| 2866 | |
| 2867 | - PEP 302 has been accepted. Although it was initially developed to |
| 2868 | support zipimport, it offers a new, general import hook mechanism. |
| 2869 | Several new variables have been added to the sys module: |
| 2870 | sys.meta_path, sys.path_hooks, and sys.path_importer_cache; these |
| 2871 | make extending the import statement much more convenient than |
| 2872 | overriding the __import__ built-in function. For a description of |
| 2873 | these, see PEP 302. |
| 2874 | |
| 2875 | - A frame object's f_lineno attribute can now be written to from a |
| 2876 | trace function to change which line will execute next. A command to |
| 2877 | exploit this from pdb has been added. [SF patch #643835] |
| 2878 | |
| 2879 | - The _codecs support module for codecs.py was turned into a builtin |
| 2880 | module to assure that at least the builtin codecs are available |
| 2881 | to the Python parser for source code decoding according to PEP 263. |
| 2882 | |
| 2883 | - issubclass now supports a tuple as the second argument, just like |
| 2884 | isinstance does. ``issubclass(X, (A, B))`` is equivalent to |
| 2885 | ``issubclass(X, A) or issubclass(X, B)``. |
| 2886 | |
| 2887 | - Thanks to Armin Rigo, the last known way to provoke a system crash |
| 2888 | by cleverly arranging for a comparison function to mutate a list |
| 2889 | during a list.sort() operation has been fixed. The effect of |
| 2890 | attempting to mutate a list, or even to inspect its contents or |
| 2891 | length, while a sort is in progress, is not defined by the language. |
| 2892 | The C implementation of Python 2.3 attempts to detect mutations, |
| 2893 | and raise ValueError if one occurs, but there's no guarantee that |
| 2894 | all mutations will be caught, or that any will be caught across |
| 2895 | releases or implementations. |
| 2896 | |
| 2897 | - Unicode file name processing for Windows (PEP 277) is implemented. |
| 2898 | All platforms now have an os.path.supports_unicode_filenames attribute, |
| 2899 | which is set to True on Windows NT/2000/XP, and False elsewhere. |
| 2900 | |
| 2901 | - Codec error handling callbacks (PEP 293) are implemented. |
| 2902 | Error handling in unicode.encode or str.decode can now be customized. |
| 2903 | |
| 2904 | - A subtle change to the semantics of the built-in function intern(): |
| 2905 | interned strings are no longer immortal. You must keep a reference |
| 2906 | to the return value intern() around to get the benefit. |
| 2907 | |
| 2908 | - Use of 'None' as a variable, argument or attribute name now |
| 2909 | issues a SyntaxWarning. In the future, None may become a keyword. |
| 2910 | |
| 2911 | - SET_LINENO is gone. co_lnotab is now consulted to determine when to |
| 2912 | call the trace function. C code that accessed f_lineno should call |
| 2913 | PyCode_Addr2Line instead (f_lineno is still there, but only kept up |
| 2914 | to date when there is a trace function set). |
| 2915 | |
| 2916 | - There's a new warning category, FutureWarning. This is used to warn |
| 2917 | about a number of situations where the value or sign of an integer |
| 2918 | result will change in Python 2.4 as a result of PEP 237 (integer |
| 2919 | unification). The warnings implement stage B0 mentioned in that |
| 2920 | PEP. The warnings are about the following situations: |
| 2921 | |
| 2922 | - Octal and hex literals without 'L' prefix in the inclusive range |
| 2923 | [0x80000000..0xffffffff]; these are currently negative ints, but |
| 2924 | in Python 2.4 they will be positive longs with the same bit |
| 2925 | pattern. |
| 2926 | |
| 2927 | - Left shifts on integer values that cause the outcome to lose |
| 2928 | bits or have a different sign than the left operand. To be |
| 2929 | precise: x<<n where this currently doesn't yield the same value |
| 2930 | as long(x)<<n; in Python 2.4, the outcome will be long(x)<<n. |
| 2931 | |
| 2932 | - Conversions from ints to string that show negative values as |
| 2933 | unsigned ints in the inclusive range [0x80000000..0xffffffff]; |
| 2934 | this affects the functions hex() and oct(), and the string |
| 2935 | formatting codes %u, %o, %x, and %X. In Python 2.4, these will |
| 2936 | show signed values (e.g. hex(-1) currently returns "0xffffffff"; |
| 2937 | in Python 2.4 it will return "-0x1"). |
| 2938 | |
| 2939 | - The bits manipulated under the cover by sys.setcheckinterval() have |
| 2940 | been changed. Both the check interval and the ticker used to be |
| 2941 | per-thread values. They are now just a pair of global variables. |
| 2942 | In addition, the default check interval was boosted from 10 to 100 |
| 2943 | bytecode instructions. This may have some effect on systems that |
| 2944 | relied on the old default value. In particular, in multi-threaded |
| 2945 | applications which try to be highly responsive, response time will |
| 2946 | increase by some (perhaps imperceptible) amount. |
| 2947 | |
| 2948 | - When multiplying very large integers, a version of the so-called |
| 2949 | Karatsuba algorithm is now used. This is most effective if the |
| 2950 | inputs have roughly the same size. If they both have about N digits, |
| 2951 | Karatsuba multiplication has O(N**1.58) runtime (the exponent is |
| 2952 | log_base_2(3)) instead of the previous O(N**2). Measured results may |
| 2953 | be better or worse than that, depending on platform quirks. Besides |
| 2954 | the O() improvement in raw instruction count, the Karatsuba algorithm |
| 2955 | appears to have much better cache behavior on extremely large integers |
| 2956 | (starting in the ballpark of a million bits). Note that this is a |
| 2957 | simple implementation, and there's no intent here to compete with, |
| 2958 | e.g., GMP. It gives a very nice speedup when it applies, but a package |
| 2959 | devoted to fast large-integer arithmetic should run circles around it. |
| 2960 | |
| 2961 | - u'%c' will now raise a ValueError in case the argument is an |
| 2962 | integer outside the valid range of Unicode code point ordinals. |
| 2963 | |
| 2964 | - The tempfile module has been overhauled for enhanced security. The |
| 2965 | mktemp() function is now deprecated; new, safe replacements are |
| 2966 | mkstemp() (for files) and mkdtemp() (for directories), and the |
| 2967 | higher-level functions NamedTemporaryFile() and TemporaryFile(). |
| 2968 | Use of some global variables in this module is also deprecated; the |
| 2969 | new functions have keyword arguments to provide the same |
| 2970 | functionality. All Lib, Tools and Demo modules that used the unsafe |
| 2971 | interfaces have been updated to use the safe replacements. Thanks |
| 2972 | to Zack Weinberg! |
| 2973 | |
| 2974 | - When x is an object whose class implements __mul__ and __rmul__, |
| 2975 | 1.0*x would correctly invoke __rmul__, but 1*x would erroneously |
| 2976 | invoke __mul__. This was due to the sequence-repeat code in the int |
| 2977 | type. This has been fixed now. |
| 2978 | |
| 2979 | - Previously, "str1 in str2" required str1 to be a string of length 1. |
| 2980 | This restriction has been relaxed to allow str1 to be a string of |
| 2981 | any length. Thus "'el' in 'hello world'" returns True now. |
| 2982 | |
| 2983 | - File objects are now their own iterators. For a file f, iter(f) now |
| 2984 | returns f (unless f is closed), and f.next() is similar to |
| 2985 | f.readline() when EOF is not reached; however, f.next() uses a |
| 2986 | readahead buffer that messes up the file position, so mixing |
| 2987 | f.next() and f.readline() (or other methods) doesn't work right. |
| 2988 | Calling f.seek() drops the readahead buffer, but other operations |
| 2989 | don't. It so happens that this gives a nice additional speed boost |
| 2990 | to "for line in file:"; the xreadlines method and corresponding |
| 2991 | module are now obsolete. Thanks to Oren Tirosh! |
| 2992 | |
| 2993 | - Encoding declarations (PEP 263, phase 1) have been implemented. A |
| 2994 | comment of the form "# -*- coding: <encodingname> -*-" in the first |
| 2995 | or second line of a Python source file indicates the encoding. |
| 2996 | |
| 2997 | - list.sort() has a new implementation. While cross-platform results |
| 2998 | may vary, and in data-dependent ways, this is much faster on many |
| 2999 | kinds of partially ordered lists than the previous implementation, |
| 3000 | and reported to be just as fast on randomly ordered lists on |
| 3001 | several major platforms. This sort is also stable (if A==B and A |
| 3002 | precedes B in the list at the start, A precedes B after the sort too), |
| 3003 | although the language definition does not guarantee stability. A |
| 3004 | potential drawback is that list.sort() may require temp space of |
| 3005 | len(list)*2 bytes (``*4`` on a 64-bit machine). It's therefore possible |
| 3006 | for list.sort() to raise MemoryError now, even if a comparison function |
| 3007 | does not. See <http://www.python.org/sf/587076> for full details. |
| 3008 | |
| 3009 | - All standard iterators now ensure that, once StopIteration has been |
| 3010 | raised, all future calls to next() on the same iterator will also |
| 3011 | raise StopIteration. There used to be various counterexamples to |
| 3012 | this behavior, which could caused confusion or subtle program |
| 3013 | breakage, without any benefits. (Note that this is still an |
| 3014 | iterator's responsibility; the iterator framework does not enforce |
| 3015 | this.) |
| 3016 | |
| 3017 | - Ctrl+C handling on Windows has been made more consistent with |
| 3018 | other platforms. KeyboardInterrupt can now reliably be caught, |
| 3019 | and Ctrl+C at an interactive prompt no longer terminates the |
| 3020 | process under NT/2k/XP (it never did under Win9x). Ctrl+C will |
| 3021 | interrupt time.sleep() in the main thread, and any child processes |
| 3022 | created via the popen family (on win2k; we can't make win9x work |
| 3023 | reliably) are also interrupted (as generally happens on for Linux/Unix.) |
| 3024 | [SF bugs 231273, 439992 and 581232] |
| 3025 | |
| 3026 | - sys.getwindowsversion() has been added on Windows. This |
| 3027 | returns a tuple with information about the version of Windows |
| 3028 | currently running. |
| 3029 | |
| 3030 | - Slices and repetitions of buffer objects now consistently return |
| 3031 | a string. Formerly, strings would be returned most of the time, |
| 3032 | but a buffer object would be returned when the repetition count |
| 3033 | was one or when the slice range was all inclusive. |
| 3034 | |
| 3035 | - Unicode objects in sys.path are no longer ignored but treated |
| 3036 | as directory names. |
| 3037 | |
| 3038 | - Fixed string.startswith and string.endswith builtin methods |
| 3039 | so they accept negative indices. [SF bug 493951] |
| 3040 | |
| 3041 | - Fixed a bug with a continue inside a try block and a yield in the |
| 3042 | finally clause. [SF bug 567538] |
| 3043 | |
| 3044 | - Most builtin sequences now support "extended slices", i.e. slices |
| 3045 | with a third "stride" parameter. For example, "hello world"[::-1] |
| 3046 | gives "dlrow olleh". |
| 3047 | |
| 3048 | - A new warning PendingDeprecationWarning was added to provide |
| 3049 | direction on features which are in the process of being deprecated. |
| 3050 | The warning will not be printed by default. To see the pending |
| 3051 | deprecations, use -Walways::PendingDeprecationWarning:: |
| 3052 | as a command line option or warnings.filterwarnings() in code. |
| 3053 | |
| 3054 | - Deprecated features of xrange objects have been removed as |
| 3055 | promised. The start, stop, and step attributes and the tolist() |
| 3056 | method no longer exist. xrange repetition and slicing have been |
| 3057 | removed. |
| 3058 | |
| 3059 | - New builtin function enumerate(x), from PEP 279. Example: |
| 3060 | enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c"). |
| 3061 | The argument can be an arbitrary iterable object. |
| 3062 | |
| 3063 | - The assert statement no longer tests __debug__ at runtime. This means |
| 3064 | that assert statements cannot be disabled by assigning a false value |
| 3065 | to __debug__. |
| 3066 | |
| 3067 | - A method zfill() was added to str and unicode, that fills a numeric |
| 3068 | string to the left with zeros. For example, |
| 3069 | "+123".zfill(6) -> "+00123". |
| 3070 | |
| 3071 | - Complex numbers supported divmod() and the // and % operators, but |
| 3072 | these make no sense. Since this was documented, they're being |
| 3073 | deprecated now. |
| 3074 | |
| 3075 | - String and unicode methods lstrip(), rstrip() and strip() now take |
| 3076 | an optional argument that specifies the characters to strip. For |
| 3077 | example, "Foo!!!?!?!?".rstrip("?!") -> "Foo". |
| 3078 | |
| 3079 | - There's a new dictionary constructor (a class method of the dict |
| 3080 | class), dict.fromkeys(iterable, value=None). It constructs a |
| 3081 | dictionary with keys taken from the iterable and all values set to a |
| 3082 | single value. It can be used for building sets and for removing |
| 3083 | duplicates from sequences. |
| 3084 | |
| 3085 | - Added a new dict method pop(key). This removes and returns the |
| 3086 | value corresponding to key. [SF patch #539949] |
| 3087 | |
| 3088 | - A new built-in type, bool, has been added, as well as built-in |
| 3089 | names for its two values, True and False. Comparisons and sundry |
| 3090 | other operations that return a truth value have been changed to |
| 3091 | return a bool instead. Read PEP 285 for an explanation of why this |
| 3092 | is backward compatible. |
| 3093 | |
| 3094 | - Fixed two bugs reported as SF #535905: under certain conditions, |
| 3095 | deallocating a deeply nested structure could cause a segfault in the |
| 3096 | garbage collector, due to interaction with the "trashcan" code; |
| 3097 | access to the current frame during destruction of a local variable |
| 3098 | could access a pointer to freed memory. |
| 3099 | |
| 3100 | - The optional object allocator ("pymalloc") has been enabled by |
| 3101 | default. The recommended practice for memory allocation and |
| 3102 | deallocation has been streamlined. A header file is included, |
| 3103 | Misc/pymemcompat.h, which can be bundled with 3rd party extensions |
| 3104 | and lets them use the same API with Python versions from 1.5.2 |
| 3105 | onwards. |
| 3106 | |
| 3107 | - PyErr_Display will provide file and line information for all exceptions |
| 3108 | that have an attribute print_file_and_line, not just SyntaxErrors. |
| 3109 | |
| 3110 | - The UTF-8 codec will now encode and decode Unicode surrogates |
| 3111 | correctly and without raising exceptions for unpaired ones. |
| 3112 | |
| 3113 | - Universal newlines (PEP 278) is implemented. Briefly, using 'U' |
| 3114 | instead of 'r' when opening a text file for reading changes the line |
| 3115 | ending convention so that any of '\r', '\r\n', and '\n' is |
| 3116 | recognized (even mixed in one file); all three are converted to |
| 3117 | '\n', the standard Python line end character. |
| 3118 | |
| 3119 | - file.xreadlines() now raises a ValueError if the file is closed: |
| 3120 | Previously, an xreadlines object was returned which would raise |
| 3121 | a ValueError when the xreadlines.next() method was called. |
| 3122 | |
| 3123 | - sys.exit() inadvertently allowed more than one argument. |
| 3124 | An exception will now be raised if more than one argument is used. |
| 3125 | |
| 3126 | - Changed evaluation order of dictionary literals to conform to the |
| 3127 | general left to right evaluation order rule. Now {f1(): f2()} will |
| 3128 | evaluate f1 first. |
| 3129 | |
| 3130 | - Fixed bug #521782: when a file was in non-blocking mode, file.read() |
| 3131 | could silently lose data or wrongly throw an unknown error. |
| 3132 | |
| 3133 | - The sq_repeat, sq_inplace_repeat, sq_concat and sq_inplace_concat |
| 3134 | slots are now always tried after trying the corresponding nb_* slots. |
| 3135 | This fixes a number of minor bugs (see bug #624807). |
| 3136 | |
| 3137 | - Fix problem with dynamic loading on 64-bit AIX (see bug #639945). |
| 3138 | |
| 3139 | Extension modules |
| 3140 | ----------------- |
| 3141 | |
| 3142 | - Added three operators to the operator module: |
| 3143 | operator.pow(a,b) which is equivalent to: a**b. |
| 3144 | operator.is_(a,b) which is equivalent to: a is b. |
| 3145 | operator.is_not(a,b) which is equivalent to: a is not b. |
| 3146 | |
| 3147 | - posix.openpty now works on all systems that have /dev/ptmx. |
| 3148 | |
| 3149 | - A module zipimport exists to support importing code from zip |
| 3150 | archives. |
| 3151 | |
| 3152 | - The new datetime module supplies classes for manipulating dates and |
| 3153 | times. The basic design came from the Zope "fishbowl process", and |
| 3154 | favors practical commercial applications over calendar esoterica. See |
| 3155 | |
| 3156 | http://www.zope.org/Members/fdrake/DateTimeWiki/FrontPage |
| 3157 | |
| 3158 | - _tkinter now returns Tcl objects, instead of strings. Objects which |
| 3159 | have Python equivalents are converted to Python objects, other objects |
| 3160 | are wrapped. This can be configured through the wantobjects method, |
| 3161 | or Tkinter.wantobjects. |
| 3162 | |
| 3163 | - The PyBSDDB wrapper around the Sleepycat Berkeley DB library has |
| 3164 | been added as the package bsddb. The traditional bsddb module is |
| 3165 | still available in source code, but not built automatically anymore, |
| 3166 | and is now named bsddb185. This supports Berkeley DB versions from |
| 3167 | 3.0 to 4.1. For help converting your databases from the old module (which |
| 3168 | probably used an obsolete version of Berkeley DB) to the new module, see |
| 3169 | the db2pickle.py and pickle2db.py scripts described in the Tools/Demos |
| 3170 | section above. |
| 3171 | |
| 3172 | - unicodedata was updated to Unicode 3.2. It supports normalization |
| 3173 | and names for Hangul syllables and CJK unified ideographs. |
| 3174 | |
| 3175 | - resource.getrlimit() now returns longs instead of ints. |
| 3176 | |
| 3177 | - readline now dynamically adjusts its input/output stream if |
| 3178 | sys.stdin/stdout changes. |
| 3179 | |
| 3180 | - The _tkinter module (and hence Tkinter) has dropped support for |
| 3181 | Tcl/Tk 8.0 and 8.1. Only Tcl/Tk versions 8.2, 8.3 and 8.4 are |
| 3182 | supported. |
| 3183 | |
| 3184 | - cPickle.BadPickleGet is now a class. |
| 3185 | |
| 3186 | - The time stamps in os.stat_result are floating point numbers |
| 3187 | after stat_float_times has been called. |
| 3188 | |
| 3189 | - If the size passed to mmap.mmap() is larger than the length of the |
| 3190 | file on non-Windows platforms, a ValueError is raised. [SF bug 585792] |
| 3191 | |
| 3192 | - The xreadlines module is slated for obsolescence. |
| 3193 | |
| 3194 | - The strptime function in the time module is now always available (a |
| 3195 | Python implementation is used when the C library doesn't define it). |
| 3196 | |
| 3197 | - The 'new' module is no longer an extension, but a Python module that |
| 3198 | only exists for backwards compatibility. Its contents are no longer |
| 3199 | functions but callable type objects. |
| 3200 | |
| 3201 | - The bsddb.*open functions can now take 'None' as a filename. |
| 3202 | This will create a temporary in-memory bsddb that won't be |
| 3203 | written to disk. |
| 3204 | |
| 3205 | - posix.getloadavg, posix.lchown, posix.killpg, posix.mknod, and |
| 3206 | posix.getpgid have been added where available. |
| 3207 | |
| 3208 | - The locale module now exposes the C library's gettext interface. It |
| 3209 | also has a new function getpreferredencoding. |
| 3210 | |
| 3211 | - A security hole ("double free") was found in zlib-1.1.3, a popular |
| 3212 | third party compression library used by some Python modules. The |
| 3213 | hole was quickly plugged in zlib-1.1.4, and the Windows build of |
| 3214 | Python now ships with zlib-1.1.4. |
| 3215 | |
| 3216 | - pwd, grp, and resource return enhanced tuples now, with symbolic |
| 3217 | field names. |
| 3218 | |
| 3219 | - array.array is now a type object. A new format character |
| 3220 | 'u' indicates Py_UNICODE arrays. For those, .tounicode and |
| 3221 | .fromunicode methods are available. Arrays now support __iadd__ |
| 3222 | and __imul__. |
| 3223 | |
| 3224 | - dl now builds on every system that has dlfcn.h. Failure in case |
| 3225 | of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open |
| 3226 | is called. |
| 3227 | |
| 3228 | - The sys module acquired a new attribute, api_version, which evaluates |
| 3229 | to the value of the PYTHON_API_VERSION macro with which the |
| 3230 | interpreter was compiled. |
| 3231 | |
| 3232 | - Fixed bug #470582: sre module would return a tuple (None, 'a', 'ab') |
| 3233 | when applying the regular expression '^((a)c)?(ab)$' on 'ab'. It now |
| 3234 | returns (None, None, 'ab'), as expected. Also fixed handling of |
| 3235 | lastindex/lastgroup match attributes in similar cases. For example, |
| 3236 | when running the expression r'(a)(b)?b' over 'ab', lastindex must be |
| 3237 | 1, not 2. |
| 3238 | |
| 3239 | - Fixed bug #581080: sre scanner was not checking the buffer limit |
| 3240 | before increasing the current pointer. This was creating an infinite |
| 3241 | loop in the search function, once the pointer exceeded the buffer |
| 3242 | limit. |
| 3243 | |
| 3244 | - The os.fdopen function now enforces a file mode starting with the |
| 3245 | letter 'r', 'w' or 'a', otherwise a ValueError is raised. This fixes |
| 3246 | bug #623464. |
| 3247 | |
| 3248 | - The linuxaudiodev module is now deprecated; it is being replaced by |
| 3249 | ossaudiodev. The interface has been extended to cover a lot more of |
| 3250 | OSS (see www.opensound.com), including most DSP ioctls and the |
| 3251 | OSS mixer API. Documentation forthcoming in 2.3a2. |
| 3252 | |
| 3253 | Library |
| 3254 | ------- |
| 3255 | |
| 3256 | - imaplib.py now supports SSL (Tino Lange and Piers Lauder). |
| 3257 | |
| 3258 | - Freeze's modulefinder.py has been moved to the standard library; |
| 3259 | slightly improved so it will issue less false missing submodule |
| 3260 | reports (see sf path #643711 for details). Documentation will follow |
| 3261 | with Python 2.3a2. |
| 3262 | |
| 3263 | - os.path exposes getctime. |
| 3264 | |
| 3265 | - unittest.py now has two additional methods called assertAlmostEqual() |
| 3266 | and failIfAlmostEqual(). They implement an approximate comparison |
| 3267 | by rounding the difference between the two arguments and comparing |
| 3268 | the result to zero. Approximate comparison is essential for |
| 3269 | unit tests of floating point results. |
| 3270 | |
| 3271 | - calendar.py now depends on the new datetime module rather than |
| 3272 | the time module. As a result, the range of allowable dates |
| 3273 | has been increased. |
| 3274 | |
| 3275 | - pdb has a new 'j(ump)' command to select the next line to be |
| 3276 | executed. |
| 3277 | |
| 3278 | - The distutils created windows installers now can run a |
| 3279 | postinstallation script. |
| 3280 | |
| 3281 | - doctest.testmod can now be called without argument, which means to |
| 3282 | test the current module. |
| 3283 | |
| 3284 | - When canceling a server that implemented threading with a keyboard |
| 3285 | interrupt, the server would shut down but not terminate (waiting on |
| 3286 | client threads). A new member variable, daemon_threads, was added to |
| 3287 | the ThreadingMixIn class in SocketServer.py to make it explicit that |
| 3288 | this behavior needs to be controlled. |
| 3289 | |
| 3290 | - A new module, optparse, provides a fancy alternative to getopt for |
| 3291 | command line parsing. It is a slightly modified version of Greg |
| 3292 | Ward's Optik package. |
| 3293 | |
| 3294 | - UserDict.py now defines a DictMixin class which defines all dictionary |
| 3295 | methods for classes that already have a minimum mapping interface. |
| 3296 | This greatly simplifies writing classes that need to be substitutable |
| 3297 | for dictionaries (such as the shelve module). |
| 3298 | |
| 3299 | - shelve.py now subclasses from UserDict.DictMixin. Now shelve supports |
| 3300 | all dictionary methods. This eases the transition to persistent |
| 3301 | storage for scripts originally written with dictionaries in mind. |
| 3302 | |
| 3303 | - shelve.open and the various classes in shelve.py now accept an optional |
| 3304 | binary flag, which defaults to False. If True, the values stored in the |
| 3305 | shelf are binary pickles. |
| 3306 | |
| 3307 | - A new package, logging, implements the logging API defined by PEP |
| 3308 | 282. The code is written by Vinay Sajip. |
| 3309 | |
| 3310 | - StreamReader, StreamReaderWriter and StreamRecoder in the codecs |
| 3311 | modules are iterators now. |
| 3312 | |
| 3313 | - gzip.py now handles files exceeding 2GB. Files over 4GB also work |
| 3314 | now (provided the OS supports it, and Python is configured with large |
| 3315 | file support), but in that case the underlying gzip file format can |
| 3316 | record only the least-significant 32 bits of the file size, so that |
| 3317 | some tools working with gzipped files may report an incorrect file |
| 3318 | size. |
| 3319 | |
| 3320 | - xml.sax.saxutils.unescape has been added, to replace entity references |
| 3321 | with their entity value. |
| 3322 | |
| 3323 | - Queue.Queue.{put,get} now support an optional timeout argument. |
| 3324 | |
| 3325 | - Various features of Tk 8.4 are exposed in Tkinter.py. The multiple |
| 3326 | option of tkFileDialog is exposed as function askopenfile{,name}s. |
| 3327 | |
| 3328 | - Various configure methods of Tkinter have been stream-lined, so that |
| 3329 | tag_configure, image_configure, window_configure now return a |
| 3330 | dictionary when invoked with no argument. |
| 3331 | |
| 3332 | - Importing the readline module now no longer has the side effect of |
| 3333 | calling setlocale(LC_CTYPE, ""). The initial "C" locale, or |
| 3334 | whatever locale is explicitly set by the user, is preserved. If you |
| 3335 | want repr() of 8-bit strings in your preferred encoding to preserve |
| 3336 | all printable characters of that encoding, you have to add the |
| 3337 | following code to your $PYTHONSTARTUP file or to your application's |
| 3338 | main(): |
| 3339 | |
| 3340 | import locale |
| 3341 | locale.setlocale(locale.LC_CTYPE, "") |
| 3342 | |
| 3343 | - shutil.move was added. shutil.copytree now reports errors as an |
| 3344 | exception at the end, instead of printing error messages. |
| 3345 | |
| 3346 | - Encoding name normalization was generalized to not only |
| 3347 | replace hyphens with underscores, but also all other non-alphanumeric |
| 3348 | characters (with the exception of the dot which is used for Python |
| 3349 | package names during lookup). The aliases.py mapping was updated |
| 3350 | to the new standard. |
| 3351 | |
| 3352 | - mimetypes has two new functions: guess_all_extensions() which |
| 3353 | returns a list of all known extensions for a mime type, and |
| 3354 | add_type() which adds one mapping between a mime type and |
| 3355 | an extension to the database. |
| 3356 | |
| 3357 | - New module: sets, defines the class Set that implements a mutable |
| 3358 | set type using the keys of a dict to represent the set. There's |
| 3359 | also a class ImmutableSet which is useful when you need sets of sets |
| 3360 | or when you need to use sets as dict keys, and a class BaseSet which |
| 3361 | is the base class of the two. |
| 3362 | |
| 3363 | - Added random.sample(population,k) for random sampling without replacement. |
| 3364 | Returns a k length list of unique elements chosen from the population. |
| 3365 | |
| 3366 | - random.randrange(-sys.maxint-1, sys.maxint) no longer raises |
| 3367 | OverflowError. That is, it now accepts any combination of 'start' |
| 3368 | and 'stop' arguments so long as each is in the range of Python's |
| 3369 | bounded integers. |
| 3370 | |
| 3371 | - Thanks to Raymond Hettinger, random.random() now uses a new core |
| 3372 | generator. The Mersenne Twister algorithm is implemented in C, |
| 3373 | threadsafe, faster than the previous generator, has an astronomically |
| 3374 | large period (2**19937-1), creates random floats to full 53-bit |
| 3375 | precision, and may be the most widely tested random number generator |
| 3376 | in existence. |
| 3377 | |
| 3378 | The random.jumpahead(n) method has different semantics for the new |
| 3379 | generator. Instead of jumping n steps ahead, it uses n and the |
| 3380 | existing state to create a new state. This means that jumpahead() |
| 3381 | continues to support multi-threaded code needing generators of |
| 3382 | non-overlapping sequences. However, it will break code which relies |
| 3383 | on jumpahead moving a specific number of steps forward. |
| 3384 | |
| 3385 | The attributes random.whseed and random.__whseed have no meaning for |
| 3386 | the new generator. Code using these attributes should switch to a |
| 3387 | new class, random.WichmannHill which is provided for backward |
| 3388 | compatibility and to make an alternate generator available. |
| 3389 | |
| 3390 | - New "algorithms" module: heapq, implements a heap queue. Thanks to |
| 3391 | Kevin O'Connor for the code and François Pinard for an entertaining |
| 3392 | write-up explaining the theory and practical uses of heaps. |
| 3393 | |
| 3394 | - New encoding for the Palm OS character set: palmos. |
| 3395 | |
| 3396 | - binascii.crc32() and the zipfile module had problems on some 64-bit |
| 3397 | platforms. These have been fixed. On a platform with 8-byte C longs, |
| 3398 | crc32() now returns a signed-extended 4-byte result, so that its value |
| 3399 | as a Python int is equal to the value computed a 32-bit platform. |
| 3400 | |
| 3401 | - xml.dom.minidom.toxml and toprettyxml now take an optional encoding |
| 3402 | argument. |
| 3403 | |
| 3404 | - Some fixes in the copy module: when an object is copied through its |
| 3405 | __reduce__ method, there was no check for a __setstate__ method on |
| 3406 | the result [SF patch 565085]; deepcopy should treat instances of |
| 3407 | custom metaclasses the same way it treats instances of type 'type' |
| 3408 | [SF patch 560794]. |
| 3409 | |
| 3410 | - Sockets now support timeout mode. After s.settimeout(T), where T is |
| 3411 | a float expressing seconds, subsequent operations raise an exception |
| 3412 | if they cannot be completed within T seconds. To disable timeout |
| 3413 | mode, use s.settimeout(None). There's also a module function, |
| 3414 | socket.setdefaulttimeout(T), which sets the default for all sockets |
| 3415 | created henceforth. |
| 3416 | |
| 3417 | - getopt.gnu_getopt was added. This supports GNU-style option |
| 3418 | processing, where options can be mixed with non-option arguments. |
| 3419 | |
| 3420 | - Stop using strings for exceptions. String objects used for |
| 3421 | exceptions are now classes deriving from Exception. The objects |
| 3422 | changed were: Tkinter.TclError, bdb.BdbQuit, macpath.norm_error, |
| 3423 | tabnanny.NannyNag, and xdrlib.Error. |
| 3424 | |
| 3425 | - Constants BOM_UTF8, BOM_UTF16, BOM_UTF16_LE, BOM_UTF16_BE, |
| 3426 | BOM_UTF32, BOM_UTF32_LE and BOM_UTF32_BE that represent the Byte |
| 3427 | Order Mark in UTF-8, UTF-16 and UTF-32 encodings for little and |
| 3428 | big endian systems were added to the codecs module. The old names |
| 3429 | BOM32_* and BOM64_* were off by a factor of 2. |
| 3430 | |
| 3431 | - Added conversion functions math.degrees() and math.radians(). |
| 3432 | |
| 3433 | - math.log() now takes an optional argument: math.log(x[, base]). |
| 3434 | |
| 3435 | - ftplib.retrlines() now tests for callback is None rather than testing |
| 3436 | for False. Was causing an error when given a callback object which |
| 3437 | was callable but also returned len() as zero. The change may |
| 3438 | create new breakage if the caller relied on the undocumented behavior |
| 3439 | and called with callback set to [] or some other False value not |
| 3440 | identical to None. |
| 3441 | |
| 3442 | - random.gauss() uses a piece of hidden state used by nothing else, |
| 3443 | and the .seed() and .whseed() methods failed to reset it. In other |
| 3444 | words, setting the seed didn't completely determine the sequence of |
| 3445 | results produced by random.gauss(). It does now. Programs repeatedly |
| 3446 | mixing calls to a seed method with calls to gauss() may see different |
| 3447 | results now. |
| 3448 | |
| 3449 | - The pickle.Pickler class grew a clear_memo() method to mimic that |
| 3450 | provided by cPickle.Pickler. |
| 3451 | |
| 3452 | - difflib's SequenceMatcher class now does a dynamic analysis of |
| 3453 | which elements are so frequent as to constitute noise. For |
| 3454 | comparing files as sequences of lines, this generally works better |
| 3455 | than the IS_LINE_JUNK function, and function ndiff's linejunk |
| 3456 | argument defaults to None now as a result. A happy benefit is |
| 3457 | that SequenceMatcher may run much faster now when applied |
| 3458 | to large files with many duplicate lines (for example, C program |
| 3459 | text with lots of repeated "}" and "return NULL;" lines). |
| 3460 | |
| 3461 | - New Text.dump() method in Tkinter module. |
| 3462 | |
| 3463 | - New distutils commands for building packagers were added to |
| 3464 | support pkgtool on Solaris and swinstall on HP-UX. |
| 3465 | |
| 3466 | - distutils now has a new abstract binary packager base class |
| 3467 | command/bdist_packager, which simplifies writing packagers. |
| 3468 | This will hopefully provide the missing bits to encourage |
| 3469 | people to submit more packagers, e.g. for Debian, FreeBSD |
| 3470 | and other systems. |
| 3471 | |
| 3472 | - The UTF-16, -LE and -BE stream readers now raise a |
| 3473 | NotImplementedError for all calls to .readline(). Previously, they |
| 3474 | used to just produce garbage or fail with an encoding error -- |
| 3475 | UTF-16 is a 2-byte encoding and the C lib's line reading APIs don't |
| 3476 | work well with these. |
| 3477 | |
| 3478 | - compileall now supports quiet operation. |
| 3479 | |
| 3480 | - The BaseHTTPServer now implements optional HTTP/1.1 persistent |
| 3481 | connections. |
| 3482 | |
| 3483 | - socket module: the SSL support was broken out of the main |
| 3484 | _socket module C helper and placed into a new _ssl helper |
| 3485 | which now gets imported by socket.py if available and working. |
| 3486 | |
| 3487 | - encodings package: added aliases for all supported IANA character |
| 3488 | sets |
| 3489 | |
| 3490 | - ftplib: to safeguard the user's privacy, anonymous login will use |
| 3491 | "anonymous@" as default password, rather than the real user and host |
| 3492 | name. |
| 3493 | |
| 3494 | - webbrowser: tightened up the command passed to os.system() so that |
| 3495 | arbitrary shell code can't be executed because a bogus URL was |
| 3496 | passed in. |
| 3497 | |
| 3498 | - gettext.translation has an optional fallback argument, and |
| 3499 | gettext.find an optional all argument. Translations will now fallback |
| 3500 | on a per-message basis. The module supports plural forms, by means |
| 3501 | of gettext.[d]ngettext and Translation.[u]ngettext. |
| 3502 | |
| 3503 | - distutils bdist commands now offer a --skip-build option. |
| 3504 | |
| 3505 | - warnings.warn now accepts a Warning instance as first argument. |
| 3506 | |
| 3507 | - The xml.sax.expatreader.ExpatParser class will no longer create |
| 3508 | circular references by using itself as the locator that gets passed |
| 3509 | to the content handler implementation. [SF bug #535474] |
| 3510 | |
| 3511 | - The email.Parser.Parser class now properly parses strings regardless |
| 3512 | of their line endings, which can be any of \r, \n, or \r\n (CR, LF, |
| 3513 | or CRLF). Also, the Header class's constructor default arguments |
| 3514 | has changed slightly so that an explicit maxlinelen value is always |
| 3515 | honored, and so unicode conversion error handling can be specified. |
| 3516 | |
| 3517 | - distutils' build_ext command now links C++ extensions with the C++ |
| 3518 | compiler available in the Makefile or CXX environment variable, if |
| 3519 | running under \*nix. |
| 3520 | |
| 3521 | - New module bz2: provides a comprehensive interface for the bz2 compression |
| 3522 | library. It implements a complete file interface, one-shot (de)compression |
| 3523 | functions, and types for sequential (de)compression. |
| 3524 | |
| 3525 | - New pdb command 'pp' which is like 'p' except that it pretty-prints |
| 3526 | the value of its expression argument. |
| 3527 | |
| 3528 | - Now bdist_rpm distutils command understands a verify_script option in |
| 3529 | the config file, including the contents of the referred filename in |
| 3530 | the "%verifyscript" section of the rpm spec file. |
| 3531 | |
| 3532 | - Fixed bug #495695: webbrowser module would run graphic browsers in a |
| 3533 | unix environment even if DISPLAY was not set. Also, support for |
| 3534 | skipstone browser was included. |
| 3535 | |
| 3536 | - Fixed bug #636769: rexec would run unallowed code if subclasses of |
| 3537 | strings were used as parameters for certain functions. |
| 3538 | |
| 3539 | Tools/Demos |
| 3540 | ----------- |
| 3541 | |
| 3542 | - pygettext.py now supports globbing on Windows, and accepts module |
| 3543 | names in addition to accepting file names. |
| 3544 | |
| 3545 | - The SGI demos (Demo/sgi) have been removed. Nobody thought they |
| 3546 | were interesting any more. (The SGI library modules and extensions |
| 3547 | are still there; it is believed that at least some of these are |
| 3548 | still used and useful.) |
| 3549 | |
| 3550 | - IDLE supports the new encoding declarations (PEP 263); it can also |
| 3551 | deal with legacy 8-bit files if they use the locale's encoding. It |
| 3552 | allows non-ASCII strings in the interactive shell and executes them |
| 3553 | in the locale's encoding. |
| 3554 | |
| 3555 | - freeze.py now produces binaries which can import shared modules, |
| 3556 | unlike before when this failed due to missing symbol exports in |
| 3557 | the generated binary. |
| 3558 | |
| 3559 | Build |
| 3560 | ----- |
| 3561 | |
| 3562 | - On Unix, IDLE is now installed automatically. |
| 3563 | |
| 3564 | - The fpectl module is not built by default; it's dangerous or useless |
| 3565 | except in the hands of experts. |
| 3566 | |
| 3567 | - The public Python C API will generally be declared using PyAPI_FUNC |
| 3568 | and PyAPI_DATA macros, while Python extension module init functions |
| 3569 | will be declared with PyMODINIT_FUNC. DL_EXPORT/DL_IMPORT macros |
| 3570 | are deprecated. |
| 3571 | |
| 3572 | - A bug was fixed that could cause COUNT_ALLOCS builds to segfault, or |
| 3573 | get into infinite loops, when a new-style class got garbage-collected. |
| 3574 | Unfortunately, to avoid this, the way COUNT_ALLOCS works requires |
| 3575 | that new-style classes be immortal in COUNT_ALLOCS builds. Note that |
| 3576 | COUNT_ALLOCS is not enabled by default, in either release or debug |
| 3577 | builds, and that new-style classes are immortal only in COUNT_ALLOCS |
| 3578 | builds. |
| 3579 | |
| 3580 | - Compiling out the cyclic garbage collector is no longer an option. |
| 3581 | The old symbol WITH_CYCLE_GC is now ignored, and Python.h arranges |
| 3582 | that it's always defined (for the benefit of any extension modules |
| 3583 | that may be conditionalizing on it). A bonus is that any extension |
| 3584 | type participating in cyclic gc can choose to participate in the |
| 3585 | Py_TRASHCAN mechanism now too; in the absence of cyclic gc, this used |
| 3586 | to require editing the core to teach the trashcan mechanism about the |
| 3587 | new type. |
| 3588 | |
| 3589 | - According to Annex F of the current C standard, |
| 3590 | |
| 3591 | The Standard C macro HUGE_VAL and its float and long double analogs, |
| 3592 | HUGE_VALF and HUGE_VALL, expand to expressions whose values are |
| 3593 | positive infinities. |
| 3594 | |
| 3595 | Python only uses the double HUGE_VAL, and only to #define its own symbol |
| 3596 | Py_HUGE_VAL. Some platforms have incorrect definitions for HUGE_VAL. |
| 3597 | pyport.h used to try to worm around that, but the workarounds triggered |
| 3598 | other bugs on other platforms, so we gave up. If your platform defines |
| 3599 | HUGE_VAL incorrectly, you'll need to #define Py_HUGE_VAL to something |
| 3600 | that works on your platform. The only instance of this I'm sure about |
| 3601 | is on an unknown subset of Cray systems, described here: |
| 3602 | |
| 3603 | http://www.cray.com/swpubs/manuals/SN-2194_2.0/html-SN-2194_2.0/x3138.htm |
| 3604 | |
| 3605 | Presumably 2.3a1 breaks such systems. If anyone uses such a system, help! |
| 3606 | |
| 3607 | - The configure option --without-doc-strings can be used to remove the |
| 3608 | doc strings from the builtin functions and modules; this reduces the |
| 3609 | size of the executable. |
| 3610 | |
| 3611 | - The universal newlines option (PEP 278) is on by default. On Unix |
| 3612 | it can be disabled by passing --without-universal-newlines to the |
| 3613 | configure script. On other platforms, remove |
| 3614 | WITH_UNIVERSAL_NEWLINES from pyconfig.h. |
| 3615 | |
| 3616 | - On Unix, a shared libpython2.3.so can be created with --enable-shared. |
| 3617 | |
| 3618 | - All uses of the CACHE_HASH, INTERN_STRINGS, and DONT_SHARE_SHORT_STRINGS |
| 3619 | preprocessor symbols were eliminated. The internal decisions they |
| 3620 | controlled stopped being experimental long ago. |
| 3621 | |
| 3622 | - The tools used to build the documentation now work under Cygwin as |
| 3623 | well as Unix. |
| 3624 | |
| 3625 | - The bsddb and dbm module builds have been changed to try and avoid version |
| 3626 | skew problems and disable linkage with Berkeley DB 1.85 unless the |
| 3627 | installer knows what s/he's doing. See the section on building these |
| 3628 | modules in the README file for details. |
| 3629 | |
| 3630 | C API |
| 3631 | ----- |
| 3632 | |
| 3633 | - PyNumber_Check() now returns true for string and unicode objects. |
| 3634 | This is a result of these types having a partially defined |
| 3635 | tp_as_number slot. (This is not a feature, but an indication that |
| 3636 | PyNumber_Check() is not very useful to determine numeric behavior. |
| 3637 | It may be deprecated.) |
| 3638 | |
| 3639 | - The string object's layout has changed: the pointer member |
| 3640 | ob_sinterned has been replaced by an int member ob_sstate. On some |
| 3641 | platforms (e.g. most 64-bit systems) this may change the offset of |
| 3642 | the ob_sval member, so as a precaution the API_VERSION has been |
| 3643 | incremented. The apparently unused feature of "indirect interned |
| 3644 | strings", supported by the ob_sinterned member, is gone. Interned |
| 3645 | strings are now usually mortal; there is a new API, |
| 3646 | PyString_InternImmortal() that creates immortal interned strings. |
| 3647 | (The ob_sstate member can only take three values; however, while |
| 3648 | making it a char saves a few bytes per string object on average, in |
| 3649 | it also slowed things down a bit because ob_sval was no longer |
| 3650 | aligned.) |
| 3651 | |
| 3652 | - The Py_InitModule*() functions now accept NULL for the 'methods' |
| 3653 | argument. Modules without global functions are becoming more common |
| 3654 | now that factories can be types rather than functions. |
| 3655 | |
| 3656 | - New C API PyUnicode_FromOrdinal() which exposes unichr() at C |
| 3657 | level. |
| 3658 | |
| 3659 | - New functions PyErr_SetExcFromWindowsErr() and |
| 3660 | PyErr_SetExcFromWindowsErrWithFilename(). Similar to |
| 3661 | PyErr_SetFromWindowsErrWithFilename() and |
| 3662 | PyErr_SetFromWindowsErr(), but they allow to specify |
| 3663 | the exception type to raise. Available on Windows. |
| 3664 | |
| 3665 | - Py_FatalError() is now declared as taking a const char* argument. It |
| 3666 | was previously declared without const. This should not affect working |
| 3667 | code. |
| 3668 | |
| 3669 | - Added new macro PySequence_ITEM(o, i) that directly calls |
| 3670 | sq_item without rechecking that o is a sequence and without |
| 3671 | adjusting for negative indices. |
| 3672 | |
| 3673 | - PyRange_New() now raises ValueError if the fourth argument is not 1. |
| 3674 | This is part of the removal of deprecated features of the xrange |
| 3675 | object. |
| 3676 | |
| 3677 | - PyNumber_Coerce() and PyNumber_CoerceEx() now also invoke the type's |
| 3678 | coercion if both arguments have the same type but this type has the |
| 3679 | CHECKTYPES flag set. This is to better support proxies. |
| 3680 | |
| 3681 | - The type of tp_free has been changed from "``void (*)(PyObject *)``" to |
| 3682 | "``void (*)(void *)``". |
| 3683 | |
| 3684 | - PyObject_Del, PyObject_GC_Del are now functions instead of macros. |
| 3685 | |
| 3686 | - A type can now inherit its metatype from its base type. Previously, |
| 3687 | when PyType_Ready() was called, if ob_type was found to be NULL, it |
| 3688 | was always set to &PyType_Type; now it is set to base->ob_type, |
| 3689 | where base is tp_base, defaulting to &PyObject_Type. |
| 3690 | |
| 3691 | - PyType_Ready() accidentally did not inherit tp_is_gc; now it does. |
| 3692 | |
| 3693 | - The PyCore_* family of APIs have been removed. |
| 3694 | |
| 3695 | - The "u#" parser marker will now pass through Unicode objects as-is |
| 3696 | without going through the buffer API. |
| 3697 | |
| 3698 | - The enumerators of cmp_op have been renamed to use the prefix ``PyCmp_``. |
| 3699 | |
| 3700 | - An old #define of ANY as void has been removed from pyport.h. This |
| 3701 | hasn't been used since Python's pre-ANSI days, and the #define has |
| 3702 | been marked as obsolete since then. SF bug 495548 says it created |
| 3703 | conflicts with other packages, so keeping it around wasn't harmless. |
| 3704 | |
| 3705 | - Because Python's magic number scheme broke on January 1st, we decided |
| 3706 | to stop Python development. Thanks for all the fish! |
| 3707 | |
| 3708 | - Some of us don't like fish, so we changed Python's magic number |
| 3709 | scheme to a new one. See Python/import.c for details. |
| 3710 | |
| 3711 | New platforms |
| 3712 | ------------- |
| 3713 | |
| 3714 | - OpenVMS is now supported. |
| 3715 | |
| 3716 | - AtheOS is now supported. |
| 3717 | |
| 3718 | - the EMX runtime environment on OS/2 is now supported. |
| 3719 | |
| 3720 | - GNU/Hurd is now supported. |
| 3721 | |
| 3722 | Tests |
| 3723 | ----- |
| 3724 | |
| 3725 | - The regrtest.py script's -u option now provides a way to say "allow |
| 3726 | all resources except this one." For example, to allow everything |
| 3727 | except bsddb, give the option '-uall,-bsddb'. |
| 3728 | |
| 3729 | Windows |
| 3730 | ------- |
| 3731 | |
| 3732 | - The Windows distribution now ships with version 4.0.14 of the |
| 3733 | Sleepycat Berkeley database library. This should be a huge |
| 3734 | improvement over the previous Berkeley DB 1.85, which had many |
| 3735 | bugs. |
| 3736 | XXX What are the licensing issues here? |
| 3737 | XXX If a user has a database created with a previous version of |
| 3738 | XXX Python, what must they do to convert it? |
| 3739 | XXX I'm still not sure how to link this thing (see PCbuild/readme.txt). |
| 3740 | XXX The version # is likely to change before 2.3a1. |
| 3741 | |
| 3742 | - The Windows distribution now ships with a Secure Sockets Library (SLL) |
| 3743 | module (_ssl.pyd) |
| 3744 | |
| 3745 | - The Windows distribution now ships with Tcl/Tk version 8.4.1 (it |
| 3746 | previously shipped with Tcl/Tk 8.3.2). |
| 3747 | |
| 3748 | - When Python is built under a Microsoft compiler, sys.version now |
| 3749 | includes the compiler version number (_MSC_VER). For example, under |
| 3750 | MSVC 6, sys.version contains the substring "MSC v.1200 ". 1200 is |
| 3751 | the value of _MSC_VER under MSVC 6. |
| 3752 | |
| 3753 | - Sometimes the uninstall executable (UNWISE.EXE) vanishes. One cause |
| 3754 | of that has been fixed in the installer (disabled Wise's "delete in- |
| 3755 | use files" uninstall option). |
| 3756 | |
| 3757 | - Fixed a bug in urllib's proxy handling in Windows. [SF bug #503031] |
| 3758 | |
| 3759 | - The installer now installs Start menu shortcuts under (the local |
| 3760 | equivalent of) "All Users" when doing an Admin install. |
| 3761 | |
| 3762 | - file.truncate([newsize]) now works on Windows for all newsize values. |
| 3763 | It used to fail if newsize didn't fit in 32 bits, reflecting a |
| 3764 | limitation of MS _chsize (which is no longer used). |
| 3765 | |
| 3766 | - os.waitpid() is now implemented for Windows, and can be used to block |
| 3767 | until a specified process exits. This is similar to, but not exactly |
| 3768 | the same as, os.waitpid() on POSIX systems. If you're waiting for |
| 3769 | a specific process whose pid was obtained from one of the spawn() |
| 3770 | functions, the same Python os.waitpid() code works across platforms. |
| 3771 | See the docs for details. The docs were changed to clarify that |
| 3772 | spawn functions return, and waitpid requires, a process handle on |
| 3773 | Windows (not the same thing as a Windows process id). |
| 3774 | |
| 3775 | - New tempfile.TemporaryFile implementation for Windows: this doesn't |
| 3776 | need a TemporaryFileWrapper wrapper anymore, and should be immune |
| 3777 | to a nasty problem: before 2.3, if you got a temp file on Windows, it |
| 3778 | got wrapped in an object whose close() method first closed the |
| 3779 | underlying file, then deleted the file. This usually worked fine. |
| 3780 | However, the spawn family of functions on Windows create (at a low C |
| 3781 | level) the same set of open files in the spawned process Q as were |
| 3782 | open in the spawning process P. If a temp file f was among them, then |
| 3783 | doing f.close() in P first closed P's C-level file handle on f, but Q's |
| 3784 | C-level file handle on f remained open, so the attempt in P to delete f |
| 3785 | blew up with a "Permission denied" error (Windows doesn't allow |
| 3786 | deleting open files). This was surprising, subtle, and difficult to |
| 3787 | work around. |
| 3788 | |
| 3789 | - The os module now exports all the symbolic constants usable with the |
| 3790 | low-level os.open() on Windows: the new constants in 2.3 are |
| 3791 | O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL. |
| 3792 | The others were also available in 2.2: O_APPEND, O_BINARY, O_CREAT, |
| 3793 | O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY. Contrary |
| 3794 | to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY |
| 3795 | (so specify both if you want both; note that neither is useful unless |
| 3796 | specified with O_CREAT too). |
| 3797 | |
| 3798 | Mac |
| 3799 | ---- |
| 3800 | |
| 3801 | - Mac/Relnotes is gone, the release notes are now here. |
| 3802 | |
| 3803 | - Python (the OSX-only, unix-based version, not the OS9-compatible CFM |
| 3804 | version) now fully supports unicode strings as arguments to various file |
| 3805 | system calls, eg. open(), file(), os.stat() and os.listdir(). |
| 3806 | |
| 3807 | - The current naming convention for Python on the Macintosh is that MacPython |
| 3808 | refers to the unix-based OSX-only version, and MacPython-OS9 refers to the |
| 3809 | CFM-based version that runs on both OS9 and OSX. |
| 3810 | |
| 3811 | - All MacPython-OS9 functionality is now available in an OSX unix build, |
| 3812 | including the Carbon modules, the IDE, OSA support, etc. A lot of this |
| 3813 | will only work correctly in a framework build, though, because you cannot |
| 3814 | talk to the window manager unless your application is run from a .app |
| 3815 | bundle. There is a command line tool "pythonw" that runs your script |
| 3816 | with an interpreter living in such a .app bundle, this interpreter should |
| 3817 | be used to run any Python script using the window manager (including |
| 3818 | Tkinter or wxPython scripts). |
| 3819 | |
| 3820 | - Most of Mac/Lib has moved to Lib/plat-mac, which is again used both in |
| 3821 | MacPython-OSX and MacPython-OS9. The only modules remaining in Mac/Lib |
| 3822 | are specifically for MacPython-OS9 (CFM support, preference resources, etc). |
| 3823 | |
| 3824 | - A new utility PythonLauncher will start a Python interpreter when a .py or |
| 3825 | .pyw script is double-clicked in the Finder. By default .py scripts are |
| 3826 | run with a normal Python interpreter in a Terminal window and .pyw |
| 3827 | files are run with a window-aware pythonw interpreter without a Terminal |
| 3828 | window, but all this can be customized. |
| 3829 | |
| 3830 | - MacPython-OS9 is now Carbon-only, so it runs on Mac OS 9 or Mac OS X and |
| 3831 | possibly on Mac OS 8.6 with the right CarbonLib installed, but not on earlier |
| 3832 | releases. |
| 3833 | |
| 3834 | - Many tools such as BuildApplet.py and gensuitemodule.py now support a command |
| 3835 | line interface too. |
| 3836 | |
| 3837 | - All the Carbon classes are now PEP253 compliant, meaning that you can |
| 3838 | subclass them from Python. Most of the attributes have gone, you should |
| 3839 | now use the accessor function call API, which is also what Apple's |
| 3840 | documentation uses. Some attributes such as grafport.visRgn are still |
| 3841 | available for convenience. |
| 3842 | |
| 3843 | - New Carbon modules File (implementing the APIs in Files.h and Aliases.h) |
| 3844 | and Folder (APIs from Folders.h). The old macfs builtin module is |
| 3845 | gone, and replaced by a Python wrapper around the new modules. |
| 3846 | |
| 3847 | - Pathname handling should now be fully consistent: MacPython-OSX always uses |
| 3848 | unix pathnames and MacPython-OS9 always uses colon-separated Mac pathnames |
| 3849 | (also when running on Mac OS X). |
| 3850 | |
| 3851 | - New Carbon modules Help and AH give access to the Carbon Help Manager. |
| 3852 | There are hooks in the IDE to allow accessing the Python documentation |
| 3853 | (and Apple's Carbon and Cocoa documentation) through the Help Viewer. |
| 3854 | See Mac/OSX/README for converting the Python documentation to a |
| 3855 | Help Viewer compatible form and installing it. |
| 3856 | |
| 3857 | - OSA support has been redesigned and the generated Python classes now |
| 3858 | mirror the inheritance defined by the underlying OSA classes. |
| 3859 | |
| 3860 | - MacPython no longer maps both \r and \n to \n on input for any text file. |
| 3861 | This feature has been replaced by universal newline support (PEP278). |
| 3862 | |
| 3863 | - The default encoding for Python sourcefiles in MacPython-OS9 is no longer |
| 3864 | mac-roman (or whatever your local Mac encoding was) but "ascii", like on |
| 3865 | other platforms. If you really need sourcefiles with Mac characters in them |
| 3866 | you can change this in site.py. |
| 3867 | |
| 3868 | |
| 3869 | What's New in Python 2.2 final? |
| 3870 | =============================== |
| 3871 | |
| 3872 | *Release date: 21-Dec-2001* |
| 3873 | |
| 3874 | Type/class unification and new-style classes |
| 3875 | -------------------------------------------- |
| 3876 | |
| 3877 | - pickle.py, cPickle: allow pickling instances of new-style classes |
| 3878 | with a custom metaclass. |
| 3879 | |
| 3880 | Core and builtins |
| 3881 | ----------------- |
| 3882 | |
| 3883 | - weakref proxy object: when comparing, unwrap both arguments if both |
| 3884 | are proxies. |
| 3885 | |
| 3886 | Extension modules |
| 3887 | ----------------- |
| 3888 | |
| 3889 | - binascii.b2a_base64(): fix a potential buffer overrun when encoding |
| 3890 | very short strings. |
| 3891 | |
| 3892 | - cPickle: the obscure "fast" mode was suspected of causing stack |
| 3893 | overflows on the Mac. Hopefully fixed this by setting the recursion |
| 3894 | limit much smaller. If the limit is too low (it only affects |
| 3895 | performance), you can change it by defining PY_CPICKLE_FAST_LIMIT |
| 3896 | when compiling cPickle.c (or in pyconfig.h). |
| 3897 | |
| 3898 | Library |
| 3899 | ------- |
| 3900 | |
| 3901 | - dumbdbm.py: fixed a dumb old bug (the file didn't get synched at |
| 3902 | close or delete time). |
| 3903 | |
| 3904 | - rfc822.py: fixed a bug where the address '<>' was converted to None |
| 3905 | instead of an empty string (also fixes the email.Utils module). |
| 3906 | |
| 3907 | - xmlrpclib.py: version 1.0.0; uses precision for doubles. |
| 3908 | |
| 3909 | - test suite: the pickle and cPickle tests were not executing any code |
| 3910 | when run from the standard regression test. |
| 3911 | |
| 3912 | Tools/Demos |
| 3913 | ----------- |
| 3914 | |
| 3915 | Build |
| 3916 | ----- |
| 3917 | |
| 3918 | C API |
| 3919 | ----- |
| 3920 | |
| 3921 | New platforms |
| 3922 | ------------- |
| 3923 | |
| 3924 | Tests |
| 3925 | ----- |
| 3926 | |
| 3927 | Windows |
| 3928 | ------- |
| 3929 | |
| 3930 | - distutils package: fixed broken Windows installers (bdist_wininst). |
| 3931 | |
| 3932 | - tempfile.py: prevent mysterious warnings when TemporaryFileWrapper |
| 3933 | instances are deleted at process exit time. |
| 3934 | |
| 3935 | - socket.py: prevent mysterious warnings when socket instances are |
| 3936 | deleted at process exit time. |
| 3937 | |
| 3938 | - posixmodule.c: fix a Windows crash with stat() of a filename ending |
| 3939 | in backslash. |
| 3940 | |
| 3941 | Mac |
| 3942 | ---- |
| 3943 | |
| 3944 | - The Carbon toolbox modules have been upgraded to Universal Headers |
| 3945 | 3.4, and experimental CoreGraphics and CarbonEvents modules have |
| 3946 | been added. All only for framework-enabled MacOSX. |
| 3947 | |
| 3948 | |
| 3949 | What's New in Python 2.2c1? |
| 3950 | =========================== |
| 3951 | |
| 3952 | *Release date: 14-Dec-2001* |
| 3953 | |
| 3954 | Type/class unification and new-style classes |
| 3955 | -------------------------------------------- |
| 3956 | |
| 3957 | - Guido's tutorial introduction to the new type/class features has |
| 3958 | been extensively updated. See |
| 3959 | |
| 3960 | http://www.python.org/2.2/descrintro.html |
| 3961 | |
| 3962 | That remains the primary documentation in this area. |
| 3963 | |
| 3964 | - Fixed a leak: instance variables declared with __slots__ were never |
| 3965 | deleted! |
| 3966 | |
| 3967 | - The "delete attribute" method of descriptor objects is called |
| 3968 | __delete__, not __del__. In previous releases, it was mistakenly |
| 3969 | called __del__, which created an unfortunate overloading condition |
| 3970 | with finalizers. (The "get attribute" and "set attribute" methods |
| 3971 | are still called __get__ and __set__, respectively.) |
| 3972 | |
| 3973 | - Some subtle issues with the super built-in were fixed: |
| 3974 | |
| 3975 | (a) When super itself is subclassed, its __get__ method would still |
| 3976 | return an instance of the base class (i.e., of super). |
| 3977 | |
| 3978 | (b) super(C, C()).__class__ would return C rather than super. This |
| 3979 | is confusing. To fix this, I decided to change the semantics of |
| 3980 | super so that it only applies to code attributes, not to data |
| 3981 | attributes. After all, overriding data attributes is not |
| 3982 | supported anyway. |
| 3983 | |
| 3984 | (c) The __get__ method didn't check whether the argument was an |
| 3985 | instance of the type used in creation of the super instance. |
| 3986 | |
| 3987 | - Previously, hash() of an instance of a subclass of a mutable type |
| 3988 | (list or dictionary) would return some value, rather than raising |
| 3989 | TypeError. This has been fixed. Also, directly calling |
| 3990 | dict.__hash__ and list.__hash__ now raises the same TypeError |
| 3991 | (previously, these were the same as object.__hash__). |
| 3992 | |
| 3993 | - New-style objects now support deleting their __dict__. This is for |
| 3994 | all intents and purposes equivalent to assigning a brand new empty |
| 3995 | dictionary, but saves space if the object is not used further. |
| 3996 | |
| 3997 | Core and builtins |
| 3998 | ----------------- |
| 3999 | |
| 4000 | - -Qnew now works as documented in PEP 238: when -Qnew is passed on |
| 4001 | the command line, all occurrences of "/" use true division instead |
| 4002 | of classic division. See the PEP for details. Note that "all" |
| 4003 | means all instances in library and 3rd-party modules, as well as in |
| 4004 | your own code. As the PEP says, -Qnew is intended for use only in |
| 4005 | educational environments with control over the libraries in use. |
| 4006 | Note that test_coercion.py in the standard Python test suite fails |
| 4007 | under -Qnew; this is expected, and won't be repaired until true |
| 4008 | division becomes the default (in the meantime, test_coercion is |
| 4009 | testing the current rules). |
| 4010 | |
| 4011 | - complex() now only allows the first argument to be a string |
| 4012 | argument, and raises TypeError if either the second arg is a string |
| 4013 | or if the second arg is specified when the first is a string. |
| 4014 | |
| 4015 | Extension modules |
| 4016 | ----------------- |
| 4017 | |
| 4018 | - gc.get_referents was renamed to gc.get_referrers. |
| 4019 | |
| 4020 | Library |
| 4021 | ------- |
| 4022 | |
| 4023 | - Functions in the os.spawn() family now release the global interpreter |
| 4024 | lock around calling the platform spawn. They should always have done |
| 4025 | this, but did not before 2.2c1. Multithreaded programs calling |
| 4026 | an os.spawn function with P_WAIT will no longer block all Python threads |
| 4027 | until the spawned program completes. It's possible that some programs |
| 4028 | relies on blocking, although more likely by accident than by design. |
| 4029 | |
| 4030 | - webbrowser defaults to netscape.exe on OS/2 now. |
| 4031 | |
| 4032 | - Tix.ResizeHandle exposes detach_widget, hide, and show. |
| 4033 | |
| 4034 | - The charset alias windows_1252 has been added. |
| 4035 | |
| 4036 | - types.StringTypes is a tuple containing the defined string types; |
| 4037 | usually this will be (str, unicode), but if Python was compiled |
| 4038 | without Unicode support it will be just (str,). |
| 4039 | |
| 4040 | - The pulldom and minidom modules were synchronized to PyXML. |
| 4041 | |
| 4042 | Tools/Demos |
| 4043 | ----------- |
| 4044 | |
| 4045 | - A new script called Tools/scripts/google.py was added, which fires |
| 4046 | off a search on Google. |
| 4047 | |
| 4048 | Build |
| 4049 | ----- |
| 4050 | |
| 4051 | - Note that release builds of Python should arrange to define the |
| 4052 | preprocessor symbol NDEBUG on the command line (or equivalent). |
| 4053 | In the 2.2 pre-release series we tried to define this by magic in |
| 4054 | Python.h instead, but it proved to cause problems for extension |
| 4055 | authors. The Unix, Windows and Mac builds now all define NDEBUG in |
| 4056 | release builds via cmdline (or equivalent) instead. Ports to |
| 4057 | other platforms should do likewise. |
| 4058 | |
| 4059 | - It is no longer necessary to use --with-suffix when building on a |
| 4060 | case-insensitive file system (such as Mac OS X HFS+). In the build |
| 4061 | directory an extension is used, but not in the installed python. |
| 4062 | |
| 4063 | C API |
| 4064 | ----- |
| 4065 | |
| 4066 | - New function PyDict_MergeFromSeq2() exposes the builtin dict |
| 4067 | constructor's logic for updating a dictionary from an iterable object |
| 4068 | producing key-value pairs. |
| 4069 | |
| 4070 | - PyArg_ParseTupleAndKeywords() requires that the number of entries in |
| 4071 | the keyword list equal the number of argument specifiers. This |
| 4072 | wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even |
| 4073 | dump core in some bad cases. This has been repaired. As a result, |
| 4074 | PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that |
| 4075 | previously went unchallenged. |
| 4076 | |
| 4077 | New platforms |
| 4078 | ------------- |
| 4079 | |
| 4080 | Tests |
| 4081 | ----- |
| 4082 | |
| 4083 | Windows |
| 4084 | ------- |
| 4085 | |
| 4086 | Mac |
| 4087 | ---- |
| 4088 | |
| 4089 | - In unix-Python on Mac OS X (and darwin) sys.platform is now "darwin", |
| 4090 | without any trailing digits. |
| 4091 | |
| 4092 | - Changed logic for finding python home in Mac OS X framework Pythons. |
| 4093 | Now sys.executable points to the executable again, in stead of to |
| 4094 | the shared library. The latter is used only for locating the python |
| 4095 | home. |
| 4096 | |
| 4097 | |
| 4098 | What's New in Python 2.2b2? |
| 4099 | =========================== |
| 4100 | |
| 4101 | *Release date: 16-Nov-2001* |
| 4102 | |
| 4103 | Type/class unification and new-style classes |
| 4104 | -------------------------------------------- |
| 4105 | |
| 4106 | - Multiple inheritance mixing new-style and classic classes in the |
| 4107 | list of base classes is now allowed, so this works now: |
| 4108 | |
| 4109 | class Classic: pass |
| 4110 | class Mixed(Classic, object): pass |
| 4111 | |
| 4112 | The MRO (method resolution order) for each base class is respected |
| 4113 | according to its kind, but the MRO for the derived class is computed |
| 4114 | using new-style MRO rules if any base class is a new-style class. |
| 4115 | This needs to be documented. |
| 4116 | |
| 4117 | - The new builtin dictionary() constructor, and dictionary type, have |
| 4118 | been renamed to dict. This reflects a decade of common usage. |
| 4119 | |
| 4120 | - dict() now accepts an iterable object producing 2-sequences. For |
| 4121 | example, dict(d.items()) == d for any dictionary d. The argument, |
| 4122 | and the elements of the argument, can be any iterable objects. |
| 4123 | |
| 4124 | - New-style classes can now have a __del__ method, which is called |
| 4125 | when the instance is deleted (just like for classic classes). |
| 4126 | |
| 4127 | - Assignment to object.__dict__ is now possible, for objects that are |
| 4128 | instances of new-style classes that have a __dict__ (unless the base |
| 4129 | class forbids it). |
| 4130 | |
| 4131 | - Methods of built-in types now properly check for keyword arguments |
| 4132 | (formerly these were silently ignored). The only built-in methods |
| 4133 | that take keyword arguments are __call__, __init__ and __new__. |
| 4134 | |
| 4135 | - The socket function has been converted to a type; see below. |
| 4136 | |
| 4137 | Core and builtins |
| 4138 | ----------------- |
| 4139 | |
| 4140 | - Assignment to __debug__ raises SyntaxError at compile-time. This |
| 4141 | was promised when 2.1c1 was released as "What's New in Python 2.1c1" |
| 4142 | (see below) says. |
| 4143 | |
| 4144 | - Clarified the error messages for unsupported operands to an operator |
| 4145 | (like 1 + ''). |
| 4146 | |
| 4147 | Extension modules |
| 4148 | ----------------- |
| 4149 | |
| 4150 | - mmap has a new keyword argument, "access", allowing a uniform way for |
| 4151 | both Windows and Unix users to create read-only, write-through and |
| 4152 | copy-on-write memory mappings. This was previously possible only on |
| 4153 | Unix. A new keyword argument was required to support this in a |
| 4154 | uniform way because the mmap() signatures had diverged across |
| 4155 | platforms. Thanks to Jay T Miller for repairing this! |
| 4156 | |
| 4157 | - By default, the gc.garbage list now contains only those instances in |
| 4158 | unreachable cycles that have __del__ methods; in 2.1 it contained all |
| 4159 | instances in unreachable cycles. "Instances" here has been generalized |
| 4160 | to include instances of both new-style and old-style classes. |
| 4161 | |
| 4162 | - The socket module defines a new method for socket objects, |
| 4163 | sendall(). This is like send() but may make multiple calls to |
| 4164 | send() until all data has been sent. Also, the socket function has |
| 4165 | been converted to a subclassable type, like list and tuple (etc.) |
| 4166 | before it; socket and SocketType are now the same thing. |
| 4167 | |
| 4168 | - Various bugfixes to the curses module. There is now a test suite |
| 4169 | for the curses module (you have to run it manually). |
| 4170 | |
| 4171 | - binascii.b2a_base64 no longer places an arbitrary restriction of 57 |
| 4172 | bytes on its input. |
| 4173 | |
| 4174 | Library |
| 4175 | ------- |
| 4176 | |
| 4177 | - tkFileDialog exposes a Directory class and askdirectory |
| 4178 | convenience function. |
| 4179 | |
| 4180 | - Symbolic group names in regular expressions must be unique. For |
| 4181 | example, the regexp r'(?P<abc>)(?P<abc>)' is not allowed, because a |
| 4182 | single name can't mean both "group 1" and "group 2" simultaneously. |
| 4183 | Python 2.2 detects this error at regexp compilation time; |
| 4184 | previously, the error went undetected, and results were |
| 4185 | unpredictable. Also in sre, the pattern.split(), pattern.sub(), and |
| 4186 | pattern.subn() methods have been rewritten in C. Also, an |
| 4187 | experimental function/method finditer() has been added, which works |
| 4188 | like findall() but returns an iterator. |
| 4189 | |
| 4190 | - Tix exposes more commands through the classes DirSelectBox, |
| 4191 | DirSelectDialog, ListNoteBook, Meter, CheckList, and the |
| 4192 | methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog, |
| 4193 | tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions. |
| 4194 | |
| 4195 | - Traceback objects are now scanned by cyclic garbage collection, so |
| 4196 | cycles created by casual use of sys.exc_info() no longer cause |
| 4197 | permanent memory leaks (provided garbage collection is enabled). |
| 4198 | |
| 4199 | - os.extsep -- a new variable needed by the RISCOS support. It is the |
| 4200 | separator used by extensions, and is '.' on all platforms except |
| 4201 | RISCOS, where it is '/'. There is no need to use this variable |
| 4202 | unless you have a masochistic desire to port your code to RISCOS. |
| 4203 | |
| 4204 | - mimetypes.py has optional support for non-standard, but commonly |
| 4205 | found types. guess_type() and guess_extension() now accept an |
| 4206 | optional 'strict' flag, defaulting to true, which controls whether |
| 4207 | recognize non-standard types or not. A few non-standard types we |
| 4208 | know about have been added. Also, when run as a script, there are |
| 4209 | new -l and -e options. |
| 4210 | |
| 4211 | - statcache is now deprecated. |
| 4212 | |
| 4213 | - email.Utils.formatdate() now produces the preferred RFC 2822 style |
| 4214 | dates with numeric timezones (it used to produce obsolete dates |
| 4215 | hard coded to "GMT" timezone). An optional 'localtime' flag is |
| 4216 | added to produce dates in the local timezone, with daylight savings |
| 4217 | time properly taken into account. |
| 4218 | |
| 4219 | - In pickle and cPickle, instead of masking errors in load() by |
| 4220 | transforming them into SystemError, we let the original exception |
| 4221 | propagate out. Also, implement support for __safe_for_unpickling__ |
| 4222 | in pickle, as it already was supported in cPickle. |
| 4223 | |
| 4224 | Tools/Demos |
| 4225 | ----------- |
| 4226 | |
| 4227 | Build |
| 4228 | ----- |
| 4229 | |
| 4230 | - The dbm module is built using libdb1 if available. The bsddb module |
| 4231 | is built with libdb3 if available. |
| 4232 | |
| 4233 | - Misc/Makefile.pre.in has been removed by BDFL pronouncement. |
| 4234 | |
| 4235 | C API |
| 4236 | ----- |
| 4237 | |
| 4238 | - New function PySequence_Fast_GET_SIZE() returns the size of a non- |
| 4239 | NULL result from PySequence_Fast(), more quickly than calling |
| 4240 | PySequence_Size(). |
| 4241 | |
| 4242 | - New argument unpacking function PyArg_UnpackTuple() added. |
| 4243 | |
| 4244 | - New functions PyObject_CallFunctionObjArgs() and |
| 4245 | PyObject_CallMethodObjArgs() have been added to make it more |
| 4246 | convenient and efficient to call functions and methods from C. |
| 4247 | |
| 4248 | - PyArg_ParseTupleAndKeywords() no longer masks errors, so it's |
| 4249 | possible that this will propagate errors it didn't before. |
| 4250 | |
| 4251 | - New function PyObject_CheckReadBuffer(), which returns true if its |
| 4252 | argument supports the single-segment readable buffer interface. |
| 4253 | |
| 4254 | New platforms |
| 4255 | ------------- |
| 4256 | |
| 4257 | - We've finally confirmed that this release builds on HP-UX 11.00, |
| 4258 | *with* threads, and passes the test suite. |
| 4259 | |
| 4260 | - Thanks to a series of patches from Michael Muller, Python may build |
| 4261 | again under OS/2 Visual Age C++. |
| 4262 | |
| 4263 | - Updated RISCOS port by Dietmar Schwertberger. |
| 4264 | |
| 4265 | Tests |
| 4266 | ----- |
| 4267 | |
| 4268 | - Added a test script for the curses module. It isn't run automatically; |
| 4269 | regrtest.py must be run with '-u curses' to enable it. |
| 4270 | |
| 4271 | Windows |
| 4272 | ------- |
| 4273 | |
| 4274 | Mac |
| 4275 | ---- |
| 4276 | |
| 4277 | - PythonScript has been moved to unsupported and is slated to be |
| 4278 | removed completely in the next release. |
| 4279 | |
| 4280 | - It should now be possible to build applets that work on both OS9 and |
| 4281 | OSX. |
| 4282 | |
| 4283 | - The core is now linked with CoreServices not Carbon; as a side |
| 4284 | result, default 8bit encoding on OSX is now ASCII. |
| 4285 | |
| 4286 | - Python should now build on OSX 10.1.1 |
| 4287 | |
| 4288 | |
| 4289 | What's New in Python 2.2b1? |
| 4290 | =========================== |
| 4291 | |
| 4292 | *Release date: 19-Oct-2001* |
| 4293 | |
| 4294 | Type/class unification and new-style classes |
| 4295 | -------------------------------------------- |
| 4296 | |
| 4297 | - New-style classes are now always dynamic (except for built-in and |
| 4298 | extension types). There is no longer a performance penalty, and I |
| 4299 | no longer see another reason to keep this baggage around. One relic |
| 4300 | remains: the __dict__ of a new-style class is a read-only proxy; you |
| 4301 | must set the class's attribute to modify it. As a consequence, the |
| 4302 | __defined__ attribute of new-style types no longer exists, for lack |
| 4303 | of need: there is once again only one __dict__ (although in the |
| 4304 | future a __cache__ may be resurrected with a similar function, if I |
| 4305 | can prove that it actually speeds things up). |
| 4306 | |
| 4307 | - C.__doc__ now works as expected for new-style classes (in 2.2a4 it |
| 4308 | always returned None, even when there was a class docstring). |
| 4309 | |
| 4310 | - doctest now finds and runs docstrings attached to new-style classes, |
| 4311 | class methods, static methods, and properties. |
| 4312 | |
| 4313 | Core and builtins |
| 4314 | ----------------- |
| 4315 | |
| 4316 | - A very subtle syntactical pitfall in list comprehensions was fixed. |
| 4317 | For example: [a+b for a in 'abc', for b in 'def']. The comma in |
| 4318 | this example is a mistake. Previously, this would silently let 'a' |
| 4319 | iterate over the singleton tuple ('abc',), yielding ['abcd', 'abce', |
| 4320 | 'abcf'] rather than the intended ['ad', 'ae', 'af', 'bd', 'be', |
| 4321 | 'bf', 'cd', 'ce', 'cf']. Now, this is flagged as a syntax error. |
| 4322 | Note that [a for a in <singleton>] is a convoluted way to say |
| 4323 | [<singleton>] anyway, so it's not like any expressiveness is lost. |
| 4324 | |
| 4325 | - getattr(obj, name, default) now only catches AttributeError, as |
| 4326 | documented, rather than returning the default value for all |
| 4327 | exceptions (which could mask bugs in a __getattr__ hook, for |
| 4328 | example). |
| 4329 | |
| 4330 | - Weak reference objects are now part of the core and offer a C API. |
| 4331 | A bug which could allow a core dump when binary operations involved |
| 4332 | proxy reference has been fixed. weakref.ReferenceError is now a |
| 4333 | built-in exception. |
| 4334 | |
| 4335 | - unicode(obj) now behaves more like str(obj), accepting arbitrary |
| 4336 | objects, and calling a __unicode__ method if it exists. |
| 4337 | unicode(obj, encoding) and unicode(obj, encoding, errors) still |
| 4338 | require an 8-bit string or character buffer argument. |
| 4339 | |
| 4340 | - isinstance() now allows any object as the first argument and a |
| 4341 | class, a type or something with a __bases__ tuple attribute for the |
| 4342 | second argument. The second argument may also be a tuple of a |
| 4343 | class, type, or something with __bases__, in which case isinstance() |
| 4344 | will return true if the first argument is an instance of any of the |
| 4345 | things contained in the second argument tuple. E.g. |
| 4346 | |
| 4347 | isinstance(x, (A, B)) |
| 4348 | |
| 4349 | returns true if x is an instance of A or B. |
| 4350 | |
| 4351 | Extension modules |
| 4352 | ----------------- |
| 4353 | |
| 4354 | - thread.start_new_thread() now returns the thread ID (previously None). |
| 4355 | |
| 4356 | - binascii has now two quopri support functions, a2b_qp and b2a_qp. |
| 4357 | |
| 4358 | - readline now supports setting the startup_hook and the |
| 4359 | pre_event_hook, and adds the add_history() function. |
| 4360 | |
| 4361 | - os and posix supports chroot(), setgroups() and unsetenv() where |
| 4362 | available. The stat(), fstat(), statvfs() and fstatvfs() functions |
| 4363 | now return "pseudo-sequences" -- the various fields can now be |
| 4364 | accessed as attributes (e.g. os.stat("/").st_mtime) but for |
| 4365 | backwards compatibility they also behave as a fixed-length sequence. |
| 4366 | Some platform-specific fields (e.g. st_rdev) are only accessible as |
| 4367 | attributes. |
| 4368 | |
| 4369 | - time: localtime(), gmtime() and strptime() now return a |
| 4370 | pseudo-sequence similar to the os.stat() return value, with |
| 4371 | attributes like tm_year etc. |
| 4372 | |
| 4373 | - Decompression objects in the zlib module now accept an optional |
| 4374 | second parameter to decompress() that specifies the maximum amount |
| 4375 | of memory to use for the uncompressed data. |
| 4376 | |
| 4377 | - optional SSL support in the socket module now exports OpenSSL |
| 4378 | functions RAND_add(), RAND_egd(), and RAND_status(). These calls |
| 4379 | are useful on platforms like Solaris where OpenSSL does not |
| 4380 | automatically seed its PRNG. Also, the keyfile and certfile |
| 4381 | arguments to socket.ssl() are now optional. |
| 4382 | |
| 4383 | - posixmodule (and by extension, the os module on POSIX platforms) now |
| 4384 | exports O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW. |
| 4385 | |
| 4386 | Library |
| 4387 | ------- |
| 4388 | |
| 4389 | - doctest now excludes functions and classes not defined by the module |
| 4390 | being tested, thanks to Tim Hochberg. |
| 4391 | |
| 4392 | - HotShot, a new profiler implemented using a C-based callback, has |
| 4393 | been added. This substantially reduces the overhead of profiling, |
| 4394 | but it is still quite preliminary. Support modules and |
| 4395 | documentation will be added in upcoming releases (before 2.2 final). |
| 4396 | |
| 4397 | - profile now produces correct output in situations where an exception |
| 4398 | raised in Python is cleared by C code (e.g. hasattr()). This used |
| 4399 | to cause wrong output, including spurious claims of recursive |
| 4400 | functions and attribution of time spent to the wrong function. |
| 4401 | |
| 4402 | The code and documentation for the derived OldProfile and HotProfile |
| 4403 | profiling classes was removed. The code hasn't worked for years (if |
| 4404 | you tried to use them, they raised exceptions). OldProfile |
| 4405 | intended to reproduce the behavior of the profiler Python used more |
| 4406 | than 7 years ago, and isn't interesting anymore. HotProfile intended |
| 4407 | to provide a faster profiler (but producing less information), and |
| 4408 | that's a worthy goal we intend to meet via a different approach (but |
| 4409 | without losing information). |
| 4410 | |
| 4411 | - Profile.calibrate() has a new implementation that should deliver |
| 4412 | a much better system-specific calibration constant. The constant can |
| 4413 | now be specified in an instance constructor, or as a Profile class or |
| 4414 | instance variable, instead of by editing profile.py's source code. |
| 4415 | Calibration must still be done manually (see the docs for the profile |
| 4416 | module). |
| 4417 | |
| 4418 | Note that Profile.calibrate() must be overridden by subclasses. |
| 4419 | Improving the accuracy required exploiting detailed knowledge of |
| 4420 | profiler internals; the earlier method abstracted away the details |
| 4421 | and measured a simplified model instead, but consequently computed |
| 4422 | a constant too small by a factor of 2 on some modern machines. |
| 4423 | |
| 4424 | - quopri's encode and decode methods take an optional header parameter, |
| 4425 | which indicates whether output is intended for the header 'Q' |
| 4426 | encoding. |
| 4427 | |
| 4428 | - The SocketServer.ThreadingMixIn class now closes the request after |
| 4429 | finish_request() returns. (Not when it errors out though.) |
| 4430 | |
| 4431 | - The nntplib module's NNTP.body() method has grown a 'file' argument |
| 4432 | to allow saving the message body to a file. |
| 4433 | |
| 4434 | - The email package has added a class email.Parser.HeaderParser which |
| 4435 | only parses headers and does not recurse into the message's body. |
| 4436 | Also, the module/class MIMEAudio has been added for representing |
| 4437 | audio data (contributed by Anthony Baxter). |
| 4438 | |
| 4439 | - ftplib should be able to handle files > 2GB. |
| 4440 | |
| 4441 | - ConfigParser.getboolean() now also interprets TRUE, FALSE, YES, NO, |
| 4442 | ON, and OFF. |
| 4443 | |
| 4444 | - xml.dom.minidom NodeList objects now support the length attribute |
| 4445 | and item() method as required by the DOM specifications. |
| 4446 | |
| 4447 | Tools/Demos |
| 4448 | ----------- |
| 4449 | |
| 4450 | - Demo/dns was removed. It no longer serves any purpose; a package |
| 4451 | derived from it is now maintained by Anthony Baxter, see |
| 4452 | http://PyDNS.SourceForge.net. |
| 4453 | |
| 4454 | - The freeze tool has been made more robust, and two new options have |
| 4455 | been added: -X and -E. |
| 4456 | |
| 4457 | Build |
| 4458 | ----- |
| 4459 | |
| 4460 | - configure will use CXX in LINKCC if CXX is used to build main() and |
| 4461 | the system requires to link a C++ main using the C++ compiler. |
| 4462 | |
| 4463 | C API |
| 4464 | ----- |
| 4465 | |
| 4466 | - The documentation for the tp_compare slot is updated to require that |
| 4467 | the return value must be -1, 0, 1; an arbitrary number <0 or >0 is |
| 4468 | not correct. This is not yet enforced but will be enforced in |
| 4469 | Python 2.3; even later, we may use -2 to indicate errors and +2 for |
| 4470 | "NotImplemented". Right now, -1 should be used for an error return. |
| 4471 | |
| 4472 | - PyLong_AsLongLong() now accepts int (as well as long) arguments. |
| 4473 | Consequently, PyArg_ParseTuple's 'L' code also accepts int (as well |
| 4474 | as long) arguments. |
| 4475 | |
| 4476 | - PyThread_start_new_thread() now returns a long int giving the thread |
| 4477 | ID, if one can be calculated; it returns -1 for error, 0 if no |
| 4478 | thread ID is calculated (this is an incompatible change, but only |
| 4479 | the thread module used this API). This code has only really been |
| 4480 | tested on Linux and Windows; other platforms please beware (and |
| 4481 | report any bugs or strange behavior). |
| 4482 | |
| 4483 | - PyUnicode_FromEncodedObject() no longer accepts Unicode objects as |
| 4484 | input. |
| 4485 | |
| 4486 | New platforms |
| 4487 | ------------- |
| 4488 | |
| 4489 | Tests |
| 4490 | ----- |
| 4491 | |
| 4492 | Windows |
| 4493 | ------- |
| 4494 | |
| 4495 | - Installer: If you install IDLE, and don't disable file-extension |
| 4496 | registration, a new "Edit with IDLE" context (right-click) menu entry |
| 4497 | is created for .py and .pyw files. |
| 4498 | |
| 4499 | - The signal module now supports SIGBREAK on Windows, thanks to Steven |
| 4500 | Scott. Note that SIGBREAK is unique to Windows. The default SIGBREAK |
| 4501 | action remains to call Win32 ExitProcess(). This can be changed via |
| 4502 | signal.signal(). For example:: |
| 4503 | |
| 4504 | # Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C |
| 4505 | # (SIGINT) behavior. |
| 4506 | import signal |
| 4507 | signal.signal(signal.SIGBREAK, signal.default_int_handler) |
| 4508 | |
| 4509 | try: |
| 4510 | while 1: |
| 4511 | pass |
| 4512 | except KeyboardInterrupt: |
| 4513 | # We get here on Ctrl+C or Ctrl+Break now; if we had not changed |
| 4514 | # SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the |
| 4515 | # program without the possibility for any Python-level cleanup). |
| 4516 | print "Clean exit" |
| 4517 | |
| 4518 | |
| 4519 | What's New in Python 2.2a4? |
| 4520 | =========================== |
| 4521 | |
| 4522 | *Release date: 28-Sep-2001* |
| 4523 | |
| 4524 | Type/class unification and new-style classes |
| 4525 | -------------------------------------------- |
| 4526 | |
| 4527 | - pydoc and inspect are now aware of new-style classes; |
| 4528 | e.g. help(list) at the interactive prompt now shows proper |
| 4529 | documentation for all operations on list objects. |
| 4530 | |
| 4531 | - Applications using Jim Fulton's ExtensionClass module can now safely |
| 4532 | be used with Python 2.2. In particular, Zope 2.4.1 now works with |
| 4533 | Python 2.2 (as well as with Python 2.1.1). The Demo/metaclass |
| 4534 | examples also work again. It is hoped that Gtk and Boost also work |
| 4535 | with 2.2a4 and beyond. (If you can confirm this, please write |
| 4536 | webmaster@python.org; if there are still problems, please open a bug |
| 4537 | report on SourceForge.) |
| 4538 | |
| 4539 | - property() now takes 4 keyword arguments: fget, fset, fdel and doc. |
| 4540 | These map to read-only attributes 'fget', 'fset', 'fdel', and '__doc__' |
| 4541 | in the constructed property object. fget, fset and fdel weren't |
| 4542 | discoverable from Python in 2.2a3. __doc__ is new, and allows to |
| 4543 | associate a docstring with a property. |
| 4544 | |
| 4545 | - Comparison overloading is now more completely implemented. For |
| 4546 | example, a str subclass instance can properly be compared to a str |
| 4547 | instance, and it can properly overload comparison. Ditto for most |
| 4548 | other built-in object types. |
| 4549 | |
| 4550 | - The repr() of new-style classes has changed; instead of <type |
| 4551 | 'M.Foo'> a new-style class is now rendered as <class 'M.Foo'>, |
| 4552 | *except* for built-in types, which are still rendered as <type |
| 4553 | 'Foo'> (to avoid upsetting existing code that might parse or |
| 4554 | otherwise rely on repr() of certain type objects). |
| 4555 | |
| 4556 | - The repr() of new-style objects is now always <Foo object at XXX>; |
| 4557 | previously, it was sometimes <Foo instance at XXX>. |
| 4558 | |
| 4559 | - For new-style classes, what was previously called __getattr__ is now |
| 4560 | called __getattribute__. This method, if defined, is called for |
| 4561 | *every* attribute access. A new __getattr__ hook more similar to the |
| 4562 | one in classic classes is defined which is called only if regular |
| 4563 | attribute access raises AttributeError; to catch *all* attribute |
| 4564 | access, you can use __getattribute__ (for new-style classes). If |
| 4565 | both are defined, __getattribute__ is called first, and if it raises |
| 4566 | AttributeError, __getattr__ is called. |
| 4567 | |
| 4568 | - The __class__ attribute of new-style objects can be assigned to. |
| 4569 | The new class must have the same C-level object layout as the old |
| 4570 | class. |
| 4571 | |
| 4572 | - The builtin file type can be subclassed now. In the usual pattern, |
| 4573 | "file" is the name of the builtin type, and file() is a new builtin |
| 4574 | constructor, with the same signature as the builtin open() function. |
| 4575 | file() is now the preferred way to open a file. |
| 4576 | |
| 4577 | - Previously, __new__ would only see sequential arguments passed to |
| 4578 | the type in a constructor call; __init__ would see both sequential |
| 4579 | and keyword arguments. This made no sense whatsoever any more, so |
| 4580 | now both __new__ and __init__ see all arguments. |
| 4581 | |
| 4582 | - Previously, hash() applied to an instance of a subclass of str or |
| 4583 | unicode always returned 0. This has been repaired. |
| 4584 | |
| 4585 | - Previously, an operation on an instance of a subclass of an |
| 4586 | immutable type (int, long, float, complex, tuple, str, unicode), |
| 4587 | where the subtype didn't override the operation (and so the |
| 4588 | operation was handled by the builtin type), could return that |
| 4589 | instance instead a value of the base type. For example, if s was of |
| 4590 | a str subclass type, s[:] returned s as-is. Now it returns a str |
| 4591 | with the same value as s. |
| 4592 | |
| 4593 | - Provisional support for pickling new-style objects has been added. |
| 4594 | |
| 4595 | Core |
| 4596 | ---- |
| 4597 | |
| 4598 | - file.writelines() now accepts any iterable object producing strings. |
| 4599 | |
| 4600 | - PyUnicode_FromEncodedObject() now works very much like |
| 4601 | PyObject_Str(obj) in that it tries to use __str__/tp_str |
| 4602 | on the object if the object is not a string or buffer. This |
| 4603 | makes unicode() behave like str() when applied to non-string/buffer |
| 4604 | objects. |
| 4605 | |
| 4606 | - PyFile_WriteObject now passes Unicode objects to the file's write |
| 4607 | method. As a result, all file-like objects which may be the target |
| 4608 | of a print statement must support Unicode objects, i.e. they must |
| 4609 | at least convert them into ASCII strings. |
| 4610 | |
| 4611 | - Thread scheduling on Solaris should be improved; it is no longer |
| 4612 | necessary to insert a small sleep at the start of a thread in order |
| 4613 | to let other runnable threads be scheduled. |
| 4614 | |
| 4615 | Library |
| 4616 | ------- |
| 4617 | |
| 4618 | - StringIO.StringIO instances and cStringIO.StringIO instances support |
| 4619 | read character buffer compatible objects for their .write() methods. |
| 4620 | These objects are converted to strings and then handled as such |
| 4621 | by the instances. |
| 4622 | |
| 4623 | - The "email" package has been added. This is basically a port of the |
| 4624 | mimelib package <http://sf.net/projects/mimelib> with API changes |
| 4625 | and some implementations updated to use iterators and generators. |
| 4626 | |
| 4627 | - difflib.ndiff() and difflib.Differ.compare() are generators now. This |
| 4628 | restores the ability of Tools/scripts/ndiff.py to start producing output |
| 4629 | before the entire comparison is complete. |
| 4630 | |
| 4631 | - StringIO.StringIO instances and cStringIO.StringIO instances support |
| 4632 | iteration just like file objects (i.e. their .readline() method is |
| 4633 | called for each iteration until it returns an empty string). |
| 4634 | |
| 4635 | - The codecs module has grown four new helper APIs to access |
| 4636 | builtin codecs: getencoder(), getdecoder(), getreader(), |
| 4637 | getwriter(). |
| 4638 | |
| 4639 | - SimpleXMLRPCServer: a new module (based upon SimpleHTMLServer) |
| 4640 | simplifies writing XML RPC servers. |
| 4641 | |
| 4642 | - os.path.realpath(): a new function that returns the absolute pathname |
| 4643 | after interpretation of symbolic links. On non-Unix systems, this |
| 4644 | is an alias for os.path.abspath(). |
| 4645 | |
| 4646 | - operator.indexOf() (PySequence_Index() in the C API) now works with any |
| 4647 | iterable object. |
| 4648 | |
| 4649 | - smtplib now supports various authentication and security features of |
| 4650 | the SMTP protocol through the new login() and starttls() methods. |
| 4651 | |
| 4652 | - hmac: a new module implementing keyed hashing for message |
| 4653 | authentication. |
| 4654 | |
| 4655 | - mimetypes now recognizes more extensions and file types. At the |
| 4656 | same time, some mappings not sanctioned by IANA were removed. |
| 4657 | |
| 4658 | - The "compiler" package has been brought up to date to the state of |
| 4659 | Python 2.2 bytecode generation. It has also been promoted from a |
| 4660 | Tool to a standard library package. (Tools/compiler still exists as |
| 4661 | a sample driver.) |
| 4662 | |
| 4663 | Build |
| 4664 | ----- |
| 4665 | |
| 4666 | - Large file support (LFS) is now automatic when the platform supports |
| 4667 | it; no more manual configuration tweaks are needed. On Linux, at |
| 4668 | least, it's possible to have a system whose C library supports large |
| 4669 | files but whose kernel doesn't; in this case, large file support is |
| 4670 | still enabled but doesn't do you any good unless you upgrade your |
| 4671 | kernel or share your Python executable with another system whose |
| 4672 | kernel has large file support. |
| 4673 | |
| 4674 | - The configure script now supplies plausible defaults in a |
| 4675 | cross-compilation environment. This doesn't mean that the supplied |
| 4676 | values are always correct, or that cross-compilation now works |
| 4677 | flawlessly -- but it's a first step (and it shuts up most of |
| 4678 | autoconf's warnings about AC_TRY_RUN). |
| 4679 | |
| 4680 | - The Unix build is now a bit less chatty, courtesy of the parser |
| 4681 | generator. The build is completely silent (except for errors) when |
| 4682 | using "make -s", thanks to a -q option to setup.py. |
| 4683 | |
| 4684 | C API |
| 4685 | ----- |
| 4686 | |
| 4687 | - The "structmember" API now supports some new flag bits to deny read |
| 4688 | and/or write access to attributes in restricted execution mode. |
| 4689 | |
| 4690 | New platforms |
| 4691 | ------------- |
| 4692 | |
| 4693 | - Compaq's iPAQ handheld, running the "familiar" Linux distribution |
| 4694 | (http://familiar.handhelds.org). |
| 4695 | |
| 4696 | Tests |
| 4697 | ----- |
| 4698 | |
| 4699 | - The "classic" standard tests, which work by comparing stdout to |
| 4700 | an expected-output file under Lib/test/output/, no longer stop at |
| 4701 | the first mismatch. Instead the test is run to completion, and a |
| 4702 | variant of ndiff-style comparison is used to report all differences. |
| 4703 | This is much easier to understand than the previous style of reporting. |
| 4704 | |
| 4705 | - The unittest-based standard tests now use regrtest's test_main() |
| 4706 | convention, instead of running as a side-effect of merely being |
| 4707 | imported. This allows these tests to be run in more natural and |
| 4708 | flexible ways as unittests, outside the regrtest framework. |
| 4709 | |
| 4710 | - regrtest.py is much better integrated with unittest and doctest now, |
| 4711 | especially in regard to reporting errors. |
| 4712 | |
| 4713 | Windows |
| 4714 | ------- |
| 4715 | |
| 4716 | - Large file support now also works for files > 4GB, on filesystems |
| 4717 | that support it (NTFS under Windows 2000). See "What's New in |
| 4718 | Python 2.2a3" for more detail. |
| 4719 | |
| 4720 | |
| 4721 | What's New in Python 2.2a3? |
| 4722 | =========================== |
| 4723 | |
| 4724 | *Release Date: 07-Sep-2001* |
| 4725 | |
| 4726 | Core |
| 4727 | ---- |
| 4728 | |
| 4729 | - Conversion of long to float now raises OverflowError if the long is too |
| 4730 | big to represent as a C double. |
| 4731 | |
| 4732 | - The 3-argument builtin pow() no longer allows a third non-None argument |
| 4733 | if either of the first two arguments is a float, or if both are of |
| 4734 | integer types and the second argument is negative (in which latter case |
| 4735 | the arguments are converted to float, so this is really the same |
| 4736 | restriction). |
| 4737 | |
| 4738 | - The builtin dir() now returns more information, and sometimes much |
| 4739 | more, generally naming all attributes of an object, and all attributes |
| 4740 | reachable from the object via its class, and from its class's base |
| 4741 | classes, and so on from them too. Example: in 2.2a2, dir([]) returned |
| 4742 | an empty list. In 2.2a3, |
| 4743 | |
| 4744 | >>> dir([]) |
| 4745 | ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', |
| 4746 | '__eq__', '__ge__', '__getattr__', '__getitem__', '__getslice__', |
| 4747 | '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__le__', |
| 4748 | '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__repr__', |
| 4749 | '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__', |
| 4750 | 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', |
| 4751 | 'reverse', 'sort'] |
| 4752 | |
| 4753 | dir(module) continues to return only the module's attributes, though. |
| 4754 | |
| 4755 | - Overflowing operations on plain ints now return a long int rather |
| 4756 | than raising OverflowError. This is a partial implementation of PEP |
| 4757 | 237. You can use -Wdefault::OverflowWarning to enable a warning for |
| 4758 | this situation, and -Werror::OverflowWarning to revert to the old |
| 4759 | OverflowError exception. |
| 4760 | |
| 4761 | - A new command line option, -Q<arg>, is added to control run-time |
| 4762 | warnings for the use of classic division. (See PEP 238.) Possible |
| 4763 | values are -Qold, -Qwarn, -Qwarnall, and -Qnew. The default is |
| 4764 | -Qold, meaning the / operator has its classic meaning and no |
| 4765 | warnings are issued. Using -Qwarn issues a run-time warning about |
| 4766 | all uses of classic division for int and long arguments; -Qwarnall |
| 4767 | also warns about classic division for float and complex arguments |
| 4768 | (for use with fixdiv.py). |
| 4769 | [Note: the remainder of this item (preserved below) became |
| 4770 | obsolete in 2.2c1 -- -Qnew has global effect in 2.2] :: |
| 4771 | |
| 4772 | Using -Qnew is questionable; it turns on new division by default, but |
| 4773 | only in the __main__ module. You can usefully combine -Qwarn or |
| 4774 | -Qwarnall and -Qnew: this gives the __main__ module new division, and |
| 4775 | warns about classic division everywhere else. |
| 4776 | |
| 4777 | - Many built-in types can now be subclassed. This applies to int, |
| 4778 | long, float, str, unicode, and tuple. (The types complex, list and |
| 4779 | dictionary can also be subclassed; this was introduced earlier.) |
| 4780 | Note that restrictions apply when subclassing immutable built-in |
| 4781 | types: you can only affect the value of the instance by overloading |
| 4782 | __new__. You can add mutable attributes, and the subclass instances |
| 4783 | will have a __dict__ attribute, but you cannot change the "value" |
| 4784 | (as implemented by the base class) of an immutable subclass instance |
| 4785 | once it is created. |
| 4786 | |
| 4787 | - The dictionary constructor now takes an optional argument, a |
| 4788 | mapping-like object, and initializes the dictionary from its |
| 4789 | (key, value) pairs. |
| 4790 | |
| 4791 | - A new built-in type, super, has been added. This facilitates making |
| 4792 | "cooperative super calls" in a multiple inheritance setting. For an |
| 4793 | explanation, see http://www.python.org/2.2/descrintro.html#cooperation |
| 4794 | |
| 4795 | - A new built-in type, property, has been added. This enables the |
| 4796 | creation of "properties". These are attributes implemented by |
| 4797 | getter and setter functions (or only one of these for read-only or |
| 4798 | write-only attributes), without the need to override __getattr__. |
| 4799 | See http://www.python.org/2.2/descrintro.html#property |
| 4800 | |
| 4801 | - The syntax of floating-point and imaginary literals has been |
| 4802 | liberalized, to allow leading zeroes. Examples of literals now |
| 4803 | legal that were SyntaxErrors before: |
| 4804 | |
| 4805 | 00.0 0e3 0100j 07.5 00000000000000000008. |
| 4806 | |
| 4807 | - An old tokenizer bug allowed floating point literals with an incomplete |
| 4808 | exponent, such as 1e and 3.1e-. Such literals now raise SyntaxError. |
| 4809 | |
| 4810 | Library |
| 4811 | ------- |
| 4812 | |
| 4813 | - telnetlib includes symbolic names for the options, and support for |
| 4814 | setting an option negotiation callback. It also supports processing |
| 4815 | of suboptions. |
| 4816 | |
| 4817 | - The new C standard no longer requires that math libraries set errno to |
| 4818 | ERANGE on overflow. For platform libraries that exploit this new |
| 4819 | freedom, Python's overflow-checking was wholly broken. A new overflow- |
| 4820 | checking scheme attempts to repair that, but may not be reliable on all |
| 4821 | platforms (C doesn't seem to provide anything both useful and portable |
| 4822 | in this area anymore). |
| 4823 | |
| 4824 | - Asynchronous timeout actions are available through the new class |
| 4825 | threading.Timer. |
| 4826 | |
| 4827 | - math.log and math.log10 now return sensible results for even huge |
| 4828 | long arguments. For example, math.log10(10 ** 10000) ~= 10000.0. |
| 4829 | |
| 4830 | - A new function, imp.lock_held(), returns 1 when the import lock is |
| 4831 | currently held. See the docs for the imp module. |
| 4832 | |
| 4833 | - pickle, cPickle and marshal on 32-bit platforms can now correctly read |
| 4834 | dumps containing ints written on platforms where Python ints are 8 bytes. |
| 4835 | When read on a box where Python ints are 4 bytes, such values are |
| 4836 | converted to Python longs. |
| 4837 | |
| 4838 | - In restricted execution mode (using the rexec module), unmarshalling |
| 4839 | code objects is no longer allowed. This plugs a security hole. |
| 4840 | |
| 4841 | - unittest.TestResult instances no longer store references to tracebacks |
| 4842 | generated by test failures. This prevents unexpected dangling references |
| 4843 | to objects that should be garbage collected between tests. |
| 4844 | |
| 4845 | Tools |
| 4846 | ----- |
| 4847 | |
| 4848 | - Tools/scripts/fixdiv.py has been added which can be used to fix |
| 4849 | division operators as per PEP 238. |
| 4850 | |
| 4851 | Build |
| 4852 | ----- |
| 4853 | |
| 4854 | - If you are an adventurous person using Mac OS X you may want to look at |
| 4855 | Mac/OSX. There is a Makefile there that will build Python as a real Mac |
| 4856 | application, which can be used for experimenting with Carbon or Cocoa. |
| 4857 | Discussion of this on pythonmac-sig, please. |
| 4858 | |
| 4859 | C API |
| 4860 | ----- |
| 4861 | |
| 4862 | - New function PyObject_Dir(obj), like Python __builtin__.dir(obj). |
| 4863 | |
| 4864 | - Note that PyLong_AsDouble can fail! This has always been true, but no |
| 4865 | callers checked for it. It's more likely to fail now, because overflow |
| 4866 | errors are properly detected now. The proper way to check:: |
| 4867 | |
| 4868 | double x = PyLong_AsDouble(some_long_object); |
| 4869 | if (x == -1.0 && PyErr_Occurred()) { |
| 4870 | /* The conversion failed. */ |
| 4871 | } |
| 4872 | |
| 4873 | - The GC API has been changed. Extensions that use the old API will still |
| 4874 | compile but will not participate in GC. To upgrade an extension |
| 4875 | module: |
| 4876 | |
| 4877 | - rename Py_TPFLAGS_GC to PyTPFLAGS_HAVE_GC |
| 4878 | |
| 4879 | - use PyObject_GC_New or PyObject_GC_NewVar to allocate objects and |
| 4880 | PyObject_GC_Del to deallocate them |
| 4881 | |
| 4882 | - rename PyObject_GC_Init to PyObject_GC_Track and PyObject_GC_Fini |
| 4883 | to PyObject_GC_UnTrack |
| 4884 | |
| 4885 | - remove PyGC_HEAD_SIZE from object size calculations |
| 4886 | |
| 4887 | - remove calls to PyObject_AS_GC and PyObject_FROM_GC |
| 4888 | |
| 4889 | - Two new functions: PyString_FromFormat() and PyString_FromFormatV(). |
| 4890 | These can be used safely to construct string objects from a |
| 4891 | sprintf-style format string (similar to the format string supported |
| 4892 | by PyErr_Format()). |
| 4893 | |
| 4894 | New platforms |
| 4895 | ------------- |
| 4896 | |
| 4897 | - Stephen Hansen contributed patches sufficient to get a clean compile |
| 4898 | under Borland C (Windows), but he reports problems running it and ran |
| 4899 | out of time to complete the port. Volunteers? Expect a MemoryError |
| 4900 | when importing the types module; this is probably shallow, and |
| 4901 | causing later failures too. |
| 4902 | |
| 4903 | Tests |
| 4904 | ----- |
| 4905 | |
| 4906 | Windows |
| 4907 | ------- |
| 4908 | |
| 4909 | - Large file support is now enabled on Win32 platforms as well as on |
| 4910 | Win64. This means that, for example, you can use f.tell() and f.seek() |
| 4911 | to manipulate files larger than 2 gigabytes (provided you have enough |
| 4912 | disk space, and are using a Windows filesystem that supports large |
| 4913 | partitions). Windows filesystem limits: FAT has a 2GB (gigabyte) |
| 4914 | filesize limit, and large file support makes no difference there. |
| 4915 | FAT32's limit is 4GB, and files >= 2GB are easier to use from Python now. |
| 4916 | NTFS has no practical limit on file size, and files of any size can be |
| 4917 | used from Python now. |
| 4918 | |
| 4919 | - The w9xpopen hack is now used on Windows NT and 2000 too when COMPSPEC |
| 4920 | points to command.com (patch from Brian Quinlan). |
| 4921 | |
| 4922 | |
| 4923 | What's New in Python 2.2a2? |
| 4924 | =========================== |
| 4925 | |
| 4926 | *Release Date: 22-Aug-2001* |
| 4927 | |
| 4928 | Build |
| 4929 | ----- |
| 4930 | |
| 4931 | - Tim Peters developed a brand new Windows installer using Wise 8.1, |
| 4932 | generously donated to us by Wise Solutions. |
| 4933 | |
| 4934 | - configure supports a new option --enable-unicode, with the values |
| 4935 | ucs2 and ucs4 (new in 2.2a1). With --disable-unicode, the Unicode |
| 4936 | type and supporting code is completely removed from the interpreter. |
| 4937 | |
| 4938 | - A new configure option --enable-framework builds a Mac OS X framework, |
| 4939 | which "make frameworkinstall" will install. This provides a starting |
| 4940 | point for more mac-like functionality, join pythonmac-sig@python.org |
| 4941 | if you are interested in helping. |
| 4942 | |
| 4943 | - The NeXT platform is no longer supported. |
| 4944 | |
| 4945 | - The 'new' module is now statically linked. |
| 4946 | |
| 4947 | Tools |
| 4948 | ----- |
| 4949 | |
| 4950 | - The new Tools/scripts/cleanfuture.py can be used to automatically |
| 4951 | edit out obsolete future statements from Python source code. See |
| 4952 | the module docstring for details. |
| 4953 | |
| 4954 | Tests |
| 4955 | ----- |
| 4956 | |
| 4957 | - regrtest.py now knows which tests are expected to be skipped on some |
| 4958 | platforms, allowing to give clearer test result output. regrtest |
| 4959 | also has optional --use/-u switch to run normally disabled tests |
| 4960 | which require network access or consume significant disk resources. |
| 4961 | |
| 4962 | - Several new tests in the standard test suite, with special thanks to |
| 4963 | Nick Mathewson. |
| 4964 | |
| 4965 | Core |
| 4966 | ---- |
| 4967 | |
| 4968 | - The floor division operator // has been added as outlined in PEP |
| 4969 | 238. The / operator still provides classic division (and will until |
| 4970 | Python 3.0) unless "from __future__ import division" is included, in |
| 4971 | which case the / operator will provide true division. The operator |
| 4972 | module provides truediv() and floordiv() functions. Augmented |
| 4973 | assignment variants are included, as are the equivalent overloadable |
| 4974 | methods and C API methods. See the PEP for a full discussion: |
| 4975 | <http://python.sf.net/peps/pep-0238.html> |
| 4976 | |
| 4977 | - Future statements are now effective in simulated interactive shells |
| 4978 | (like IDLE). This should "just work" by magic, but read Michael |
| 4979 | Hudson's "Future statements in simulated shells" PEP 264 for full |
| 4980 | details: <http://python.sf.net/peps/pep-0264.html>. |
| 4981 | |
| 4982 | - The type/class unification (PEP 252-253) was integrated into the |
| 4983 | trunk and is not so tentative any more (the exact specification of |
| 4984 | some features is still tentative). A lot of work has done on fixing |
| 4985 | bugs and adding robustness and features (performance still has to |
| 4986 | come a long way). |
| 4987 | |
| 4988 | - Warnings about a mismatch in the Python API during extension import |
| 4989 | now use the Python warning framework (which makes it possible to |
| 4990 | write filters for these warnings). |
| 4991 | |
| 4992 | - A function's __dict__ (aka func_dict) will now always be a |
| 4993 | dictionary. It used to be possible to delete it or set it to None, |
| 4994 | but now both actions raise TypeErrors. It is still legal to set it |
| 4995 | to a dictionary object. Getting func.__dict__ before any attributes |
| 4996 | have been assigned now returns an empty dictionary instead of None. |
| 4997 | |
| 4998 | - A new command line option, -E, was added which disables the use of |
| 4999 | all environment variables, or at least those that are specifically |
| 5000 | significant to Python. Usually those have a name starting with |
| 5001 | "PYTHON". This was used to fix a problem where the tests fail if |
| 5002 | the user happens to have PYTHONHOME or PYTHONPATH pointing to an |
| 5003 | older distribution. |
| 5004 | |
| 5005 | Library |
| 5006 | ------- |
| 5007 | |
| 5008 | - New class Differ and new functions ndiff() and restore() in difflib.py. |
| 5009 | These package the algorithms used by the popular Tools/scripts/ndiff.py, |
| 5010 | for programmatic reuse. |
| 5011 | |
| 5012 | - New function xml.sax.saxutils.quoteattr(): Quote an XML attribute |
| 5013 | value using the minimal quoting required for the value; more |
| 5014 | reliable than using xml.sax.saxutils.escape() for attribute values. |
| 5015 | |
| 5016 | - Readline completion support for cmd.Cmd was added. |
| 5017 | |
| 5018 | - Calling os.tempnam() or os.tmpnam() generate RuntimeWarnings. |
| 5019 | |
| 5020 | - Added function threading.BoundedSemaphore() |
| 5021 | |
| 5022 | - Added Ka-Ping Yee's cgitb.py module. |
| 5023 | |
| 5024 | - The 'new' module now exposes the CO_xxx flags. |
| 5025 | |
| 5026 | - The gc module offers the get_referents function. |
| 5027 | |
| 5028 | New platforms |
| 5029 | ------------- |
| 5030 | |
| 5031 | C API |
| 5032 | ----- |
| 5033 | |
| 5034 | - Two new APIs PyOS_snprintf() and PyOS_vsnprintf() were added |
| 5035 | which provide a cross-platform implementations for the |
| 5036 | relatively new snprintf()/vsnprintf() C lib APIs. In contrast to |
| 5037 | the standard sprintf() and vsprintf() C lib APIs, these versions |
| 5038 | apply bounds checking on the used buffer which enhances protection |
| 5039 | against buffer overruns. |
| 5040 | |
| 5041 | - Unicode APIs now use name mangling to assure that mixing interpreters |
| 5042 | and extensions using different Unicode widths is rendered next to |
| 5043 | impossible. Trying to import an incompatible Unicode-aware extension |
| 5044 | will result in an ImportError. Unicode extensions writers must make |
| 5045 | sure to check the Unicode width compatibility in their extensions by |
| 5046 | using at least one of the mangled Unicode APIs in the extension. |
| 5047 | |
| 5048 | - Two new flags METH_NOARGS and METH_O are available in method definition |
| 5049 | tables to simplify implementation of methods with no arguments and a |
| 5050 | single untyped argument. Calling such methods is more efficient than |
| 5051 | calling corresponding METH_VARARGS methods. METH_OLDARGS is now |
| 5052 | deprecated. |
| 5053 | |
| 5054 | Windows |
| 5055 | ------- |
| 5056 | |
| 5057 | - "import module" now compiles module.pyw if it exists and nothing else |
| 5058 | relevant is found. |
| 5059 | |
| 5060 | |
| 5061 | What's New in Python 2.2a1? |
| 5062 | =========================== |
| 5063 | |
| 5064 | *Release date: 18-Jul-2001* |
| 5065 | |
| 5066 | Core |
| 5067 | ---- |
| 5068 | |
| 5069 | - TENTATIVELY, a large amount of code implementing much of what's |
| 5070 | described in PEP 252 (Making Types Look More Like Classes) and PEP |
| 5071 | 253 (Subtyping Built-in Types) was added. This will be released |
| 5072 | with Python 2.2a1. Documentation will be provided separately |
| 5073 | through http://www.python.org/2.2/. The purpose of releasing this |
| 5074 | with Python 2.2a1 is to test backwards compatibility. It is |
| 5075 | possible, though not likely, that a decision is made not to release |
| 5076 | this code as part of 2.2 final, if any serious backwards |
| 5077 | incompatibilities are found during alpha testing that cannot be |
| 5078 | repaired. |
| 5079 | |
| 5080 | - Generators were added; this is a new way to create an iterator (see |
| 5081 | below) using what looks like a simple function containing one or |
| 5082 | more 'yield' statements. See PEP 255. Since this adds a new |
| 5083 | keyword to the language, this feature must be enabled by including a |
| 5084 | future statement: "from __future__ import generators" (see PEP 236). |
| 5085 | Generators will become a standard feature in a future release |
| 5086 | (probably 2.3). Without this future statement, 'yield' remains an |
| 5087 | ordinary identifier, but a warning is issued each time it is used. |
| 5088 | (These warnings currently don't conform to the warnings framework of |
| 5089 | PEP 230; we intend to fix this in 2.2a2.) |
| 5090 | |
| 5091 | - The UTF-16 codec was modified to be more RFC compliant. It will now |
| 5092 | only remove BOM characters at the start of the string and then |
| 5093 | only if running in native mode (UTF-16-LE and -BE won't remove a |
| 5094 | leading BMO character). |
| 5095 | |
| 5096 | - Strings now have a new method .decode() to complement the already |
| 5097 | existing .encode() method. These two methods provide direct access |
| 5098 | to the corresponding decoders and encoders of the registered codecs. |
| 5099 | |
| 5100 | To enhance the usability of the .encode() method, the special |
| 5101 | casing of Unicode object return values was dropped (Unicode objects |
| 5102 | were auto-magically converted to string using the default encoding). |
| 5103 | |
| 5104 | Both methods will now return whatever the codec in charge of the |
| 5105 | requested encoding returns as object, e.g. Unicode codecs will |
| 5106 | return Unicode objects when decoding is requested ("äöü".decode("latin-1") |
| 5107 | will return u"äöü"). This enables codec writer to create codecs |
| 5108 | for various simple to use conversions. |
| 5109 | |
| 5110 | New codecs were added to demonstrate these new features (the .encode() |
| 5111 | and .decode() columns indicate the type of the returned objects): |
| 5112 | |
| 5113 | +---------+-----------+-----------+-----------------------------+ |
| 5114 | |Name | .encode() | .decode() | Description | |
| 5115 | +=========+===========+===========+=============================+ |
| 5116 | |uu | string | string | UU codec (e.g. for email) | |
| 5117 | +---------+-----------+-----------+-----------------------------+ |
| 5118 | |base64 | string | string | base64 codec | |
| 5119 | +---------+-----------+-----------+-----------------------------+ |
| 5120 | |quopri | string | string | quoted-printable codec | |
| 5121 | +---------+-----------+-----------+-----------------------------+ |
| 5122 | |zlib | string | string | zlib compression | |
| 5123 | +---------+-----------+-----------+-----------------------------+ |
| 5124 | |hex | string | string | 2-byte hex codec | |
| 5125 | +---------+-----------+-----------+-----------------------------+ |
| 5126 | |rot-13 | string | Unicode | ROT-13 Unicode charmap codec| |
| 5127 | +---------+-----------+-----------+-----------------------------+ |
| 5128 | |
| 5129 | - Some operating systems now support the concept of a default Unicode |
| 5130 | encoding for file system operations. Notably, Windows supports 'mbcs' |
| 5131 | as the default. The Macintosh will also adopt this concept in the medium |
| 5132 | term, although the default encoding for that platform will be other than |
| 5133 | 'mbcs'. |
| 5134 | |
| 5135 | On operating system that support non-ASCII filenames, it is common for |
| 5136 | functions that return filenames (such as os.listdir()) to return Python |
| 5137 | string objects pre-encoded using the default file system encoding for |
| 5138 | the platform. As this encoding is likely to be different from Python's |
| 5139 | default encoding, converting this name to a Unicode object before passing |
| 5140 | it back to the Operating System would result in a Unicode error, as Python |
| 5141 | would attempt to use its default encoding (generally ASCII) rather than |
| 5142 | the default encoding for the file system. |
| 5143 | |
| 5144 | In general, this change simply removes surprises when working with |
| 5145 | Unicode and the file system, making these operations work as you expect, |
| 5146 | increasing the transparency of Unicode objects in this context. |
| 5147 | See [????] for more details, including examples. |
| 5148 | |
| 5149 | - Float (and complex) literals in source code were evaluated to full |
| 5150 | precision only when running from a .py file; the same code loaded from a |
| 5151 | .pyc (or .pyo) file could suffer numeric differences starting at about the |
| 5152 | 12th significant decimal digit. For example, on a machine with IEEE-754 |
| 5153 | floating arithmetic, |
| 5154 | |
| 5155 | x = 9007199254740992.0 |
| 5156 | print long(x) |
| 5157 | |
| 5158 | printed 9007199254740992 if run directly from .py, but 9007199254740000 |
| 5159 | if from a compiled (.pyc or .pyo) file. This was due to marshal using |
| 5160 | str(float) instead of repr(float) when building code objects. marshal |
| 5161 | now uses repr(float) instead, which should reproduce floats to full |
| 5162 | machine precision (assuming the platform C float<->string I/O conversion |
| 5163 | functions are of good quality). |
| 5164 | |
| 5165 | This may cause floating-point results to change in some cases, and |
| 5166 | usually for the better, but may also cause numerically unstable |
| 5167 | algorithms to break. |
| 5168 | |
| 5169 | - The implementation of dicts suffers fewer collisions, which has speed |
| 5170 | benefits. However, the order in which dict entries appear in dict.keys(), |
| 5171 | dict.values() and dict.items() may differ from previous releases for a |
| 5172 | given dict. Nothing is defined about this order, so no program should |
| 5173 | rely on it. Nevertheless, it's easy to write test cases that rely on the |
| 5174 | order by accident, typically because of printing the str() or repr() of a |
| 5175 | dict to an "expected results" file. See Lib/test/test_support.py's new |
| 5176 | sortdict(dict) function for a simple way to display a dict in sorted |
| 5177 | order. |
| 5178 | |
| 5179 | - Many other small changes to dicts were made, resulting in faster |
| 5180 | operation along the most common code paths. |
| 5181 | |
| 5182 | - Dictionary objects now support the "in" operator: "x in dict" means |
| 5183 | the same as dict.has_key(x). |
| 5184 | |
| 5185 | - The update() method of dictionaries now accepts generic mapping |
| 5186 | objects. Specifically the argument object must support the .keys() |
| 5187 | and __getitem__() methods. This allows you to say, for example, |
| 5188 | {}.update(UserDict()) |
| 5189 | |
| 5190 | - Iterators were added; this is a generalized way of providing values |
| 5191 | to a for loop. See PEP 234. There's a new built-in function iter() |
| 5192 | to return an iterator. There's a new protocol to get the next value |
| 5193 | from an iterator using the next() method (in Python) or the |
| 5194 | tp_iternext slot (in C). There's a new protocol to get iterators |
| 5195 | using the __iter__() method (in Python) or the tp_iter slot (in C). |
| 5196 | Iterating (i.e. a for loop) over a dictionary generates its keys. |
| 5197 | Iterating over a file generates its lines. |
| 5198 | |
| 5199 | - The following functions were generalized to work nicely with iterator |
| 5200 | arguments:: |
| 5201 | |
| 5202 | map(), filter(), reduce(), zip() |
| 5203 | list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API) |
| 5204 | max(), min() |
| 5205 | join() method of strings |
| 5206 | extend() method of lists |
| 5207 | 'x in y' and 'x not in y' (PySequence_Contains() in C API) |
| 5208 | operator.countOf() (PySequence_Count() in C API) |
| 5209 | right-hand side of assignment statements with multiple targets, such as :: |
| 5210 | x, y, z = some_iterable_object_returning_exactly_3_values |
| 5211 | |
| 5212 | - Accessing module attributes is significantly faster (for example, |
| 5213 | random.random or os.path or yourPythonModule.yourAttribute). |
| 5214 | |
| 5215 | - Comparing dictionary objects via == and != is faster, and now works even |
| 5216 | if the keys and values don't support comparisons other than ==. |
| 5217 | |
| 5218 | - Comparing dictionaries in ways other than == and != is slower: there were |
| 5219 | insecurities in the dict comparison implementation that could cause Python |
| 5220 | to crash if the element comparison routines for the dict keys and/or |
| 5221 | values mutated the dicts. Making the code bulletproof slowed it down. |
| 5222 | |
| 5223 | - Collisions in dicts are resolved via a new approach, which can help |
| 5224 | dramatically in bad cases. For example, looking up every key in a dict |
| 5225 | d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x |
| 5226 | faster now. Thanks to Christian Tismer for pointing out the cause and |
| 5227 | the nature of an effective cure (last December! better late than never). |
| 5228 | |
| 5229 | - repr() is much faster for large containers (dict, list, tuple). |
| 5230 | |
| 5231 | |
| 5232 | Library |
| 5233 | ------- |
| 5234 | |
| 5235 | - The constants ascii_letters, ascii_lowercase. and ascii_uppercase |
| 5236 | were added to the string module. These a locale-independent |
| 5237 | constants, unlike letters, lowercase, and uppercase. These are now |
| 5238 | use in appropriate locations in the standard library. |
| 5239 | |
| 5240 | - The flags used in dlopen calls can now be configured using |
| 5241 | sys.setdlopenflags and queried using sys.getdlopenflags. |
| 5242 | |
| 5243 | - Fredrik Lundh's xmlrpclib is now a standard library module. This |
| 5244 | provides full client-side XML-RPC support. In addition, |
| 5245 | Demo/xmlrpc/ contains two server frameworks (one SocketServer-based, |
| 5246 | one asyncore-based). Thanks to Eric Raymond for the documentation. |
| 5247 | |
| 5248 | - The xrange() object is simplified: it no longer supports slicing, |
| 5249 | repetition, comparisons, efficient 'in' checking, the tolist() |
| 5250 | method, or the start, stop and step attributes. See PEP 260. |
| 5251 | |
| 5252 | - A new function fnmatch.filter to filter lists of file names was added. |
| 5253 | |
| 5254 | - calendar.py uses month and day names based on the current locale. |
| 5255 | |
| 5256 | - strop is now *really* obsolete (this was announced before with 1.6), |
| 5257 | and issues DeprecationWarning when used (except for the four items |
| 5258 | that are still imported into string.py). |
| 5259 | |
| 5260 | - Cookie.py now sorts key+value pairs by key in output strings. |
| 5261 | |
| 5262 | - pprint.isrecursive(object) didn't correctly identify recursive objects. |
| 5263 | Now it does. |
| 5264 | |
| 5265 | - pprint functions now much faster for large containers (tuple, list, dict). |
| 5266 | |
| 5267 | - New 'q' and 'Q' format codes in the struct module, corresponding to C |
| 5268 | types "long long" and "unsigned long long" (on Windows, __int64). In |
| 5269 | native mode, these can be used only when the platform C compiler supports |
| 5270 | these types (when HAVE_LONG_LONG is #define'd by the Python config |
| 5271 | process), and then they inherit the sizes and alignments of the C types. |
| 5272 | In standard mode, 'q' and 'Q' are supported on all platforms, and are |
| 5273 | 8-byte integral types. |
| 5274 | |
| 5275 | - The site module installs a new built-in function 'help' that invokes |
| 5276 | pydoc.help. It must be invoked as 'help()'; when invoked as 'help', |
| 5277 | it displays a message reminding the user to use 'help()' or |
| 5278 | 'help(object)'. |
| 5279 | |
| 5280 | Tests |
| 5281 | ----- |
| 5282 | |
| 5283 | - New test_mutants.py runs dict comparisons where the key and value |
| 5284 | comparison operators mutate the dicts randomly during comparison. This |
| 5285 | rapidly causes Python to crash under earlier releases (not for the faint |
| 5286 | of heart: it can also cause Win9x to freeze or reboot!). |
| 5287 | |
| 5288 | - New test_pprint.py verifies that pprint.isrecursive() and |
| 5289 | pprint.isreadable() return sensible results. Also verifies that simple |
| 5290 | cases produce correct output. |
| 5291 | |
| 5292 | C API |
| 5293 | ----- |
| 5294 | |
| 5295 | - Removed the unused last_is_sticky argument from the internal |
| 5296 | _PyTuple_Resize(). If this affects you, you were cheating. |
| 5297 | |
Skip Montanaro | 4cb2204 | 2002-09-17 20:55:31 +0000 | [diff] [blame] | 5298 | What's New in Python 2.1 (final)? |
| 5299 | ================================= |
| 5300 | |
| 5301 | We only changed a few things since the last release candidate, all in |
| 5302 | Python library code: |
| 5303 | |
| 5304 | - A bug in the locale module was fixed that affected locales which |
| 5305 | define no grouping for numeric formatting. |
| 5306 | |
| 5307 | - A few bugs in the weakref module's implementations of weak |
| 5308 | dictionaries (WeakValueDictionary and WeakKeyDictionary) were fixed, |
| 5309 | and the test suite was updated to check for these bugs. |
| 5310 | |
| 5311 | - An old bug in the os.path.walk() function (introduced in Python |
| 5312 | 2.0!) was fixed: a non-existent file would cause an exception |
| 5313 | instead of being ignored. |
| 5314 | |
| 5315 | - Fixed a few bugs in the new symtable module found by Neil Norwitz's |
| 5316 | PyChecker. |
| 5317 | |
| 5318 | |
| 5319 | What's New in Python 2.1c2? |
| 5320 | =========================== |
| 5321 | |
| 5322 | A flurry of small changes, and one showstopper fixed in the nick of |
| 5323 | time made it necessary to release another release candidate. The list |
| 5324 | here is the *complete* list of patches (except version updates): |
| 5325 | |
| 5326 | Core |
| 5327 | |
| 5328 | - Tim discovered a nasty bug in the dictionary code, caused by |
| 5329 | PyDict_Next() calling dict_resize(), and the GC code's use of |
| 5330 | PyDict_Next() violating an assumption in dict_items(). This was |
| 5331 | fixed with considerable amounts of band-aid, but the net effect is a |
| 5332 | saner and more robust implementation. |
| 5333 | |
| 5334 | - Made a bunch of symbols static that were accidentally global. |
| 5335 | |
| 5336 | Build and Ports |
| 5337 | |
| 5338 | - The setup.py script didn't check for a new enough version of zlib |
| 5339 | (1.1.3 is needed). Now it does. |
| 5340 | |
| 5341 | - Changed "make clean" target to also remove shared libraries. |
| 5342 | |
| 5343 | - Added a more general warning about the SGI Irix optimizer to README. |
| 5344 | |
| 5345 | Library |
| 5346 | |
| 5347 | - Fix a bug in urllib.basejoin("http://host", "../file.html") which |
| 5348 | omitted the slash between host and file.html. |
| 5349 | |
| 5350 | - The mailbox module's _Mailbox class contained a completely broken |
| 5351 | and undocumented seek() method. Ripped it out. |
| 5352 | |
| 5353 | - Fixed a bunch of typos in various library modules (urllib2, smtpd, |
| 5354 | sgmllib, netrc, chunk) found by Neil Norwitz's PyChecker. |
| 5355 | |
| 5356 | - Fixed a few last-minute bugs in unittest. |
| 5357 | |
| 5358 | Extensions |
| 5359 | |
| 5360 | - Reverted the patch to the OpenSSL code in socketmodule.c to support |
| 5361 | RAND_status() and the EGD, and the subsequent patch that tried to |
| 5362 | fix it for pre-0.9.5 versions; the problem with the patch is that on |
| 5363 | some systems it issues a warning whenever socket is imported, and |
| 5364 | that's unacceptable. |
| 5365 | |
| 5366 | Tests |
| 5367 | |
| 5368 | - Fixed the pickle tests to work with "import test.test_pickle". |
| 5369 | |
| 5370 | - Tweaked test_locale.py to actually run the test Windows. |
| 5371 | |
| 5372 | - In distutils/archive_util.py, call zipfile.ZipFile() with mode "w", |
| 5373 | not "wb" (which is not a valid mode at all). |
| 5374 | |
| 5375 | - Fix pstats browser crashes. Import readline if it exists to make |
| 5376 | the user interface nicer. |
| 5377 | |
| 5378 | - Add "import thread" to the top of test modules that import the |
| 5379 | threading module (test_asynchat and test_threadedtempfile). This |
| 5380 | prevents test failures caused by a broken threading module resulting |
| 5381 | from a previously caught failed import. |
| 5382 | |
| 5383 | - Changed test_asynchat.py to set the SO_REUSEADDR option; this was |
| 5384 | needed on some platforms (e.g. Solaris 8) when the tests are run |
| 5385 | twice in succession. |
| 5386 | |
| 5387 | - Skip rather than fail test_sunaudiodev if no audio device is found. |
| 5388 | |
| 5389 | |
| 5390 | What's New in Python 2.1c1? |
| 5391 | =========================== |
| 5392 | |
| 5393 | This list was significantly updated when 2.1c2 was released; the 2.1c1 |
| 5394 | release didn't mention most changes that were actually part of 2.1c1: |
| 5395 | |
| 5396 | Legal |
| 5397 | |
| 5398 | - Copyright was assigned to the Python Software Foundation (PSF) and a |
| 5399 | PSF license (very similar to the CNRI license) was added. |
| 5400 | |
| 5401 | - The CNRI copyright notice was updated to include 2001. |
| 5402 | |
| 5403 | Core |
| 5404 | |
| 5405 | - After a public outcry, assignment to __debug__ is no longer illegal; |
| 5406 | instead, a warning is issued. It will become illegal in 2.2. |
| 5407 | |
| 5408 | - Fixed a core dump with "%#x" % 0, and changed the semantics so that |
| 5409 | "%#x" now always prepends "0x", even if the value is zero. |
| 5410 | |
| 5411 | - Fixed some nits in the bytecode compiler. |
| 5412 | |
| 5413 | - Fixed core dumps when calling certain kinds of non-functions. |
| 5414 | |
| 5415 | - Fixed various core dumps caused by reference count bugs. |
| 5416 | |
| 5417 | Build and Ports |
| 5418 | |
| 5419 | - Use INSTALL_SCRIPT to install script files. |
| 5420 | |
| 5421 | - New port: SCO Unixware 7, by Billy G. Allie. |
| 5422 | |
| 5423 | - Updated RISCOS port. |
| 5424 | |
| 5425 | - Updated BeOS port and notes. |
| 5426 | |
| 5427 | - Various other porting problems resolved. |
| 5428 | |
| 5429 | Library |
| 5430 | |
| 5431 | - The TERMIOS and SOCKET modules are now truly obsolete and |
| 5432 | unnecessary. Their symbols are incorporated in the termios and |
| 5433 | socket modules. |
| 5434 | |
| 5435 | - Fixed some 64-bit bugs in pickle, cPickle, and struct, and added |
| 5436 | better tests for pickling. |
| 5437 | |
| 5438 | - threading: make Condition.wait() robust against KeyboardInterrupt. |
| 5439 | |
| 5440 | - zipfile: add support to zipfile to support opening an archive |
| 5441 | represented by an open file rather than a file name. Fix bug where |
| 5442 | the archive was not properly closed. Fixed a bug in this bugfix |
| 5443 | where flush() was called for a read-only file. |
| 5444 | |
| 5445 | - imputil: added an uninstall() method to the ImportManager. |
| 5446 | |
| 5447 | - Canvas: fixed bugs in lower() and tkraise() methods. |
| 5448 | |
| 5449 | - SocketServer: API change (added overridable close_request() method) |
| 5450 | so that the TCP server can explicitly close the request. |
| 5451 | |
| 5452 | - pstats: Eric Raymond added a simple interactive statistics browser, |
| 5453 | invoked when the module is run as a script. |
| 5454 | |
| 5455 | - locale: fixed a problem in format(). |
| 5456 | |
| 5457 | - webbrowser: made it work when the BROWSER environment variable has a |
| 5458 | value like "/usr/bin/netscape". Made it auto-detect Konqueror for |
| 5459 | KDE 2. Fixed some other nits. |
| 5460 | |
| 5461 | - unittest: changes to allow using a different exception than |
| 5462 | AssertionError, and added a few more function aliases. Some other |
| 5463 | small changes. |
| 5464 | |
| 5465 | - urllib, urllib2: fixed redirect problems and a coupleof other nits. |
| 5466 | |
| 5467 | - asynchat: fixed a critical bug in asynchat that slipped through the |
| 5468 | 2.1b2 release. Fixed another rare bug. |
| 5469 | |
| 5470 | - Fix some unqualified except: clauses (always a bad code example). |
| 5471 | |
| 5472 | XML |
| 5473 | |
| 5474 | - pyexpat: new API get_version_string(). |
| 5475 | |
| 5476 | - Fixed some minidom bugs. |
| 5477 | |
| 5478 | Extensions |
| 5479 | |
| 5480 | - Fixed a core dump in _weakref. Removed the weakref.mapping() |
| 5481 | function (it adds nothing to the API). |
| 5482 | |
| 5483 | - Rationalized the use of header files in the readline module, to make |
| 5484 | it compile (albeit with some warnings) with the very recent readline |
| 5485 | 4.2, without breaking for earlier versions. |
| 5486 | |
| 5487 | - Hopefully fixed a buffering problem in linuxaudiodev. |
| 5488 | |
| 5489 | - Attempted a fix to make the OpenSSL support in the socket module |
| 5490 | work again with pre-0.9.5 versions of OpenSSL. |
| 5491 | |
| 5492 | Tests |
| 5493 | |
| 5494 | - Added a test case for asynchat and asyncore. |
| 5495 | |
| 5496 | - Removed coupling between tests where one test failing could break |
| 5497 | another. |
| 5498 | |
| 5499 | Tools |
| 5500 | |
| 5501 | - Ping added an interactive help browser to pydoc, fixed some nits |
| 5502 | in the rest of the pydoc code, and added some features to his |
| 5503 | inspect module. |
| 5504 | |
| 5505 | - An updated python-mode.el version 4.1 which integrates Ken |
| 5506 | Manheimer's pdbtrack.el. This makes debugging Python code via pdb |
| 5507 | much nicer in XEmacs and Emacs. When stepping through your program |
| 5508 | with pdb, in either the shell window or the *Python* window, the |
| 5509 | source file and line will be tracked by an arrow. Very cool! |
| 5510 | |
| 5511 | - IDLE: syntax warnings in interactive mode are changed into errors. |
| 5512 | |
| 5513 | - Some improvements to Tools/webchecker (ignore some more URL types, |
| 5514 | follow some more links). |
| 5515 | |
| 5516 | - Brought the Tools/compiler package up to date. |
| 5517 | |
| 5518 | |
| 5519 | What's New in Python 2.1 beta 2? |
| 5520 | ================================ |
| 5521 | |
| 5522 | (Unlisted are many fixed bugs, more documentation, etc.) |
| 5523 | |
| 5524 | Core language, builtins, and interpreter |
| 5525 | |
| 5526 | - The nested scopes work (enabled by "from __future__ import |
| 5527 | nested_scopes") is completed; in particular, the future now extends |
| 5528 | into code executed through exec, eval() and execfile(), and into the |
| 5529 | interactive interpreter. |
| 5530 | |
| 5531 | - When calling a base class method (e.g. BaseClass.__init__(self)), |
| 5532 | this is now allowed even if self is not strictly spoken a class |
| 5533 | instance (e.g. when using metaclasses or the Don Beaudry hook). |
| 5534 | |
| 5535 | - Slice objects are now comparable but not hashable; this prevents |
| 5536 | dict[:] from being accepted but meaningless. |
| 5537 | |
| 5538 | - Complex division is now calculated using less braindead algorithms. |
| 5539 | This doesn't change semantics except it's more likely to give useful |
| 5540 | results in extreme cases. Complex repr() now uses full precision |
| 5541 | like float repr(). |
| 5542 | |
| 5543 | - sgmllib.py now calls handle_decl() for simple <!...> declarations. |
| 5544 | |
| 5545 | - It is illegal to assign to the name __debug__, which is set when the |
| 5546 | interpreter starts. It is effectively a compile-time constant. |
| 5547 | |
| 5548 | - A warning will be issued if a global statement for a variable |
| 5549 | follows a use or assignment of that variable. |
| 5550 | |
| 5551 | Standard library |
| 5552 | |
| 5553 | - unittest.py, a unit testing framework by Steve Purcell (PyUNIT, |
| 5554 | inspired by JUnit), is now part of the standard library. You now |
| 5555 | have a choice of two testing frameworks: unittest requires you to |
| 5556 | write testcases as separate code, doctest gathers them from |
| 5557 | docstrings. Both approaches have their advantages and |
| 5558 | disadvantages. |
| 5559 | |
| 5560 | - A new module Tix was added, which wraps the Tix extension library |
| 5561 | for Tk. With that module, it is not necessary to statically link |
| 5562 | Tix with _tkinter, since Tix will be loaded with Tcl's "package |
| 5563 | require" command. See Demo/tix/. |
| 5564 | |
| 5565 | - tzparse.py is now obsolete. |
| 5566 | |
| 5567 | - In gzip.py, the seek() and tell() methods are removed -- they were |
| 5568 | non-functional anyway, and it's better if callers can test for their |
| 5569 | existence with hasattr(). |
| 5570 | |
| 5571 | Python/C API |
| 5572 | |
| 5573 | - PyDict_Next(): it is now safe to call PyDict_SetItem() with a key |
| 5574 | that's already in the dictionary during a PyDict_Next() iteration. |
| 5575 | This used to fail occasionally when a dictionary resize operation |
| 5576 | could be triggered that would rehash all the keys. All other |
| 5577 | modifications to the dictionary are still off-limits during a |
| 5578 | PyDict_Next() iteration! |
| 5579 | |
| 5580 | - New extended APIs related to passing compiler variables around. |
| 5581 | |
| 5582 | - New abstract APIs PyObject_IsInstance(), PyObject_IsSubclass() |
| 5583 | implement isinstance() and issubclass(). |
| 5584 | |
| 5585 | - Py_BuildValue() now has a "D" conversion to create a Python complex |
| 5586 | number from a Py_complex C value. |
| 5587 | |
| 5588 | - Extensions types which support weak references must now set the |
| 5589 | field allocated for the weak reference machinery to NULL themselves; |
| 5590 | this is done to avoid the cost of checking each object for having a |
| 5591 | weakly referencable type in PyObject_INIT(), since most types are |
| 5592 | not weakly referencable. |
| 5593 | |
| 5594 | - PyFrame_FastToLocals() and PyFrame_LocalsToFast() copy bindings for |
| 5595 | free variables and cell variables to and from the frame's f_locals. |
| 5596 | |
| 5597 | - Variants of several functions defined in pythonrun.h have been added |
| 5598 | to support the nested_scopes future statement. The variants all end |
| 5599 | in Flags and take an extra argument, a PyCompilerFlags *; examples: |
| 5600 | PyRun_AnyFileExFlags(), PyRun_InteractiveLoopFlags(). These |
| 5601 | variants may be removed in Python 2.2, when nested scopes are |
| 5602 | mandatory. |
| 5603 | |
| 5604 | Distutils |
| 5605 | |
| 5606 | - the sdist command now writes a PKG-INFO file, as described in PEP 241, |
| 5607 | into the release tree. |
| 5608 | |
| 5609 | - several enhancements to the bdist_wininst command from Thomas Heller |
| 5610 | (an uninstaller, more customization of the installer's display) |
| 5611 | |
| 5612 | - from Jack Jansen: added Mac-specific code to generate a dialog for |
| 5613 | users to specify the command-line (because providing a command-line with |
| 5614 | MacPython is awkward). Jack also made various fixes for the Mac |
| 5615 | and the Metrowerks compiler. |
| 5616 | |
| 5617 | - added 'platforms' and 'keywords' to the set of metadata that can be |
| 5618 | specified for a distribution. |
| 5619 | |
| 5620 | - applied patches from Jason Tishler to make the compiler class work with |
| 5621 | Cygwin. |
| 5622 | |
| 5623 | |
| 5624 | What's New in Python 2.1 beta 1? |
| 5625 | ================================ |
| 5626 | |
| 5627 | Core language, builtins, and interpreter |
| 5628 | |
| 5629 | - Following an outcry from the community about the amount of code |
| 5630 | broken by the nested scopes feature introduced in 2.1a2, we decided |
| 5631 | to make this feature optional, and to wait until Python 2.2 (or at |
| 5632 | least 6 months) to make it standard. The option can be enabled on a |
| 5633 | per-module basis by adding "from __future__ import nested_scopes" at |
| 5634 | the beginning of a module (before any other statements, but after |
| 5635 | comments and an optional docstring). See PEP 236 (Back to the |
| 5636 | __future__) for a description of the __future__ statement. PEP 227 |
| 5637 | (Statically Nested Scopes) has been updated to reflect this change, |
| 5638 | and to clarify the semantics in a number of endcases. |
| 5639 | |
| 5640 | - The nested scopes code, when enabled, has been hardened, and most |
| 5641 | bugs and memory leaks in it have been fixed. |
| 5642 | |
| 5643 | - Compile-time warnings are now generated for a number of conditions |
| 5644 | that will break or change in meaning when nested scopes are enabled: |
| 5645 | |
| 5646 | - Using "from...import *" or "exec" without in-clause in a function |
| 5647 | scope that also defines a lambda or nested function with one or |
| 5648 | more free (non-local) variables. The presence of the import* or |
| 5649 | bare exec makes it impossible for the compiler to determine the |
| 5650 | exact set of local variables in the outer scope, which makes it |
| 5651 | impossible to determine the bindings for free variables in the |
| 5652 | inner scope. To avoid the warning about import *, change it into |
| 5653 | an import of explicitly name object, or move the import* statement |
| 5654 | to the global scope; to avoid the warning about bare exec, use |
| 5655 | exec...in... (a good idea anyway -- there's a possibility that |
| 5656 | bare exec will be deprecated in the future). |
| 5657 | |
| 5658 | - Use of a global variable in a nested scope with the same name as a |
| 5659 | local variable in a surrounding scope. This will change in |
| 5660 | meaning with nested scopes: the name in the inner scope will |
| 5661 | reference the variable in the outer scope rather than the global |
| 5662 | of the same name. To avoid the warning, either rename the outer |
| 5663 | variable, or use a global statement in the inner function. |
| 5664 | |
| 5665 | - An optional object allocator has been included. This allocator is |
| 5666 | optimized for Python objects and should be faster and use less memory |
| 5667 | than the standard system allocator. It is not enabled by default |
| 5668 | because of possible thread safety problems. The allocator is only |
| 5669 | protected by the Python interpreter lock and it is possible that some |
| 5670 | extension modules require a thread safe allocator. The object |
| 5671 | allocator can be enabled by providing the "--with-pymalloc" option to |
| 5672 | configure. |
| 5673 | |
| 5674 | Standard library |
| 5675 | |
| 5676 | - pyexpat now detects the expat version if expat.h defines it. A |
| 5677 | number of additional handlers are provided, which are only available |
| 5678 | since expat 1.95. In addition, the methods SetParamEntityParsing and |
| 5679 | GetInputContext of Parser objects are available with 1.95.x |
| 5680 | only. Parser objects now provide the ordered_attributes and |
| 5681 | specified_attributes attributes. A new module expat.model was added, |
| 5682 | which offers a number of additional constants if 1.95.x is used. |
| 5683 | |
| 5684 | - xml.dom offers the new functions registerDOMImplementation and |
| 5685 | getDOMImplementation. |
| 5686 | |
| 5687 | - xml.dom.minidom offers a toprettyxml method. A number of DOM |
| 5688 | conformance issues have been resolved. In particular, Element now |
| 5689 | has an hasAttributes method, and the handling of namespaces was |
| 5690 | improved. |
| 5691 | |
| 5692 | - Ka-Ping Yee contributed two new modules: inspect.py, a module for |
| 5693 | getting information about live Python code, and pydoc.py, a module |
| 5694 | for interactively converting docstrings to HTML or text. |
| 5695 | Tools/scripts/pydoc, which is now automatically installed into |
| 5696 | <prefix>/bin, uses pydoc.py to display documentation; try running |
| 5697 | "pydoc -h" for instructions. "pydoc -g" pops up a small GUI that |
| 5698 | lets you browse the module docstrings using a web browser. |
| 5699 | |
| 5700 | - New library module difflib.py, primarily packaging the SequenceMatcher |
| 5701 | class at the heart of the popular ndiff.py file-comparison tool. |
| 5702 | |
| 5703 | - doctest.py (a framework for verifying Python code examples in docstrings) |
| 5704 | is now part of the std library. |
| 5705 | |
| 5706 | Windows changes |
| 5707 | |
| 5708 | - A new entry in the Start menu, "Module Docs", runs "pydoc -g" -- a |
| 5709 | small GUI that lets you browse the module docstrings using your |
| 5710 | default web browser. |
| 5711 | |
| 5712 | - Import is now case-sensitive. PEP 235 (Import on Case-Insensitive |
| 5713 | Platforms) is implemented. See |
| 5714 | |
| 5715 | http://python.sourceforge.net/peps/pep-0235.html |
| 5716 | |
| 5717 | for full details, especially the "Current Lower-Left Semantics" section. |
| 5718 | The new Windows import rules are simpler than before: |
| 5719 | |
| 5720 | A. If the PYTHONCASEOK environment variable exists, same as |
| 5721 | before: silently accept the first case-insensitive match of any |
| 5722 | kind; raise ImportError if none found. |
| 5723 | |
| 5724 | B. Else search sys.path for the first case-sensitive match; raise |
| 5725 | ImportError if none found. |
| 5726 | |
| 5727 | The same rules have been implemented on other platforms with case- |
| 5728 | insensitive but case-preserving filesystems too (including Cygwin, and |
| 5729 | several flavors of Macintosh operating systems). |
| 5730 | |
| 5731 | - winsound module: Under Win9x, winsound.Beep() now attempts to simulate |
| 5732 | what it's supposed to do (and does do under NT and 2000) via direct |
| 5733 | port manipulation. It's unknown whether this will work on all systems, |
| 5734 | but it does work on my Win98SE systems now and was known to be useless on |
| 5735 | all Win9x systems before. |
| 5736 | |
| 5737 | - Build: Subproject _test (effectively) renamed to _testcapi. |
| 5738 | |
| 5739 | New platforms |
| 5740 | |
| 5741 | - 2.1 should compile and run out of the box under MacOS X, even using HFS+. |
| 5742 | Thanks to Steven Majewski! |
| 5743 | |
| 5744 | - 2.1 should compile and run out of the box on Cygwin. Thanks to Jason |
| 5745 | Tishler! |
| 5746 | |
| 5747 | - 2.1 contains new files and patches for RISCOS, thanks to Dietmar |
| 5748 | Schwertberger! See RISCOS/README for more information -- it seems |
| 5749 | that because of the bizarre filename conventions on RISCOS, no port |
| 5750 | to that platform is easy. |
| 5751 | |
| 5752 | |
| 5753 | What's New in Python 2.1 alpha 2? |
| 5754 | ================================= |
| 5755 | |
| 5756 | Core language, builtins, and interpreter |
| 5757 | |
| 5758 | - Scopes nest. If a name is used in a function or class, but is not |
| 5759 | local, the definition in the nearest enclosing function scope will |
| 5760 | be used. One consequence of this change is that lambda statements |
| 5761 | could reference variables in the namespaces where the lambda is |
| 5762 | defined. In some unusual cases, this change will break code. |
| 5763 | |
| 5764 | In all previous version of Python, names were resolved in exactly |
| 5765 | three namespaces -- the local namespace, the global namespace, and |
| 5766 | the builtin namespace. According to this old definition, if a |
| 5767 | function A is defined within a function B, the names bound in B are |
| 5768 | not visible in A. The new rules make names bound in B visible in A, |
| 5769 | unless A contains a name binding that hides the binding in B. |
| 5770 | |
| 5771 | Section 4.1 of the reference manual describes the new scoping rules |
| 5772 | in detail. The test script in Lib/test/test_scope.py demonstrates |
| 5773 | some of the effects of the change. |
| 5774 | |
| 5775 | The new rules will cause existing code to break if it defines nested |
| 5776 | functions where an outer function has local variables with the same |
| 5777 | name as globals or builtins used by the inner function. Example: |
| 5778 | |
| 5779 | def munge(str): |
| 5780 | def helper(x): |
| 5781 | return str(x) |
| 5782 | if type(str) != type(''): |
| 5783 | str = helper(str) |
| 5784 | return str.strip() |
| 5785 | |
| 5786 | Under the old rules, the name str in helper() is bound to the |
| 5787 | builtin function str(). Under the new rules, it will be bound to |
| 5788 | the argument named str and an error will occur when helper() is |
| 5789 | called. |
| 5790 | |
| 5791 | - The compiler will report a SyntaxError if "from ... import *" occurs |
| 5792 | in a function or class scope. The language reference has documented |
| 5793 | that this case is illegal, but the compiler never checked for it. |
| 5794 | The recent introduction of nested scope makes the meaning of this |
| 5795 | form of name binding ambiguous. In a future release, the compiler |
| 5796 | may allow this form when there is no possibility of ambiguity. |
| 5797 | |
| 5798 | - repr(string) is easier to read, now using hex escapes instead of octal, |
| 5799 | and using \t, \n and \r instead of \011, \012 and \015 (respectively): |
| 5800 | |
| 5801 | >>> "\texample \r\n" + chr(0) + chr(255) |
| 5802 | '\texample \r\n\x00\xff' # in 2.1 |
| 5803 | '\011example \015\012\000\377' # in 2.0 |
| 5804 | |
| 5805 | - Functions are now compared and hashed by identity, not by value, since |
| 5806 | the func_code attribute is writable. |
| 5807 | |
| 5808 | - Weak references (PEP 205) have been added. This involves a few |
| 5809 | changes in the core, an extension module (_weakref), and a Python |
| 5810 | module (weakref). The weakref module is the public interface. It |
| 5811 | includes support for "explicit" weak references, proxy objects, and |
| 5812 | mappings with weakly held values. |
| 5813 | |
| 5814 | - A 'continue' statement can now appear in a try block within the body |
| 5815 | of a loop. It is still not possible to use continue in a finally |
| 5816 | clause. |
| 5817 | |
| 5818 | Standard library |
| 5819 | |
| 5820 | - mailbox.py now has a new class, PortableUnixMailbox which is |
| 5821 | identical to UnixMailbox but uses a more portable scheme for |
| 5822 | determining From_ separators. Also, the constructors for all the |
| 5823 | classes in this module have a new optional `factory' argument, which |
| 5824 | is a callable used when new message classes must be instantiated by |
| 5825 | the next() method. |
| 5826 | |
| 5827 | - random.py is now self-contained, and offers all the functionality of |
| 5828 | the now-deprecated whrandom.py. See the docs for details. random.py |
| 5829 | also supports new functions getstate() and setstate(), for saving |
| 5830 | and restoring the internal state of the generator; and jumpahead(n), |
| 5831 | for quickly forcing the internal state to be the same as if n calls to |
| 5832 | random() had been made. The latter is particularly useful for multi- |
| 5833 | threaded programs, creating one instance of the random.Random() class for |
| 5834 | each thread, then using .jumpahead() to force each instance to use a |
| 5835 | non-overlapping segment of the full period. |
| 5836 | |
| 5837 | - random.py's seed() function is new. For bit-for-bit compatibility with |
| 5838 | prior releases, use the whseed function instead. The new seed function |
| 5839 | addresses two problems: (1) The old function couldn't produce more than |
| 5840 | about 2**24 distinct internal states; the new one about 2**45 (the best |
| 5841 | that can be done in the Wichmann-Hill generator). (2) The old function |
| 5842 | sometimes produced identical internal states when passed distinct |
| 5843 | integers, and there was no simple way to predict when that would happen; |
| 5844 | the new one guarantees to produce distinct internal states for all |
| 5845 | arguments in [0, 27814431486576L). |
| 5846 | |
| 5847 | - The socket module now supports raw packets on Linux. The socket |
| 5848 | family is AF_PACKET. |
| 5849 | |
| 5850 | - test_capi.py is a start at running tests of the Python C API. The tests |
| 5851 | are implemented by the new Modules/_testmodule.c. |
| 5852 | |
| 5853 | - A new extension module, _symtable, provides provisional access to the |
| 5854 | internal symbol table used by the Python compiler. A higher-level |
| 5855 | interface will be added on top of _symtable in a future release. |
| 5856 | |
| 5857 | - Removed the obsolete soundex module. |
| 5858 | |
| 5859 | - xml.dom.minidom now uses the standard DOM exceptions. Node supports |
| 5860 | the isSameNode method; NamedNodeMap the get method. |
| 5861 | |
| 5862 | - xml.sax.expatreader supports the lexical handler property; it |
| 5863 | generates comment, startCDATA, and endCDATA events. |
| 5864 | |
| 5865 | Windows changes |
| 5866 | |
| 5867 | - Build procedure: the zlib project is built in a different way that |
| 5868 | ensures the zlib header files used can no longer get out of synch with |
| 5869 | the zlib binary used. See PCbuild\readme.txt for details. Your old |
| 5870 | zlib-related directories can be deleted; you'll need to download fresh |
| 5871 | source for zlib and unpack it into a new directory. |
| 5872 | |
| 5873 | - Build: New subproject _test for the benefit of test_capi.py (see above). |
| 5874 | |
| 5875 | - Build: New subproject _symtable, for new DLL _symtable.pyd (a nascent |
| 5876 | interface to some Python compiler internals). |
| 5877 | |
| 5878 | - Build: Subproject ucnhash is gone, since the code was folded into the |
| 5879 | unicodedata subproject. |
| 5880 | |
| 5881 | What's New in Python 2.1 alpha 1? |
| 5882 | ================================= |
| 5883 | |
| 5884 | Core language, builtins, and interpreter |
| 5885 | |
| 5886 | - There is a new Unicode companion to the PyObject_Str() API |
| 5887 | called PyObject_Unicode(). It behaves in the same way as the |
| 5888 | former, but assures that the returned value is an Unicode object |
| 5889 | (applying the usual coercion if necessary). |
| 5890 | |
| 5891 | - The comparison operators support "rich comparison overloading" (PEP |
| 5892 | 207). C extension types can provide a rich comparison function in |
| 5893 | the new tp_richcompare slot in the type object. The cmp() function |
| 5894 | and the C function PyObject_Compare() first try the new rich |
| 5895 | comparison operators before trying the old 3-way comparison. There |
| 5896 | is also a new C API PyObject_RichCompare() (which also falls back on |
| 5897 | the old 3-way comparison, but does not constrain the outcome of the |
| 5898 | rich comparison to a Boolean result). |
| 5899 | |
| 5900 | The rich comparison function takes two objects (at least one of |
| 5901 | which is guaranteed to have the type that provided the function) and |
| 5902 | an integer indicating the opcode, which can be Py_LT, Py_LE, Py_EQ, |
| 5903 | Py_NE, Py_GT, Py_GE (for <, <=, ==, !=, >, >=), and returns a Python |
| 5904 | object, which may be NotImplemented (in which case the tp_compare |
| 5905 | slot function is used as a fallback, if defined). |
| 5906 | |
| 5907 | Classes can overload individual comparison operators by defining one |
| 5908 | or more of the methods__lt__, __le__, __eq__, __ne__, __gt__, |
| 5909 | __ge__. There are no explicit "reflected argument" versions of |
| 5910 | these; instead, __lt__ and __gt__ are each other's reflection, |
| 5911 | likewise for__le__ and __ge__; __eq__ and __ne__ are their own |
| 5912 | reflection (similar at the C level). No other implications are |
| 5913 | made; in particular, Python does not assume that == is the Boolean |
| 5914 | inverse of !=, or that < is the Boolean inverse of >=. This makes |
| 5915 | it possible to define types with partial orderings. |
| 5916 | |
| 5917 | Classes or types that want to implement (in)equality tests but not |
| 5918 | the ordering operators (i.e. unordered types) should implement == |
| 5919 | and !=, and raise an error for the ordering operators. |
| 5920 | |
| 5921 | It is possible to define types whose rich comparison results are not |
| 5922 | Boolean; e.g. a matrix type might want to return a matrix of bits |
| 5923 | for A < B, giving elementwise comparisons. Such types should ensure |
| 5924 | that any interpretation of their value in a Boolean context raises |
| 5925 | an exception, e.g. by defining __nonzero__ (or the tp_nonzero slot |
| 5926 | at the C level) to always raise an exception. |
| 5927 | |
| 5928 | - Complex numbers use rich comparisons to define == and != but raise |
| 5929 | an exception for <, <=, > and >=. Unfortunately, this also means |
| 5930 | that cmp() of two complex numbers raises an exception when the two |
| 5931 | numbers differ. Since it is not mathematically meaningful to compare |
| 5932 | complex numbers except for equality, I hope that this doesn't break |
| 5933 | too much code. |
| 5934 | |
| 5935 | - The outcome of comparing non-numeric objects of different types is |
| 5936 | not defined by the language, other than that it's arbitrary but |
| 5937 | consistent (see the Reference Manual). An implementation detail changed |
| 5938 | in 2.1a1 such that None now compares less than any other object. Code |
| 5939 | relying on this new behavior (like code that relied on the previous |
| 5940 | behavior) does so at its own risk. |
| 5941 | |
| 5942 | - Functions and methods now support getting and setting arbitrarily |
| 5943 | named attributes (PEP 232). Functions have a new __dict__ |
| 5944 | (a.k.a. func_dict) which hold the function attributes. Methods get |
| 5945 | and set attributes on their underlying im_func. It is a TypeError |
| 5946 | to set an attribute on a bound method. |
| 5947 | |
| 5948 | - The xrange() object implementation has been improved so that |
| 5949 | xrange(sys.maxint) can be used on 64-bit platforms. There's still a |
| 5950 | limitation that in this case len(xrange(sys.maxint)) can't be |
| 5951 | calculated, but the common idiom "for i in xrange(sys.maxint)" will |
| 5952 | work fine as long as the index i doesn't actually reach 2**31. |
| 5953 | (Python uses regular ints for sequence and string indices; fixing |
| 5954 | that is much more work.) |
| 5955 | |
| 5956 | - Two changes to from...import: |
| 5957 | |
| 5958 | 1) "from M import X" now works even if (after loading module M) |
| 5959 | sys.modules['M'] is not a real module; it's basically a getattr() |
| 5960 | operation with AttributeError exceptions changed into ImportError. |
| 5961 | |
| 5962 | 2) "from M import *" now looks for M.__all__ to decide which names to |
| 5963 | import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but |
| 5964 | filters out names starting with '_' as before. Whether or not |
| 5965 | __all__ exists, there's no restriction on the type of M. |
| 5966 | |
| 5967 | - File objects have a new method, xreadlines(). This is the fastest |
| 5968 | way to iterate over all lines in a file: |
| 5969 | |
| 5970 | for line in file.xreadlines(): |
| 5971 | ...do something to line... |
| 5972 | |
| 5973 | See the xreadlines module (mentioned below) for how to do this for |
| 5974 | other file-like objects. |
| 5975 | |
| 5976 | - Even if you don't use file.xreadlines(), you may expect a speedup on |
| 5977 | line-by-line input. The file.readline() method has been optimized |
| 5978 | quite a bit in platform-specific ways: on systems (like Linux) that |
| 5979 | support flockfile(), getc_unlocked(), and funlockfile(), those are |
| 5980 | used by default. On systems (like Windows) without getc_unlocked(), |
| 5981 | a complicated (but still thread-safe) method using fgets() is used by |
| 5982 | default. |
| 5983 | |
| 5984 | You can force use of the fgets() method by #define'ing |
| 5985 | USE_FGETS_IN_GETLINE at build time (it may be faster than |
| 5986 | getc_unlocked()). |
| 5987 | |
| 5988 | You can force fgets() not to be used by #define'ing |
| 5989 | DONT_USE_FGETS_IN_GETLINE (this is the first thing to try if std test |
| 5990 | test_bufio.py fails -- and let us know if it does!). |
| 5991 | |
| 5992 | - In addition, the fileinput module, while still slower than the other |
| 5993 | methods on most platforms, has been sped up too, by using |
| 5994 | file.readlines(sizehint). |
| 5995 | |
| 5996 | - Support for run-time warnings has been added, including a new |
| 5997 | command line option (-W) to specify the disposition of warnings. |
| 5998 | See the description of the warnings module below. |
| 5999 | |
| 6000 | - Extensive changes have been made to the coercion code. This mostly |
| 6001 | affects extension modules (which can now implement mixed-type |
| 6002 | numerical operators without having to use coercion), but |
| 6003 | occasionally, in boundary cases the coercion semantics have changed |
| 6004 | subtly. Since this was a terrible gray area of the language, this |
| 6005 | is considered an improvement. Also note that __rcmp__ is no longer |
| 6006 | supported -- instead of calling __rcmp__, __cmp__ is called with |
| 6007 | reflected arguments. |
| 6008 | |
| 6009 | - In connection with the coercion changes, a new built-in singleton |
| 6010 | object, NotImplemented is defined. This can be returned for |
| 6011 | operations that wish to indicate they are not implemented for a |
| 6012 | particular combination of arguments. From C, this is |
| 6013 | Py_NotImplemented. |
| 6014 | |
| 6015 | - The interpreter accepts now bytecode files on the command line even |
| 6016 | if they do not have a .pyc or .pyo extension. On Linux, after executing |
| 6017 | |
| 6018 | import imp,sys,string |
| 6019 | magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"") |
| 6020 | reg = ':pyc:M::%s::%s:' % (magic, sys.executable) |
| 6021 | open("/proc/sys/fs/binfmt_misc/register","wb").write(reg) |
| 6022 | |
| 6023 | any byte code file can be used as an executable (i.e. as an argument |
| 6024 | to execve(2)). |
| 6025 | |
| 6026 | - %[xXo] formats of negative Python longs now produce a sign |
| 6027 | character. In 1.6 and earlier, they never produced a sign, |
| 6028 | and raised an error if the value of the long was too large |
| 6029 | to fit in a Python int. In 2.0, they produced a sign if and |
| 6030 | only if too large to fit in an int. This was inconsistent |
| 6031 | across platforms (because the size of an int varies across |
| 6032 | platforms), and inconsistent with hex() and oct(). Example: |
| 6033 | |
| 6034 | >>> "%x" % -0x42L |
| 6035 | '-42' # in 2.1 |
| 6036 | 'ffffffbe' # in 2.0 and before, on 32-bit machines |
| 6037 | >>> hex(-0x42L) |
| 6038 | '-0x42L' # in all versions of Python |
| 6039 | |
| 6040 | The behavior of %d formats for negative Python longs remains |
| 6041 | the same as in 2.0 (although in 1.6 and before, they raised |
| 6042 | an error if the long didn't fit in a Python int). |
| 6043 | |
| 6044 | %u formats don't make sense for Python longs, but are allowed |
| 6045 | and treated the same as %d in 2.1. In 2.0, a negative long |
| 6046 | formatted via %u produced a sign if and only if too large to |
| 6047 | fit in an int. In 1.6 and earlier, a negative long formatted |
| 6048 | via %u raised an error if it was too big to fit in an int. |
| 6049 | |
| 6050 | - Dictionary objects have an odd new method, popitem(). This removes |
| 6051 | an arbitrary item from the dictionary and returns it (in the form of |
| 6052 | a (key, value) pair). This can be useful for algorithms that use a |
| 6053 | dictionary as a bag of "to do" items and repeatedly need to pick one |
| 6054 | item. Such algorithms normally end up running in quadratic time; |
| 6055 | using popitem() they can usually be made to run in linear time. |
| 6056 | |
| 6057 | Standard library |
| 6058 | |
| 6059 | - In the time module, the time argument to the functions strftime, |
| 6060 | localtime, gmtime, asctime and ctime is now optional, defaulting to |
| 6061 | the current time (in the local timezone). |
| 6062 | |
| 6063 | - The ftplib module now defaults to passive mode, which is deemed a |
| 6064 | more useful default given that clients are often inside firewalls |
| 6065 | these days. Note that this could break if ftplib is used to connect |
| 6066 | to a *server* that is inside a firewall, from outside; this is |
| 6067 | expected to be a very rare situation. To fix that, you can call |
| 6068 | ftp.set_pasv(0). |
| 6069 | |
| 6070 | - The module site now treats .pth files not only for path configuration, |
| 6071 | but also supports extensions to the initialization code: Lines starting |
| 6072 | with import are executed. |
| 6073 | |
| 6074 | - There's a new module, warnings, which implements a mechanism for |
| 6075 | issuing and filtering warnings. There are some new built-in |
| 6076 | exceptions that serve as warning categories, and a new command line |
| 6077 | option, -W, to control warnings (e.g. -Wi ignores all warnings, -We |
| 6078 | turns warnings into errors). warnings.warn(message[, category]) |
| 6079 | issues a warning message; this can also be called from C as |
| 6080 | PyErr_Warn(category, message). |
| 6081 | |
| 6082 | - A new module xreadlines was added. This exports a single factory |
| 6083 | function, xreadlines(). The intention is that this code is the |
| 6084 | absolutely fastest way to iterate over all lines in an open |
| 6085 | file(-like) object: |
| 6086 | |
| 6087 | import xreadlines |
| 6088 | for line in xreadlines.xreadlines(file): |
| 6089 | ...do something to line... |
| 6090 | |
| 6091 | This is equivalent to the previous the speed record holder using |
| 6092 | file.readlines(sizehint). Note that if file is a real file object |
| 6093 | (as opposed to a file-like object), this is equivalent: |
| 6094 | |
| 6095 | for line in file.xreadlines(): |
| 6096 | ...do something to line... |
| 6097 | |
| 6098 | - The bisect module has new functions bisect_left, insort_left, |
| 6099 | bisect_right and insort_right. The old names bisect and insort |
| 6100 | are now aliases for bisect_right and insort_right. XXX_right |
| 6101 | and XXX_left methods differ in what happens when the new element |
| 6102 | compares equal to one or more elements already in the list: the |
| 6103 | XXX_left methods insert to the left, the XXX_right methods to the |
| 6104 | right. Code that doesn't care where equal elements end up should |
| 6105 | continue to use the old, short names ("bisect" and "insort"). |
| 6106 | |
| 6107 | - The new curses.panel module wraps the panel library that forms part |
| 6108 | of SYSV curses and ncurses. Contributed by Thomas Gellekum. |
| 6109 | |
| 6110 | - The SocketServer module now sets the allow_reuse_address flag by |
| 6111 | default in the TCPServer class. |
| 6112 | |
| 6113 | - A new function, sys._getframe(), returns the stack frame pointer of |
| 6114 | the caller. This is intended only as a building block for |
| 6115 | higher-level mechanisms such as string interpolation. |
| 6116 | |
| 6117 | - The pyexpat module supports a number of new handlers, which are |
| 6118 | available only in expat 1.2. If invocation of a callback fails, it |
| 6119 | will report an additional frame in the traceback. Parser objects |
| 6120 | participate now in garbage collection. If expat reports an unknown |
| 6121 | encoding, pyexpat will try to use a Python codec; that works only |
| 6122 | for single-byte charsets. The parser type objects is exposed as |
| 6123 | XMLParserObject. |
| 6124 | |
| 6125 | - xml.dom now offers standard definitions for symbolic node type and |
| 6126 | exception code constants, and a hierarchy of DOM exceptions. minidom |
| 6127 | was adjusted to use them. |
| 6128 | |
| 6129 | - The conformance of xml.dom.minidom to the DOM specification was |
| 6130 | improved. It detects a number of additional error cases; the |
| 6131 | previous/next relationship works even when the tree is modified; |
| 6132 | Node supports the normalize() method; NamedNodeMap, DocumentType and |
| 6133 | DOMImplementation classes were added; Element supports the |
| 6134 | hasAttribute and hasAttributeNS methods; and Text supports the splitText |
| 6135 | method. |
| 6136 | |
| 6137 | Build issues |
| 6138 | |
| 6139 | - For Unix (and Unix-compatible) builds, configuration and building of |
| 6140 | extension modules is now greatly automated. Rather than having to |
| 6141 | edit the Modules/Setup file to indicate which modules should be |
| 6142 | built and where their include files and libraries are, a |
| 6143 | distutils-based setup.py script now takes care of building most |
| 6144 | extension modules. All extension modules built this way are built |
| 6145 | as shared libraries. Only a few modules that must be linked |
| 6146 | statically are still listed in the Setup file; you won't need to |
| 6147 | edit their configuration. |
| 6148 | |
| 6149 | - Python should now build out of the box on Cygwin. If it doesn't, |
| 6150 | mail to Jason Tishler (jlt63 at users.sourceforge.net). |
| 6151 | |
| 6152 | - Python now always uses its own (renamed) implementation of getopt() |
| 6153 | -- there's too much variation among C library getopt() |
| 6154 | implementations. |
| 6155 | |
| 6156 | - C++ compilers are better supported; the CXX macro is always set to a |
| 6157 | C++ compiler if one is found. |
| 6158 | |
| 6159 | Windows changes |
| 6160 | |
| 6161 | - select module: By default under Windows, a select() call |
| 6162 | can specify no more than 64 sockets. Python now boosts |
| 6163 | this Microsoft default to 512. If you need even more than |
| 6164 | that, see the MS docs (you'll need to #define FD_SETSIZE |
| 6165 | and recompile Python from source). |
| 6166 | |
| 6167 | - Support for Windows 3.1, DOS and OS/2 is gone. The Lib/dos-8x3 |
| 6168 | subdirectory is no more! |
| 6169 | |
| 6170 | |
| 6171 | What's New in Python 2.0? |
| 6172 | ========================= |
| 6173 | |
| 6174 | Below is a list of all relevant changes since release 1.6. Older |
| 6175 | changes are in the file HISTORY. If you are making the jump directly |
| 6176 | from Python 1.5.2 to 2.0, make sure to read the section for 1.6 in the |
| 6177 | HISTORY file! Many important changes listed there. |
| 6178 | |
| 6179 | Alternatively, a good overview of the changes between 1.5.2 and 2.0 is |
| 6180 | the document "What's New in Python 2.0" by Kuchling and Moshe Zadka: |
Andrew M. Kuchling | e240d9b | 2004-03-21 18:48:22 +0000 | [diff] [blame] | 6181 | http://www.amk.ca/python/2.0/. |
Skip Montanaro | 4cb2204 | 2002-09-17 20:55:31 +0000 | [diff] [blame] | 6182 | |
| 6183 | --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/) |
| 6184 | |
| 6185 | ====================================================================== |
| 6186 | |
| 6187 | What's new in 2.0 (since release candidate 1)? |
| 6188 | ============================================== |
| 6189 | |
| 6190 | Standard library |
| 6191 | |
| 6192 | - The copy_reg module was modified to clarify its intended use: to |
| 6193 | register pickle support for extension types, not for classes. |
| 6194 | pickle() will raise a TypeError if it is passed a class. |
| 6195 | |
| 6196 | - Fixed a bug in gettext's "normalize and expand" code that prevented |
| 6197 | it from finding an existing .mo file. |
| 6198 | |
| 6199 | - Restored support for HTTP/0.9 servers in httplib. |
| 6200 | |
| 6201 | - The math module was changed to stop raising OverflowError in case of |
| 6202 | underflow, and return 0 instead in underflow cases. Whether Python |
| 6203 | used to raise OverflowError in case of underflow was platform- |
| 6204 | dependent (it did when the platform math library set errno to ERANGE |
| 6205 | on underflow). |
| 6206 | |
| 6207 | - Fixed a bug in StringIO that occurred when the file position was not |
| 6208 | at the end of the file and write() was called with enough data to |
| 6209 | extend past the end of the file. |
| 6210 | |
| 6211 | - Fixed a bug that caused Tkinter error messages to get lost on |
| 6212 | Windows. The bug was fixed by replacing direct use of |
| 6213 | interp->result with Tcl_GetStringResult(interp). |
| 6214 | |
| 6215 | - Fixed bug in urllib2 that caused it to fail when it received an HTTP |
| 6216 | redirect response. |
| 6217 | |
| 6218 | - Several changes were made to distutils: Some debugging code was |
| 6219 | removed from util. Fixed the installer used when an external zip |
| 6220 | program (like WinZip) is not found; the source code for this |
| 6221 | installer is in Misc/distutils. check_lib() was modified to behave |
| 6222 | more like AC_CHECK_LIB by add other_libraries() as a parameter. The |
| 6223 | test for whether installed modules are on sys.path was changed to |
| 6224 | use both normcase() and normpath(). |
| 6225 | |
| 6226 | - Several minor bugs were fixed in the xml package (the minidom, |
| 6227 | pulldom, expatreader, and saxutils modules). |
| 6228 | |
| 6229 | - The regression test driver (regrtest.py) behavior when invoked with |
| 6230 | -l changed: It now reports a count of objects that are recognized as |
| 6231 | garbage but not freed by the garbage collector. |
| 6232 | |
| 6233 | - The regression test for the math module was changed to test |
| 6234 | exceptional behavior when the test is run in verbose mode. Python |
| 6235 | cannot yet guarantee consistent exception behavior across platforms, |
| 6236 | so the exception part of test_math is run only in verbose mode, and |
| 6237 | may fail on your platform. |
| 6238 | |
| 6239 | Internals |
| 6240 | |
| 6241 | - PyOS_CheckStack() has been disabled on Win64, where it caused |
| 6242 | test_sre to fail. |
| 6243 | |
| 6244 | Build issues |
| 6245 | |
| 6246 | - Changed compiler flags, so that gcc is always invoked with -Wall and |
| 6247 | -Wstrict-prototypes. Users compiling Python with GCC should see |
| 6248 | exactly one warning, except if they have passed configure the |
| 6249 | --with-pydebug flag. The expected warning is for getopt() in |
| 6250 | Modules/main.c. This warning will be fixed for Python 2.1. |
| 6251 | |
| 6252 | - Fixed configure to add -threads argument during linking on OSF1. |
| 6253 | |
| 6254 | Tools and other miscellany |
| 6255 | |
| 6256 | - The compiler in Tools/compiler was updated to support the new |
| 6257 | language features introduced in 2.0: extended print statement, list |
| 6258 | comprehensions, and augmented assignments. The new compiler should |
| 6259 | also be backwards compatible with Python 1.5.2; the compiler will |
| 6260 | always generate code for the version of the interpreter it runs |
| 6261 | under. |
| 6262 | |
| 6263 | What's new in 2.0 release candidate 1 (since beta 2)? |
| 6264 | ===================================================== |
| 6265 | |
| 6266 | What is release candidate 1? |
| 6267 | |
| 6268 | We believe that release candidate 1 will fix all known bugs that we |
| 6269 | intend to fix for the 2.0 final release. This release should be a bit |
| 6270 | more stable than the previous betas. We would like to see even more |
| 6271 | widespread testing before the final release, so we are producing this |
| 6272 | release candidate. The final release will be exactly the same unless |
| 6273 | any show-stopping (or brown bag) bugs are found by testers of the |
| 6274 | release candidate. |
| 6275 | |
| 6276 | All the changes since the last beta release are bug fixes or changes |
| 6277 | to support building Python for specific platforms. |
| 6278 | |
| 6279 | Core language, builtins, and interpreter |
| 6280 | |
| 6281 | - A bug that caused crashes when __coerce__ was used with augmented |
| 6282 | assignment, e.g. +=, was fixed. |
| 6283 | |
| 6284 | - Raise ZeroDivisionError when raising zero to a negative number, |
| 6285 | e.g. 0.0 ** -2.0. Note that math.pow is unrelated to the builtin |
| 6286 | power operator and the result of math.pow(0.0, -2.0) will vary by |
| 6287 | platform. On Linux, it raises a ValueError. |
| 6288 | |
| 6289 | - A bug in Unicode string interpolation was fixed that occasionally |
| 6290 | caused errors with formats including "%%". For example, the |
| 6291 | following expression "%% %s" % u"abc" no longer raises a TypeError. |
| 6292 | |
| 6293 | - Compilation of deeply nested expressions raises MemoryError instead |
| 6294 | of SyntaxError, e.g. eval("[" * 50 + "]" * 50). |
| 6295 | |
| 6296 | - In 2.0b2 on Windows, the interpreter wrote .pyc files in text mode, |
| 6297 | rendering them useless. They are now written in binary mode again. |
| 6298 | |
| 6299 | Standard library |
| 6300 | |
| 6301 | - Keyword arguments are now accepted for most pattern and match object |
| 6302 | methods in SRE, the standard regular expression engine. |
| 6303 | |
| 6304 | - In SRE, fixed error with negative lookahead and lookbehind that |
| 6305 | manifested itself as a runtime error in patterns like "(?<!abc)(def)". |
| 6306 | |
| 6307 | - Several bugs in the Unicode handling and error handling in _tkinter |
| 6308 | were fixed. |
| 6309 | |
| 6310 | - Fix memory management errors in Merge() and Tkapp_Call() routines. |
| 6311 | |
| 6312 | - Several changes were made to cStringIO to make it compatible with |
| 6313 | the file-like object interface and with StringIO. If operations are |
| 6314 | performed on a closed object, an exception is raised. The truncate |
| 6315 | method now accepts a position argument and readline accepts a size |
| 6316 | argument. |
| 6317 | |
| 6318 | - There were many changes made to the linuxaudiodev module and its |
| 6319 | test suite; as a result, a short, unexpected audio sample should now |
| 6320 | play when the regression test is run. |
| 6321 | |
| 6322 | Note that this module is named poorly, because it should work |
| 6323 | correctly on any platform that supports the Open Sound System |
| 6324 | (OSS). |
| 6325 | |
| 6326 | The module now raises exceptions when errors occur instead of |
| 6327 | crashing. It also defines the AFMT_A_LAW format (logarithmic A-law |
| 6328 | audio) and defines a getptr() method that calls the |
| 6329 | SNDCTL_DSP_GETxPTR ioctl defined in the OSS Programmer's Guide. |
| 6330 | |
| 6331 | - The library_version attribute, introduced in an earlier beta, was |
| 6332 | removed because it can not be supported with early versions of the C |
| 6333 | readline library, which provides no way to determine the version at |
| 6334 | compile-time. |
| 6335 | |
| 6336 | - The binascii module is now enabled on Win64. |
| 6337 | |
| 6338 | - tokenize.py no longer suffers "recursion depth" errors when parsing |
| 6339 | programs with very long string literals. |
| 6340 | |
| 6341 | Internals |
| 6342 | |
| 6343 | - Fixed several buffer overflow vulnerabilities in calculate_path(), |
| 6344 | which is called when the interpreter starts up to determine where |
| 6345 | the standard library is installed. These vulnerabilities affect all |
| 6346 | previous versions of Python and can be exploited by setting very |
| 6347 | long values for PYTHONHOME or argv[0]. The risk is greatest for a |
| 6348 | setuid Python script, although use of the wrapper in |
| 6349 | Misc/setuid-prog.c will eliminate the vulnerability. |
| 6350 | |
| 6351 | - Fixed garbage collection bugs in instance creation that were |
| 6352 | triggered when errors occurred during initialization. The solution, |
| 6353 | applied in cPickle and in PyInstance_New(), is to call |
| 6354 | PyObject_GC_Init() after the initialization of the object's |
| 6355 | container attributes is complete. |
| 6356 | |
| 6357 | - pyexpat adds definitions of PyModule_AddStringConstant and |
| 6358 | PyModule_AddObject if the Python version is less than 2.0, which |
| 6359 | provides compatibility with PyXML on Python 1.5.2. |
| 6360 | |
| 6361 | - If the platform has a bogus definition for LONG_BIT (the number of |
| 6362 | bits in a long), an error will be reported at compile time. |
| 6363 | |
| 6364 | - Fix bugs in _PyTuple_Resize() which caused hard-to-interpret garbage |
| 6365 | collection crashes and possibly other, unreported crashes. |
| 6366 | |
| 6367 | - Fixed a memory leak in _PyUnicode_Fini(). |
| 6368 | |
| 6369 | Build issues |
| 6370 | |
| 6371 | - configure now accepts a --with-suffix option that specifies the |
| 6372 | executable suffix. This is useful for builds on Cygwin and Mac OS |
| 6373 | X, for example. |
| 6374 | |
| 6375 | - The mmap.PAGESIZE constant is now initialized using sysconf when |
| 6376 | possible, which eliminates a dependency on -lucb for Reliant UNIX. |
| 6377 | |
| 6378 | - The md5 file should now compile on all platforms. |
| 6379 | |
| 6380 | - The select module now compiles on platforms that do not define |
| 6381 | POLLRDNORM and related constants. |
| 6382 | |
| 6383 | - Darwin (Mac OS X): Initial support for static builds on this |
| 6384 | platform. |
| 6385 | |
| 6386 | - BeOS: A number of changes were made to the build and installation |
| 6387 | process. ar-fake now operates on a directory of object files. |
| 6388 | dl_export.h is gone, and its macros now appear on the mwcc command |
| 6389 | line during build on PPC BeOS. |
| 6390 | |
| 6391 | - Platform directory in lib/python2.0 is "plat-beos5" (or |
| 6392 | "plat-beos4", if building on BeOS 4.5), rather than "plat-beos". |
| 6393 | |
| 6394 | - Cygwin: Support for shared libraries, Tkinter, and sockets. |
| 6395 | |
| 6396 | - SunOS 4.1.4_JL: Fix test for directory existence in configure. |
| 6397 | |
| 6398 | Tools and other miscellany |
| 6399 | |
| 6400 | - Removed debugging prints from main used with freeze. |
| 6401 | |
| 6402 | - IDLE auto-indent no longer crashes when it encounters Unicode |
| 6403 | characters. |
| 6404 | |
| 6405 | What's new in 2.0 beta 2 (since beta 1)? |
| 6406 | ======================================== |
| 6407 | |
| 6408 | Core language, builtins, and interpreter |
| 6409 | |
| 6410 | - Add support for unbounded ints in %d,i,u,x,X,o formats; for example |
| 6411 | "%d" % 2L**64 == "18446744073709551616". |
| 6412 | |
| 6413 | - Add -h and -V command line options to print the usage message and |
| 6414 | Python version number and exit immediately. |
| 6415 | |
| 6416 | - eval() and exec accept Unicode objects as code parameters. |
| 6417 | |
| 6418 | - getattr() and setattr() now also accept Unicode objects for the |
| 6419 | attribute name, which are converted to strings using the default |
| 6420 | encoding before lookup. |
| 6421 | |
| 6422 | - Multiplication on string and Unicode now does proper bounds |
| 6423 | checking; e.g. 'a' * 65536 * 65536 will raise ValueError, "repeated |
| 6424 | string is too long." |
| 6425 | |
| 6426 | - Better error message when continue is found in try statement in a |
| 6427 | loop. |
| 6428 | |
| 6429 | |
| 6430 | Standard library and extensions |
| 6431 | |
| 6432 | - socket module: the OpenSSL code now adds support for RAND_status() |
| 6433 | and EGD (Entropy Gathering Device). |
| 6434 | |
| 6435 | - array: reverse() method of array now works. buffer_info() now does |
| 6436 | argument checking; it still takes no arguments. |
| 6437 | |
| 6438 | - asyncore/asynchat: Included most recent version from Sam Rushing. |
| 6439 | |
| 6440 | - cgi: Accept '&' or ';' as separator characters when parsing form data. |
| 6441 | |
| 6442 | - CGIHTTPServer: Now works on Windows (and perhaps even Mac). |
| 6443 | |
| 6444 | - ConfigParser: When reading the file, options spelled in upper case |
| 6445 | letters are now correctly converted to lowercase. |
| 6446 | |
| 6447 | - copy: Copy Unicode objects atomically. |
| 6448 | |
| 6449 | - cPickle: Fail gracefully when copy_reg can't be imported. |
| 6450 | |
| 6451 | - cStringIO: Implemented readlines() method. |
| 6452 | |
| 6453 | - dbm: Add get() and setdefault() methods to dbm object. Add constant |
| 6454 | `library' to module that names the library used. Added doc strings |
| 6455 | and method names to error messages. Uses configure to determine |
| 6456 | which ndbm.h file to include; Berkeley DB's nbdm and GDBM's ndbm is |
| 6457 | now available options. |
| 6458 | |
| 6459 | - distutils: Update to version 0.9.3. |
| 6460 | |
| 6461 | - dl: Add several dl.RTLD_ constants. |
| 6462 | |
| 6463 | - fpectl: Now supported on FreeBSD. |
| 6464 | |
| 6465 | - gc: Add DEBUG_SAVEALL option. When enabled all garbage objects |
| 6466 | found by the collector will be saved in gc.garbage. This is useful |
| 6467 | for debugging a program that creates reference cycles. |
| 6468 | |
| 6469 | - httplib: Three changes: Restore support for set_debuglevel feature |
| 6470 | of HTTP class. Do not close socket on zero-length response. Do not |
| 6471 | crash when server sends invalid content-length header. |
| 6472 | |
| 6473 | - mailbox: Mailbox class conforms better to qmail specifications. |
| 6474 | |
| 6475 | - marshal: When reading a short, sign-extend on platforms where shorts |
| 6476 | are bigger than 16 bits. When reading a long, repair the unportable |
| 6477 | sign extension that was being done for 64-bit machines. (It assumed |
| 6478 | that signed right shift sign-extends.) |
| 6479 | |
| 6480 | - operator: Add contains(), invert(), __invert__() as aliases for |
| 6481 | __contains__(), inv(), and __inv__() respectively. |
| 6482 | |
| 6483 | - os: Add support for popen2() and popen3() on all platforms where |
| 6484 | fork() exists. (popen4() is still in the works.) |
| 6485 | |
| 6486 | - os: (Windows only:) Add startfile() function that acts like double- |
| 6487 | clicking on a file in Explorer (or passing the file name to the |
| 6488 | DOS "start" command). |
| 6489 | |
| 6490 | - os.path: (Windows, DOS:) Treat trailing colon correctly in |
| 6491 | os.path.join. os.path.join("a:", "b") yields "a:b". |
| 6492 | |
| 6493 | - pickle: Now raises ValueError when an invalid pickle that contains |
| 6494 | a non-string repr where a string repr was expected. This behavior |
| 6495 | matches cPickle. |
| 6496 | |
| 6497 | - posixfile: Remove broken __del__() method. |
| 6498 | |
| 6499 | - py_compile: support CR+LF line terminators in source file. |
| 6500 | |
| 6501 | - readline: Does not immediately exit when ^C is hit when readline and |
| 6502 | threads are configured. Adds definition of rl_library_version. (The |
| 6503 | latter addition requires GNU readline 2.2 or later.) |
| 6504 | |
| 6505 | - rfc822: Domain literals returned by AddrlistClass method |
| 6506 | getdomainliteral() are now properly wrapped in brackets. |
| 6507 | |
| 6508 | - site: sys.setdefaultencoding() should only be called in case the |
| 6509 | standard default encoding ("ascii") is changed. This saves quite a |
| 6510 | few cycles during startup since the first call to |
| 6511 | setdefaultencoding() will initialize the codec registry and the |
| 6512 | encodings package. |
| 6513 | |
| 6514 | - socket: Support for size hint in readlines() method of object returned |
| 6515 | by makefile(). |
| 6516 | |
| 6517 | - sre: Added experimental expand() method to match objects. Does not |
| 6518 | use buffer interface on Unicode strings. Does not hang if group id |
| 6519 | is followed by whitespace. |
| 6520 | |
| 6521 | - StringIO: Size hint in readlines() is now supported as documented. |
| 6522 | |
| 6523 | - struct: Check ranges for bytes and shorts. |
| 6524 | |
| 6525 | - urllib: Improved handling of win32 proxy settings. Fixed quote and |
| 6526 | quote_plus functions so that the always encode a comma. |
| 6527 | |
| 6528 | - Tkinter: Image objects are now guaranteed to have unique ids. Set |
| 6529 | event.delta to zero if Tk version doesn't support mousewheel. |
| 6530 | Removed some debugging prints. |
| 6531 | |
| 6532 | - UserList: now implements __contains__(). |
| 6533 | |
| 6534 | - webbrowser: On Windows, use os.startfile() instead of os.popen(), |
| 6535 | which works around a bug in Norton AntiVirus 2000 that leads directly |
| 6536 | to a Blue Screen freeze. |
| 6537 | |
| 6538 | - xml: New version detection code allows PyXML to override standard |
| 6539 | XML package if PyXML version is greater than 0.6.1. |
| 6540 | |
| 6541 | - xml.dom: DOM level 1 support for basic XML. Includes xml.dom.minidom |
| 6542 | (conventional DOM), and xml.dom.pulldom, which allows building the DOM |
| 6543 | tree only for nodes which are sufficiently interesting to a specific |
| 6544 | application. Does not provide the HTML-specific extensions. Still |
| 6545 | undocumented. |
| 6546 | |
| 6547 | - xml.sax: SAX 2 support for Python, including all the handler |
| 6548 | interfaces needed to process XML 1.0 compliant XML. Some |
| 6549 | documentation is already available. |
| 6550 | |
| 6551 | - pyexpat: Renamed to xml.parsers.expat since this is part of the new, |
| 6552 | packagized XML support. |
| 6553 | |
| 6554 | |
| 6555 | C API |
| 6556 | |
| 6557 | - Add three new convenience functions for module initialization -- |
| 6558 | PyModule_AddObject(), PyModule_AddIntConstant(), and |
| 6559 | PyModule_AddStringConstant(). |
| 6560 | |
| 6561 | - Cleaned up definition of NULL in C source code; all definitions were |
| 6562 | removed and add #error to Python.h if NULL isn't defined after |
| 6563 | #include of stdio.h. |
| 6564 | |
| 6565 | - Py_PROTO() macros that were removed in 2.0b1 have been restored for |
| 6566 | backwards compatibility (at the source level) with old extensions. |
| 6567 | |
| 6568 | - A wrapper API was added for signal() and sigaction(). Instead of |
| 6569 | either function, always use PyOS_getsig() to get a signal handler |
| 6570 | and PyOS_setsig() to set one. A new convenience typedef |
| 6571 | PyOS_sighandler_t is defined for the type of signal handlers. |
| 6572 | |
| 6573 | - Add PyString_AsStringAndSize() function that provides access to the |
| 6574 | internal data buffer and size of a string object -- or the default |
| 6575 | encoded version of a Unicode object. |
| 6576 | |
| 6577 | - PyString_Size() and PyString_AsString() accept Unicode objects. |
| 6578 | |
| 6579 | - The standard header <limits.h> is now included by Python.h (if it |
| 6580 | exists). INT_MAX and LONG_MAX will always be defined, even if |
| 6581 | <limits.h> is not available. |
| 6582 | |
| 6583 | - PyFloat_FromString takes a second argument, pend, that was |
| 6584 | effectively useless. It is now officially useless but preserved for |
| 6585 | backwards compatibility. If the pend argument is not NULL, *pend is |
| 6586 | set to NULL. |
| 6587 | |
| 6588 | - PyObject_GetAttr() and PyObject_SetAttr() now accept Unicode objects |
| 6589 | for the attribute name. See note on getattr() above. |
| 6590 | |
| 6591 | - A few bug fixes to argument processing for Unicode. |
| 6592 | PyArg_ParseTupleAndKeywords() now accepts "es#" and "es". |
| 6593 | PyArg_Parse() special cases "s#" for Unicode objects; it returns a |
| 6594 | pointer to the default encoded string data instead of to the raw |
| 6595 | UTF-16. |
| 6596 | |
| 6597 | - Py_BuildValue accepts B format (for bgen-generated code). |
| 6598 | |
| 6599 | |
| 6600 | Internals |
| 6601 | |
| 6602 | - On Unix, fix code for finding Python installation directory so that |
| 6603 | it works when argv[0] is a relative path. |
| 6604 | |
| 6605 | - Added a true unicode_internal_encode() function and fixed the |
| 6606 | unicode_internal_decode function() to support Unicode objects directly |
| 6607 | rather than by generating a copy of the object. |
| 6608 | |
| 6609 | - Several of the internal Unicode tables are much smaller now, and |
| 6610 | the source code should be much friendlier to weaker compilers. |
| 6611 | |
| 6612 | - In the garbage collector: Fixed bug in collection of tuples. Fixed |
| 6613 | bug that caused some instances to be removed from the container set |
| 6614 | while they were still live. Fixed parsing in gc.set_debug() for |
| 6615 | platforms where sizeof(long) > sizeof(int). |
| 6616 | |
| 6617 | - Fixed refcount problem in instance deallocation that only occurred |
| 6618 | when Py_REF_DEBUG was defined and Py_TRACE_REFS was not. |
| 6619 | |
| 6620 | - On Windows, getpythonregpath is now protected against null data in |
| 6621 | registry key. |
| 6622 | |
| 6623 | - On Unix, create .pyc/.pyo files with O_EXCL flag to avoid a race |
| 6624 | condition. |
| 6625 | |
| 6626 | |
| 6627 | Build and platform-specific issues |
| 6628 | |
| 6629 | - Better support of GNU Pth via --with-pth configure option. |
| 6630 | |
| 6631 | - Python/C API now properly exposed to dynamically-loaded extension |
| 6632 | modules on Reliant UNIX. |
| 6633 | |
| 6634 | - Changes for the benefit of SunOS 4.1.4 (really!). mmapmodule.c: |
| 6635 | Don't define MS_SYNC to be zero when it is undefined. Added missing |
| 6636 | prototypes in posixmodule.c. |
| 6637 | |
| 6638 | - Improved support for HP-UX build. Threads should now be correctly |
| 6639 | configured (on HP-UX 10.20 and 11.00). |
| 6640 | |
| 6641 | - Fix largefile support on older NetBSD systems and OpenBSD by adding |
| 6642 | define for TELL64. |
| 6643 | |
| 6644 | |
| 6645 | Tools and other miscellany |
| 6646 | |
| 6647 | - ftpmirror: Call to main() is wrapped in if __name__ == "__main__". |
| 6648 | |
| 6649 | - freeze: The modulefinder now works with 2.0 opcodes. |
| 6650 | |
| 6651 | - IDLE: |
| 6652 | Move hackery of sys.argv until after the Tk instance has been |
| 6653 | created, which allows the application-specific Tkinter |
| 6654 | initialization to be executed if present; also pass an explicit |
| 6655 | className parameter to the Tk() constructor. |
| 6656 | |
| 6657 | |
| 6658 | What's new in 2.0 beta 1? |
| 6659 | ========================= |
| 6660 | |
| 6661 | Source Incompatibilities |
| 6662 | ------------------------ |
| 6663 | |
| 6664 | None. Note that 1.6 introduced several incompatibilities with 1.5.2, |
| 6665 | such as single-argument append(), connect() and bind(), and changes to |
| 6666 | str(long) and repr(float). |
| 6667 | |
| 6668 | |
| 6669 | Binary Incompatibilities |
| 6670 | ------------------------ |
| 6671 | |
| 6672 | - Third party extensions built for Python 1.5.x or 1.6 cannot be used |
| 6673 | with Python 2.0; these extensions will have to be rebuilt for Python |
| 6674 | 2.0. |
| 6675 | |
| 6676 | - On Windows, attempting to import a third party extension built for |
| 6677 | Python 1.5.x or 1.6 results in an immediate crash; there's not much we |
| 6678 | can do about this. Check your PYTHONPATH environment variable! |
| 6679 | |
| 6680 | - Python bytecode files (*.pyc and *.pyo) are not compatible between |
| 6681 | releases. |
| 6682 | |
| 6683 | |
| 6684 | Overview of Changes Since 1.6 |
| 6685 | ----------------------------- |
| 6686 | |
| 6687 | There are many new modules (including brand new XML support through |
| 6688 | the xml package, and i18n support through the gettext module); a list |
| 6689 | of all new modules is included below. Lots of bugs have been fixed. |
| 6690 | |
| 6691 | The process for making major new changes to the language has changed |
| 6692 | since Python 1.6. Enhancements must now be documented by a Python |
| 6693 | Enhancement Proposal (PEP) before they can be accepted. |
| 6694 | |
| 6695 | There are several important syntax enhancements, described in more |
| 6696 | detail below: |
| 6697 | |
| 6698 | - Augmented assignment, e.g. x += 1 |
| 6699 | |
| 6700 | - List comprehensions, e.g. [x**2 for x in range(10)] |
| 6701 | |
| 6702 | - Extended import statement, e.g. import Module as Name |
| 6703 | |
| 6704 | - Extended print statement, e.g. print >> file, "Hello" |
| 6705 | |
| 6706 | Other important changes: |
| 6707 | |
| 6708 | - Optional collection of cyclical garbage |
| 6709 | |
| 6710 | Python Enhancement Proposal (PEP) |
| 6711 | --------------------------------- |
| 6712 | |
| 6713 | PEP stands for Python Enhancement Proposal. A PEP is a design |
| 6714 | document providing information to the Python community, or describing |
| 6715 | a new feature for Python. The PEP should provide a concise technical |
| 6716 | specification of the feature and a rationale for the feature. |
| 6717 | |
| 6718 | We intend PEPs to be the primary mechanisms for proposing new |
| 6719 | features, for collecting community input on an issue, and for |
| 6720 | documenting the design decisions that have gone into Python. The PEP |
| 6721 | author is responsible for building consensus within the community and |
| 6722 | documenting dissenting opinions. |
| 6723 | |
| 6724 | The PEPs are available at http://python.sourceforge.net/peps/. |
| 6725 | |
| 6726 | Augmented Assignment |
| 6727 | -------------------- |
| 6728 | |
| 6729 | This must have been the most-requested feature of the past years! |
| 6730 | Eleven new assignment operators were added: |
| 6731 | |
| 6732 | += -= *= /= %= **= <<= >>= &= ^= |= |
| 6733 | |
| 6734 | For example, |
| 6735 | |
| 6736 | A += B |
| 6737 | |
| 6738 | is similar to |
| 6739 | |
| 6740 | A = A + B |
| 6741 | |
| 6742 | except that A is evaluated only once (relevant when A is something |
| 6743 | like dict[index].attr). |
| 6744 | |
| 6745 | However, if A is a mutable object, A may be modified in place. Thus, |
| 6746 | if A is a number or a string, A += B has the same effect as A = A+B |
| 6747 | (except A is only evaluated once); but if a is a list, A += B has the |
| 6748 | same effect as A.extend(B)! |
| 6749 | |
| 6750 | Classes and built-in object types can override the new operators in |
| 6751 | order to implement the in-place behavior; the not-in-place behavior is |
| 6752 | used automatically as a fallback when an object doesn't implement the |
| 6753 | in-place behavior. For classes, the method name is derived from the |
| 6754 | method name for the corresponding not-in-place operator by inserting |
| 6755 | an 'i' in front of the name, e.g. __iadd__ implements in-place |
| 6756 | __add__. |
| 6757 | |
| 6758 | Augmented assignment was implemented by Thomas Wouters. |
| 6759 | |
| 6760 | |
| 6761 | List Comprehensions |
| 6762 | ------------------- |
| 6763 | |
| 6764 | This is a flexible new notation for lists whose elements are computed |
| 6765 | from another list (or lists). The simplest form is: |
| 6766 | |
| 6767 | [<expression> for <variable> in <sequence>] |
| 6768 | |
| 6769 | For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9]. |
| 6770 | This is more efficient than a for loop with a list.append() call. |
| 6771 | |
| 6772 | You can also add a condition: |
| 6773 | |
| 6774 | [<expression> for <variable> in <sequence> if <condition>] |
| 6775 | |
| 6776 | For example, [w for w in words if w == w.lower()] would yield the list |
| 6777 | of words that contain no uppercase characters. This is more efficient |
| 6778 | than a for loop with an if statement and a list.append() call. |
| 6779 | |
| 6780 | You can also have nested for loops and more than one 'if' clause. For |
| 6781 | example, here's a function that flattens a sequence of sequences:: |
| 6782 | |
| 6783 | def flatten(seq): |
| 6784 | return [x for subseq in seq for x in subseq] |
| 6785 | |
| 6786 | flatten([[0], [1,2,3], [4,5], [6,7,8,9], []]) |
| 6787 | |
| 6788 | This prints |
| 6789 | |
| 6790 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
| 6791 | |
| 6792 | List comprehensions originated as a patch set from Greg Ewing; Skip |
| 6793 | Montanaro and Thomas Wouters also contributed. Described by PEP 202. |
| 6794 | |
| 6795 | |
| 6796 | Extended Import Statement |
| 6797 | ------------------------- |
| 6798 | |
| 6799 | Many people have asked for a way to import a module under a different |
| 6800 | name. This can be accomplished like this: |
| 6801 | |
| 6802 | import foo |
| 6803 | bar = foo |
| 6804 | del foo |
| 6805 | |
| 6806 | but this common idiom gets old quickly. A simple extension of the |
| 6807 | import statement now allows this to be written as follows: |
| 6808 | |
| 6809 | import foo as bar |
| 6810 | |
| 6811 | There's also a variant for 'from ... import': |
| 6812 | |
| 6813 | from foo import bar as spam |
| 6814 | |
| 6815 | This also works with packages; e.g. you can write this: |
| 6816 | |
| 6817 | import test.regrtest as regrtest |
| 6818 | |
| 6819 | Note that 'as' is not a new keyword -- it is recognized only in this |
| 6820 | context (this is only possible because the syntax for the import |
| 6821 | statement doesn't involve expressions). |
| 6822 | |
| 6823 | Implemented by Thomas Wouters. Described by PEP 221. |
| 6824 | |
| 6825 | |
| 6826 | Extended Print Statement |
| 6827 | ------------------------ |
| 6828 | |
| 6829 | Easily the most controversial new feature, this extension to the print |
| 6830 | statement adds an option to make the output go to a different file |
| 6831 | than the default sys.stdout. |
| 6832 | |
| 6833 | For example, to write an error message to sys.stderr, you can now |
| 6834 | write: |
| 6835 | |
| 6836 | print >> sys.stderr, "Error: bad dog!" |
| 6837 | |
| 6838 | As a special feature, if the expression used to indicate the file |
| 6839 | evaluates to None, the current value of sys.stdout is used. Thus: |
| 6840 | |
| 6841 | print >> None, "Hello world" |
| 6842 | |
| 6843 | is equivalent to |
| 6844 | |
| 6845 | print "Hello world" |
| 6846 | |
| 6847 | Design and implementation by Barry Warsaw. Described by PEP 214. |
| 6848 | |
| 6849 | |
| 6850 | Optional Collection of Cyclical Garbage |
| 6851 | --------------------------------------- |
| 6852 | |
| 6853 | Python is now equipped with a garbage collector that can hunt down |
| 6854 | cyclical references between Python objects. It's no replacement for |
| 6855 | reference counting; in fact, it depends on the reference counts being |
| 6856 | correct, and decides that a set of objects belong to a cycle if all |
| 6857 | their reference counts can be accounted for from their references to |
| 6858 | each other. This devious scheme was first proposed by Eric Tiedemann, |
| 6859 | and brought to implementation by Neil Schemenauer. |
| 6860 | |
| 6861 | There's a module "gc" that lets you control some parameters of the |
| 6862 | garbage collection. There's also an option to the configure script |
| 6863 | that lets you enable or disable the garbage collection. In 2.0b1, |
| 6864 | it's on by default, so that we (hopefully) can collect decent user |
| 6865 | experience with this new feature. There are some questions about its |
| 6866 | performance. If it proves to be too much of a problem, we'll turn it |
| 6867 | off by default in the final 2.0 release. |
| 6868 | |
| 6869 | |
| 6870 | Smaller Changes |
| 6871 | --------------- |
| 6872 | |
| 6873 | A new function zip() was added. zip(seq1, seq2, ...) is equivalent to |
| 6874 | map(None, seq1, seq2, ...) when the sequences have the same length; |
| 6875 | i.e. zip([1,2,3], [10,20,30]) returns [(1,10), (2,20), (3,30)]. When |
| 6876 | the lists are not all the same length, the shortest list wins: |
| 6877 | zip([1,2,3], [10,20]) returns [(1,10), (2,20)]. See PEP 201. |
| 6878 | |
| 6879 | sys.version_info is a tuple (major, minor, micro, level, serial). |
| 6880 | |
| 6881 | Dictionaries have an odd new method, setdefault(key, default). |
| 6882 | dict.setdefault(key, default) returns dict[key] if it exists; if not, |
| 6883 | it sets dict[key] to default and returns that value. Thus: |
| 6884 | |
| 6885 | dict.setdefault(key, []).append(item) |
| 6886 | |
| 6887 | does the same work as this common idiom: |
| 6888 | |
| 6889 | if not dict.has_key(key): |
| 6890 | dict[key] = [] |
| 6891 | dict[key].append(item) |
| 6892 | |
| 6893 | There are two new variants of SyntaxError that are raised for |
| 6894 | indentation-related errors: IndentationError and TabError. |
| 6895 | |
| 6896 | Changed \x to consume exactly two hex digits; see PEP 223. Added \U |
| 6897 | escape that consumes exactly eight hex digits. |
| 6898 | |
| 6899 | The limits on the size of expressions and file in Python source code |
| 6900 | have been raised from 2**16 to 2**32. Previous versions of Python |
| 6901 | were limited because the maximum argument size the Python VM accepted |
| 6902 | was 2**16. This limited the size of object constructor expressions, |
| 6903 | e.g. [1,2,3] or {'a':1, 'b':2}, and the size of source files. This |
| 6904 | limit was raised thanks to a patch by Charles Waldman that effectively |
| 6905 | fixes the problem. It is now much more likely that you will be |
| 6906 | limited by available memory than by an arbitrary limit in Python. |
| 6907 | |
| 6908 | The interpreter's maximum recursion depth can be modified by Python |
| 6909 | programs using sys.getrecursionlimit and sys.setrecursionlimit. This |
| 6910 | limit is the maximum number of recursive calls that can be made by |
| 6911 | Python code. The limit exists to prevent infinite recursion from |
| 6912 | overflowing the C stack and causing a core dump. The default value is |
| 6913 | 1000. The maximum safe value for a particular platform can be found |
| 6914 | by running Misc/find_recursionlimit.py. |
| 6915 | |
| 6916 | New Modules and Packages |
| 6917 | ------------------------ |
| 6918 | |
| 6919 | atexit - for registering functions to be called when Python exits. |
| 6920 | |
| 6921 | imputil - Greg Stein's alternative API for writing custom import |
| 6922 | hooks. |
| 6923 | |
| 6924 | pyexpat - an interface to the Expat XML parser, contributed by Paul |
| 6925 | Prescod. |
| 6926 | |
| 6927 | xml - a new package with XML support code organized (so far) in three |
| 6928 | subpackages: xml.dom, xml.sax, and xml.parsers. Describing these |
| 6929 | would fill a volume. There's a special feature whereby a |
| 6930 | user-installed package named _xmlplus overrides the standard |
| 6931 | xmlpackage; this is intended to give the XML SIG a hook to distribute |
| 6932 | backwards-compatible updates to the standard xml package. |
| 6933 | |
| 6934 | webbrowser - a platform-independent API to launch a web browser. |
| 6935 | |
| 6936 | |
| 6937 | Changed Modules |
| 6938 | --------------- |
| 6939 | |
| 6940 | array -- new methods for array objects: count, extend, index, pop, and |
| 6941 | remove |
| 6942 | |
| 6943 | binascii -- new functions b2a_hex and a2b_hex that convert between |
| 6944 | binary data and its hex representation |
| 6945 | |
| 6946 | calendar -- Many new functions that support features including control |
| 6947 | over which day of the week is the first day, returning strings instead |
| 6948 | of printing them. Also new symbolic constants for days of week, |
| 6949 | e.g. MONDAY, ..., SUNDAY. |
| 6950 | |
| 6951 | cgi -- FieldStorage objects have a getvalue method that works like a |
| 6952 | dictionary's get method and returns the value attribute of the object. |
| 6953 | |
| 6954 | ConfigParser -- The parser object has new methods has_option, |
| 6955 | remove_section, remove_option, set, and write. They allow the module |
| 6956 | to be used for writing config files as well as reading them. |
| 6957 | |
| 6958 | ftplib -- ntransfercmd(), transfercmd(), and retrbinary() all now |
| 6959 | optionally support the RFC 959 REST command. |
| 6960 | |
| 6961 | gzip -- readline and readlines now accept optional size arguments |
| 6962 | |
| 6963 | httplib -- New interfaces and support for HTTP/1.1 by Greg Stein. See |
| 6964 | the module doc strings for details. |
| 6965 | |
| 6966 | locale -- implement getdefaultlocale for Win32 and Macintosh |
| 6967 | |
| 6968 | marshal -- no longer dumps core when marshaling deeply nested or |
| 6969 | recursive data structures |
| 6970 | |
| 6971 | os -- new functions isatty, seteuid, setegid, setreuid, setregid |
| 6972 | |
| 6973 | os/popen2 -- popen2/popen3/popen4 support under Windows. popen2/popen3 |
| 6974 | support under Unix. |
| 6975 | |
| 6976 | os/pty -- support for openpty and forkpty |
| 6977 | |
| 6978 | os.path -- fix semantics of os.path.commonprefix |
| 6979 | |
| 6980 | smtplib -- support for sending very long messages |
| 6981 | |
| 6982 | socket -- new function getfqdn() |
| 6983 | |
| 6984 | readline -- new functions to read, write and truncate history files. |
| 6985 | The readline section of the library reference manual contains an |
| 6986 | example. |
| 6987 | |
| 6988 | select -- add interface to poll system call |
| 6989 | |
| 6990 | shutil -- new copyfileobj function |
| 6991 | |
| 6992 | SimpleHTTPServer, CGIHTTPServer -- Fix problems with buffering in the |
| 6993 | HTTP server. |
| 6994 | |
| 6995 | Tkinter -- optimization of function flatten |
| 6996 | |
| 6997 | urllib -- scans environment variables for proxy configuration, |
| 6998 | e.g. http_proxy. |
| 6999 | |
| 7000 | whichdb -- recognizes dumbdbm format |
| 7001 | |
| 7002 | |
| 7003 | Obsolete Modules |
| 7004 | ---------------- |
| 7005 | |
| 7006 | None. However note that 1.6 made a whole slew of modules obsolete: |
| 7007 | stdwin, soundex, cml, cmpcache, dircache, dump, find, grep, packmail, |
| 7008 | poly, zmod, strop, util, whatsound. |
| 7009 | |
| 7010 | |
| 7011 | Changed, New, Obsolete Tools |
| 7012 | ---------------------------- |
| 7013 | |
| 7014 | None. |
| 7015 | |
| 7016 | |
| 7017 | C-level Changes |
| 7018 | --------------- |
| 7019 | |
| 7020 | Several cleanup jobs were carried out throughout the source code. |
| 7021 | |
| 7022 | All C code was converted to ANSI C; we got rid of all uses of the |
| 7023 | Py_PROTO() macro, which makes the header files a lot more readable. |
| 7024 | |
| 7025 | Most of the portability hacks were moved to a new header file, |
| 7026 | pyport.h; several other new header files were added and some old |
| 7027 | header files were removed, in an attempt to create a more rational set |
| 7028 | of header files. (Few of these ever need to be included explicitly; |
| 7029 | they are all included by Python.h.) |
| 7030 | |
| 7031 | Trent Mick ensured portability to 64-bit platforms, under both Linux |
| 7032 | and Win64, especially for the new Intel Itanium processor. Mick also |
| 7033 | added large file support for Linux64 and Win64. |
| 7034 | |
| 7035 | The C APIs to return an object's size have been update to consistently |
| 7036 | use the form PyXXX_Size, e.g. PySequence_Size and PyDict_Size. In |
| 7037 | previous versions, the abstract interfaces used PyXXX_Length and the |
| 7038 | concrete interfaces used PyXXX_Size. The old names, |
| 7039 | e.g. PyObject_Length, are still available for backwards compatibility |
| 7040 | at the API level, but are deprecated. |
| 7041 | |
| 7042 | The PyOS_CheckStack function has been implemented on Windows by |
| 7043 | Fredrik Lundh. It prevents Python from failing with a stack overflow |
| 7044 | on Windows. |
| 7045 | |
| 7046 | The GC changes resulted in creation of two new slots on object, |
| 7047 | tp_traverse and tp_clear. The augmented assignment changes result in |
| 7048 | the creation of a new slot for each in-place operator. |
| 7049 | |
| 7050 | The GC API creates new requirements for container types implemented in |
| 7051 | C extension modules. See Include/objimpl.h for details. |
| 7052 | |
| 7053 | PyErr_Format has been updated to automatically calculate the size of |
| 7054 | the buffer needed to hold the formatted result string. This change |
| 7055 | prevents crashes caused by programmer error. |
| 7056 | |
| 7057 | New C API calls: PyObject_AsFileDescriptor, PyErr_WriteUnraisable. |
| 7058 | |
| 7059 | PyRun_AnyFileEx, PyRun_SimpleFileEx, PyRun_FileEx -- New functions |
| 7060 | that are the same as their non-Ex counterparts except they take an |
| 7061 | extra flag argument that tells them to close the file when done. |
| 7062 | |
| 7063 | XXX There were other API changes that should be fleshed out here. |
| 7064 | |
| 7065 | |
| 7066 | Windows Changes |
| 7067 | --------------- |
| 7068 | |
| 7069 | New popen2/popen3/peopen4 in os module (see Changed Modules above). |
| 7070 | |
| 7071 | os.popen is much more usable on Windows 95 and 98. See Microsoft |
| 7072 | Knowledge Base article Q150956. The Win9x workaround described there |
| 7073 | is implemented by the new w9xpopen.exe helper in the root of your |
| 7074 | Python installation. Note that Python uses this internally; it is not |
| 7075 | a standalone program. |
| 7076 | |
| 7077 | Administrator privileges are no longer required to install Python |
| 7078 | on Windows NT or Windows 2000. If you have administrator privileges, |
| 7079 | Python's registry info will be written under HKEY_LOCAL_MACHINE. |
| 7080 | Otherwise the installer backs off to writing Python's registry info |
| 7081 | under HKEY_CURRENT_USER. The latter is sufficient for all "normal" |
| 7082 | uses of Python, but will prevent some advanced uses from working |
| 7083 | (for example, running a Python script as an NT service, or possibly |
| 7084 | from CGI). |
| 7085 | |
| 7086 | [This was new in 1.6] The installer no longer runs a separate Tcl/Tk |
| 7087 | installer; instead, it installs the needed Tcl/Tk files directly in the |
| 7088 | Python directory. If you already have a Tcl/Tk installation, this |
| 7089 | wastes some disk space (about 4 Megs) but avoids problems with |
| 7090 | conflicting Tcl/Tk installations, and makes it much easier for Python |
| 7091 | to ensure that Tcl/Tk can find all its files. |
| 7092 | |
| 7093 | [This was new in 1.6] The Windows installer now installs by default in |
| 7094 | \Python20\ on the default volume, instead of \Program Files\Python-2.0\. |
| 7095 | |
| 7096 | |
| 7097 | Updates to the changes between 1.5.2 and 1.6 |
| 7098 | -------------------------------------------- |
| 7099 | |
| 7100 | The 1.6 NEWS file can't be changed after the release is done, so here |
| 7101 | is some late-breaking news: |
| 7102 | |
| 7103 | New APIs in locale.py: normalize(), getdefaultlocale(), resetlocale(), |
| 7104 | and changes to getlocale() and setlocale(). |
| 7105 | |
| 7106 | The new module is now enabled per default. |
| 7107 | |
| 7108 | It is not true that the encodings codecs cannot be used for normal |
| 7109 | strings: the string.encode() (which is also present on 8-bit strings |
| 7110 | !) allows using them for 8-bit strings too, e.g. to convert files from |
| 7111 | cp1252 (Windows) to latin-1 or vice-versa. |
| 7112 | |
| 7113 | Japanese codecs are available from Tamito KAJIYAMA: |
| 7114 | http://pseudo.grad.sccs.chukyo-u.ac.jp/~kajiyama/python/ |
| 7115 | |
| 7116 | |
| 7117 | ====================================================================== |
| 7118 | |
| 7119 | |
Guido van Rossum | f2eac99 | 2000-09-04 17:24:24 +0000 | [diff] [blame] | 7120 | ======================================= |
| 7121 | ==> Release 1.6 (September 5, 2000) <== |
| 7122 | ======================================= |
| 7123 | |
Guido van Rossum | a598c93 | 2000-09-04 16:26:03 +0000 | [diff] [blame] | 7124 | What's new in release 1.6? |
| 7125 | ========================== |
| 7126 | |
| 7127 | Below is a list of all relevant changes since release 1.5.2. |
| 7128 | |
| 7129 | |
| 7130 | Source Incompatibilities |
| 7131 | ------------------------ |
| 7132 | |
| 7133 | Several small incompatible library changes may trip you up: |
| 7134 | |
| 7135 | - The append() method for lists can no longer be invoked with more |
| 7136 | than one argument. This used to append a single tuple made out of |
| 7137 | all arguments, but was undocumented. To append a tuple, use |
| 7138 | e.g. l.append((a, b, c)). |
| 7139 | |
| 7140 | - The connect(), connect_ex() and bind() methods for sockets require |
| 7141 | exactly one argument. Previously, you could call s.connect(host, |
| 7142 | port), but this was undocumented. You must now write |
| 7143 | s.connect((host, port)). |
| 7144 | |
| 7145 | - The str() and repr() functions are now different more often. For |
| 7146 | long integers, str() no longer appends a 'L'. Thus, str(1L) == '1', |
| 7147 | which used to be '1L'; repr(1L) is unchanged and still returns '1L'. |
| 7148 | For floats, repr() now gives 17 digits of precision, to ensure no |
| 7149 | precision is lost (on all current hardware). |
| 7150 | |
| 7151 | - The -X option is gone. Built-in exceptions are now always |
| 7152 | classes. Many more library modules also have been converted to |
| 7153 | class-based exceptions. |
| 7154 | |
| 7155 | |
| 7156 | Binary Incompatibilities |
| 7157 | ------------------------ |
| 7158 | |
| 7159 | - Third party extensions built for Python 1.5.x cannot be used with |
| 7160 | Python 1.6; these extensions will have to be rebuilt for Python 1.6. |
| 7161 | |
| 7162 | - On Windows, attempting to import a third party extension built for |
| 7163 | Python 1.5.x results in an immediate crash; there's not much we can do |
| 7164 | about this. Check your PYTHONPATH environment variable! |
| 7165 | |
| 7166 | |
| 7167 | Overview of Changes since 1.5.2 |
| 7168 | ------------------------------- |
| 7169 | |
| 7170 | For this overview, I have borrowed from the document "What's New in |
| 7171 | Python 2.0" by Andrew Kuchling and Moshe Zadka: |
Andrew M. Kuchling | e240d9b | 2004-03-21 18:48:22 +0000 | [diff] [blame] | 7172 | http://www.amk.ca/python/2.0/ . |
Guido van Rossum | a598c93 | 2000-09-04 16:26:03 +0000 | [diff] [blame] | 7173 | |
| 7174 | There are lots of new modules and lots of bugs have been fixed. A |
| 7175 | list of all new modules is included below. |
| 7176 | |
| 7177 | Probably the most pervasive change is the addition of Unicode support. |
| 7178 | We've added a new fundamental datatype, the Unicode string, a new |
| 7179 | build-in function unicode(), an numerous C APIs to deal with Unicode |
| 7180 | and encodings. See the file Misc/unicode.txt for details, or |
| 7181 | http://starship.python.net/crew/lemburg/unicode-proposal.txt. |
| 7182 | |
| 7183 | Two other big changes, related to the Unicode support, are the |
| 7184 | addition of string methods and (yet another) new regular expression |
| 7185 | engine. |
| 7186 | |
| 7187 | - String methods mean that you can now say s.lower() etc. instead of |
| 7188 | importing the string module and saying string.lower(s) etc. One |
| 7189 | peculiarity is that the equivalent of string.join(sequence, |
| 7190 | delimiter) is delimiter.join(sequence). Use " ".join(sequence) for |
| 7191 | the effect of string.join(sequence); to make this more readable, try |
| 7192 | space=" " first. Note that the maxsplit argument defaults in |
| 7193 | split() and replace() have changed from 0 to -1. |
| 7194 | |
| 7195 | - The new regular expression engine, SRE by Fredrik Lundh, is fully |
| 7196 | backwards compatible with the old engine, and is in fact invoked |
| 7197 | using the same interface (the "re" module). You can explicitly |
| 7198 | invoke the old engine by import pre, or the SRE engine by importing |
| 7199 | sre. SRE is faster than pre, and supports Unicode (which was the |
| 7200 | main reason to put effort in yet another new regular expression |
| 7201 | engine -- this is at least the fourth!). |
| 7202 | |
| 7203 | |
| 7204 | Other Changes |
| 7205 | ------------- |
| 7206 | |
| 7207 | Other changes that won't break code but are nice to know about: |
| 7208 | |
| 7209 | Deleting objects is now safe even for deeply nested data structures. |
| 7210 | |
| 7211 | Long/int unifications: long integers can be used in seek() calls, as |
| 7212 | slice indexes. |
| 7213 | |
| 7214 | String formatting (s % args) has a new formatting option, '%r', which |
| 7215 | acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in |
| 7216 | alpha 1.) |
| 7217 | |
| 7218 | Greg Ward's "distutils" package is included: this will make |
| 7219 | installing, building and distributing third party packages much |
| 7220 | simpler. |
| 7221 | |
| 7222 | There's now special syntax that you can use instead of the apply() |
| 7223 | function. f(*args, **kwds) is equivalent to apply(f, args, kwds). |
| 7224 | You can also use variations f(a1, a2, *args, **kwds) and you can leave |
| 7225 | one or the other out: f(*args), f(**kwds). |
| 7226 | |
| 7227 | The built-ins int() and long() take an optional second argument to |
| 7228 | indicate the conversion base -- of course only if the first argument |
| 7229 | is a string. This makes string.atoi() and string.atol() obsolete. |
| 7230 | (string.atof() was already obsolete). |
| 7231 | |
| 7232 | When a local variable is known to the compiler but undefined when |
| 7233 | used, a new exception UnboundLocalError is raised. This is a class |
| 7234 | derived from NameError so code catching NameError should still work. |
| 7235 | The purpose is to provide better diagnostics in the following example: |
| 7236 | x = 1 |
| 7237 | def f(): |
| 7238 | print x |
| 7239 | x = x+1 |
| 7240 | This used to raise a NameError on the print statement, which confused |
| 7241 | even experienced Python programmers (especially if there are several |
| 7242 | hundreds of lines of code between the reference and the assignment to |
| 7243 | x :-). |
| 7244 | |
| 7245 | You can now override the 'in' operator by defining a __contains__ |
| 7246 | method. Note that it has its arguments backwards: x in a causes |
| 7247 | a.__contains__(x) to be called. That's why the name isn't __in__. |
| 7248 | |
| 7249 | The exception AttributeError will have a more friendly error message, |
| 7250 | e.g.: <code>'Spam' instance has no attribute 'eggs'</code>. This may |
| 7251 | <b>break code</b> that expects the message to be exactly the attribute |
| 7252 | name. |
| 7253 | |
| 7254 | |
| 7255 | New Modules in 1.6 |
| 7256 | ------------------ |
| 7257 | |
| 7258 | UserString - base class for deriving from the string type. |
| 7259 | |
| 7260 | distutils - tools for distributing Python modules. |
| 7261 | |
| 7262 | robotparser - parse a robots.txt file, for writing web spiders. |
| 7263 | (Moved from Tools/webchecker/.) |
| 7264 | |
| 7265 | linuxaudiodev - audio for Linux. |
| 7266 | |
| 7267 | mmap - treat a file as a memory buffer. (Windows and Unix.) |
| 7268 | |
| 7269 | sre - regular expressions (fast, supports unicode). Currently, this |
| 7270 | code is very rough. Eventually, the re module will be reimplemented |
| 7271 | using sre (without changes to the re API). |
| 7272 | |
| 7273 | filecmp - supersedes the old cmp.py and dircmp.py modules. |
| 7274 | |
| 7275 | tabnanny - check Python sources for tab-width dependance. (Moved from |
| 7276 | Tools/scripts/.) |
| 7277 | |
| 7278 | urllib2 - new and improved but incompatible version of urllib (still |
| 7279 | experimental). |
| 7280 | |
| 7281 | zipfile - read and write zip archives. |
| 7282 | |
| 7283 | codecs - support for Unicode encoders/decoders. |
| 7284 | |
| 7285 | unicodedata - provides access to the Unicode 3.0 database. |
| 7286 | |
| 7287 | _winreg - Windows registry access. |
| 7288 | |
| 7289 | encodings - package which provides a large set of standard codecs -- |
| 7290 | currently only for the new Unicode support. It has a drop-in extension |
| 7291 | mechanism which allows you to add new codecs by simply copying them |
| 7292 | into the encodings package directory. Asian codec support will |
| 7293 | probably be made available as separate distribution package built upon |
| 7294 | this technique and the new distutils package. |
| 7295 | |
| 7296 | |
| 7297 | Changed Modules |
| 7298 | --------------- |
| 7299 | |
| 7300 | readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc, |
| 7301 | chunk, wave, random, shelve, nntplib - minor enhancements. |
| 7302 | |
| 7303 | socket, httplib, urllib - optional OpenSSL support (Unix only). |
| 7304 | |
| 7305 | _tkinter - support for 8.0 up to 8.3. Support for versions older than |
| 7306 | 8.0 has been dropped. |
| 7307 | |
| 7308 | string - most of this module is deprecated now that strings have |
| 7309 | methods. This no longer uses the built-in strop module, but takes |
| 7310 | advantage of the new string methods to provide transparent support for |
| 7311 | both Unicode and ordinary strings. |
| 7312 | |
| 7313 | |
| 7314 | Changes on Windows |
| 7315 | ------------------ |
| 7316 | |
| 7317 | The installer no longer runs a separate Tcl/Tk installer; instead, it |
| 7318 | installs the needed Tcl/Tk files directly in the Python directory. If |
| 7319 | you already have a Tcl/Tk installation, this wastes some disk space |
| 7320 | (about 4 Megs) but avoids problems with conflincting Tcl/Tk |
| 7321 | installations, and makes it much easier for Python to ensure that |
| 7322 | Tcl/Tk can find all its files. Note: the alpha installers don't |
| 7323 | include the documentation. |
| 7324 | |
| 7325 | The Windows installer now installs by default in \Python16\ on the |
| 7326 | default volume, instead of \Program Files\Python-1.6\. |
| 7327 | |
| 7328 | |
| 7329 | Changed Tools |
| 7330 | ------------- |
| 7331 | |
| 7332 | IDLE - complete overhaul. See the <a href="../idle/">IDLE home |
| 7333 | page</a> for more information. (Python 1.6 alpha 1 will come with |
| 7334 | IDLE 0.6.) |
| 7335 | |
| 7336 | Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message |
| 7337 | text extraction tool used for internationalizing applications written |
| 7338 | in Python. |
| 7339 | |
| 7340 | |
| 7341 | Obsolete Modules |
| 7342 | ---------------- |
| 7343 | |
| 7344 | stdwin and everything that uses it. (Get Python 1.5.2 if you need |
| 7345 | it. :-) |
| 7346 | |
| 7347 | soundex. (Skip Montanaro has a version in Python but it won't be |
| 7348 | included in the Python release.) |
| 7349 | |
| 7350 | cmp, cmpcache, dircmp. (Replaced by filecmp.) |
| 7351 | |
| 7352 | dump. (Use pickle.) |
| 7353 | |
| 7354 | find. (Easily coded using os.walk().) |
| 7355 | |
| 7356 | grep. (Not very useful as a library module.) |
| 7357 | |
| 7358 | packmail. (No longer has any use.) |
| 7359 | |
| 7360 | poly, zmod. (These were poor examples at best.) |
| 7361 | |
| 7362 | strop. (No longer needed by the string module.) |
| 7363 | |
| 7364 | util. (This functionality was long ago built in elsewhere). |
| 7365 | |
| 7366 | whatsound. (Use sndhdr.) |
| 7367 | |
| 7368 | |
| 7369 | Detailed Changes from 1.6b1 to 1.6 |
| 7370 | ---------------------------------- |
| 7371 | |
| 7372 | - Slight changes to the CNRI license. A copyright notice has been |
| 7373 | added; the requirement to indicate the nature of modifications now |
| 7374 | applies when making a derivative work available "to others" instead of |
| 7375 | just "to the public"; the version and date are updated. The new |
| 7376 | license has a new handle. |
| 7377 | |
| 7378 | - Added the Tools/compiler package. This is a project led by Jeremy |
| 7379 | Hylton to write the Python bytecode generator in Python. |
| 7380 | |
| 7381 | - The function math.rint() is removed. |
| 7382 | |
| 7383 | - In Python.h, "#define _GNU_SOURCE 1" was added. |
| 7384 | |
| 7385 | - Version 0.9.1 of Greg Ward's distutils is included (instead of |
| 7386 | version 0.9). |
| 7387 | |
| 7388 | - A new version of SRE is included. It is more stable, and more |
| 7389 | compatible with the old RE module. Non-matching ranges are indicated |
| 7390 | by -1, not None. (The documentation said None, but the PRE |
| 7391 | implementation used -1; changing to None would break existing code.) |
| 7392 | |
| 7393 | - The winreg module has been renamed to _winreg. (There are plans for |
| 7394 | a higher-level API called winreg, but this has not yet materialized in |
| 7395 | a form that is acceptable to the experts.) |
| 7396 | |
| 7397 | - The _locale module is enabled by default. |
| 7398 | |
| 7399 | - Fixed the configuration line for the _curses module. |
| 7400 | |
| 7401 | - A few crashes have been fixed, notably <file>.writelines() with a |
| 7402 | list containing non-string objects would crash, and there were |
| 7403 | situations where a lost SyntaxError could dump core. |
| 7404 | |
| 7405 | - The <list>.extend() method now accepts an arbitrary sequence |
| 7406 | argument. |
| 7407 | |
| 7408 | - If __str__() or __repr__() returns a Unicode object, this is |
| 7409 | converted to an 8-bit string. |
| 7410 | |
| 7411 | - Unicode string comparisons is no longer aware of UTF-16 |
| 7412 | encoding peculiarities; it's a straight 16-bit compare. |
| 7413 | |
| 7414 | - The Windows installer now installs the LICENSE file and no longer |
| 7415 | registers the Python DLL version in the registry (this is no longer |
| 7416 | needed). It now uses Tcl/Tk 8.3.2. |
| 7417 | |
| 7418 | - A few portability problems have been fixed, in particular a |
| 7419 | compilation error involving socklen_t. |
| 7420 | |
| 7421 | - The PC configuration is slightly friendlier to non-Microsoft |
| 7422 | compilers. |
| 7423 | |
| 7424 | |
| 7425 | ====================================================================== |
| 7426 | |
| 7427 | |
Guido van Rossum | f2eac99 | 2000-09-04 17:24:24 +0000 | [diff] [blame] | 7428 | ====================================== |
| 7429 | ==> Release 1.5.2 (April 13, 1999) <== |
| 7430 | ====================================== |
| 7431 | |
Guido van Rossum | 2001da4 | 2000-09-01 22:26:44 +0000 | [diff] [blame] | 7432 | From 1.5.2c1 to 1.5.2 (final) |
| 7433 | ============================= |
| 7434 | |
| 7435 | Tue Apr 13 15:44:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7436 | |
| 7437 | * PCbuild/python15.wse: Bump version to 1.5.2 (final) |
| 7438 | |
| 7439 | * PCbuild/python15.dsp: Added shamodule.c |
| 7440 | |
| 7441 | * PC/config.c: Added sha module! |
| 7442 | |
| 7443 | * README, Include/patchlevel.h: Prepare for final release. |
| 7444 | |
| 7445 | * Misc/ACKS: |
| 7446 | More (Cameron Laird is honorary; the others are 1.5.2c1 testers). |
| 7447 | |
| 7448 | * Python/thread_solaris.h: |
| 7449 | While I can't really test this thoroughly, Pat Knight and the Solaris |
| 7450 | man pages suggest that the proper thing to do is to add THR_NEW_LWP to |
| 7451 | the flags on thr_create(), and that there really isn't a downside, so |
| 7452 | I'll do that. |
| 7453 | |
| 7454 | * Misc/ACKS: |
| 7455 | Bunch of new names who helped iron out the last wrinkles of 1.5.2. |
| 7456 | |
| 7457 | * PC/python_nt.rc: |
| 7458 | Bump the myusterious M$ version number from 1,5,2,1 to 1,5,2,3. |
| 7459 | (I can't even display this on NT, maybe Win/98 can?) |
| 7460 | |
| 7461 | * Lib/pstats.py: |
| 7462 | Fix mysterious references to jprofile that were in the source since |
| 7463 | its creation. I'm assuming these were once valid references to "Jim |
| 7464 | Roskind's profile"... |
| 7465 | |
| 7466 | * Lib/Attic/threading_api.py: |
| 7467 | Removed; since long subsumed in Doc/lib/libthreading.tex |
| 7468 | |
| 7469 | * Modules/socketmodule.c: |
| 7470 | Put back __osf__ support for gethostbyname_r(); the real bug was that |
| 7471 | it was being used even without threads. This of course might be an |
| 7472 | all-platform problem so now we only use the _r variant when we are |
| 7473 | using threads. |
| 7474 | |
| 7475 | Mon Apr 12 22:51:20 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7476 | |
| 7477 | * Modules/cPickle.c: |
| 7478 | Fix accidentally reversed NULL test in load_mark(). Suggested by |
| 7479 | Tamito Kajiyama. (This caused a bug only on platforms where malloc(0) |
| 7480 | returns NULL.) |
| 7481 | |
| 7482 | * README: |
| 7483 | Add note about popen2 problem on Linux noticed by Pablo Bleyer. |
| 7484 | |
| 7485 | * README: Add note about -D_REENTRANT for HP-UX 10.20. |
| 7486 | |
| 7487 | * Modules/Makefile.pre.in: 'clean' target should remove hassignal. |
| 7488 | |
| 7489 | * PC/Attic/vc40.mak, PC/readme.txt: |
| 7490 | Remove all VC++ info (except VC 1.5) from readme.txt; |
| 7491 | remove the VC++ 4.0 project file; remove the unused _tkinter extern defs. |
| 7492 | |
| 7493 | * README: Clarify PC build instructions (point to PCbuild). |
| 7494 | |
| 7495 | * Modules/zlibmodule.c: Cast added by Jack Jansen (for Mac port). |
| 7496 | |
| 7497 | * Lib/plat-sunos5/CDIO.py, Lib/plat-linux2/CDROM.py: |
| 7498 | Forgot to add this file. CDROM device parameters. |
| 7499 | |
| 7500 | * Lib/gzip.py: Two different changes. |
| 7501 | |
| 7502 | 1. Jack Jansen reports that on the Mac, the time may be negative, and |
| 7503 | solves this by adding a write32u() function that writes an unsigned |
| 7504 | long. |
| 7505 | |
| 7506 | 2. On 64-bit platforms the CRC comparison fails; I've fixed this by |
| 7507 | casting both values to be compared to "unsigned long" i.e. modulo |
| 7508 | 0x100000000L. |
| 7509 | |
| 7510 | Sat Apr 10 18:42:02 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7511 | |
| 7512 | * PC/Attic/_tkinter.def: No longer needed. |
| 7513 | |
| 7514 | * Misc/ACKS: Correct missed character in Andrew Dalke's name. |
| 7515 | |
| 7516 | * README: Add DEC Ultrix notes (from Donn Cave's email). |
| 7517 | |
| 7518 | * configure: The usual |
| 7519 | |
| 7520 | * configure.in: |
| 7521 | Quote a bunch of shell variables used in test, related to long-long. |
| 7522 | |
| 7523 | * Objects/fileobject.c, Modules/shamodule.c, Modules/regexpr.c: |
| 7524 | casts for picky compilers. |
| 7525 | |
| 7526 | * Modules/socketmodule.c: |
| 7527 | 3-arg gethostbyname_r doesn't really work on OSF/1. |
| 7528 | |
| 7529 | * PC/vc15_w31/_.c, PC/vc15_lib/_.c, Tools/pynche/__init__.py: |
| 7530 | Avoid totally empty files. |
| 7531 | |
| 7532 | Fri Apr 9 14:56:35 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7533 | |
| 7534 | * Tools/scripts/fixps.py: Use re instead of regex. |
| 7535 | Don't rewrite the file in place. |
| 7536 | (Reported by Andy Dustman.) |
| 7537 | |
| 7538 | * Lib/netrc.py, Lib/shlex.py: Get rid of #! line |
| 7539 | |
| 7540 | Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7541 | |
| 7542 | * PCbuild/python15.wse: Use the Tcl 8.0.5 installer. |
| 7543 | Add a variable %_TCL_% that makes it easier to switch to a different version. |
| 7544 | |
| 7545 | |
| 7546 | ====================================================================== |
| 7547 | |
| 7548 | |
| 7549 | From 1.5.2b2 to 1.5.2c1 |
| 7550 | ======================= |
| 7551 | |
| 7552 | Thu Apr 8 23:13:37 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7553 | |
| 7554 | * PCbuild/python15.wse: |
| 7555 | Release 1.5.2c1. Add IDLE and Uninstall to program group. |
| 7556 | Don't distribute zlib.dll. Tweak some comments. |
| 7557 | |
| 7558 | * PCbuild/zlib.dsp: Now using static zlib 1.1.3 |
| 7559 | |
| 7560 | * 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: |
| 7561 | The usual |
| 7562 | |
| 7563 | * Include/patchlevel.h: Release 1.5.2c1 |
| 7564 | |
| 7565 | * README: Release 1.5.2c1. |
| 7566 | |
| 7567 | * Misc/NEWS: News for the 1.5.2c1 release. |
| 7568 | |
| 7569 | * Lib/test/test_strftime.py: |
| 7570 | On Windows, we suddenly find, strftime() may return "" for an |
| 7571 | unsupported format string. (I guess this is because the logic for |
| 7572 | deciding whether to reallocate the buffer or not has been improved.) |
| 7573 | This caused the test code to crash on result[0]. Fix this by assuming |
| 7574 | an empty result also means the format is not supported. |
| 7575 | |
| 7576 | * Demo/tkinter/matt/window-creation-w-location.py: |
| 7577 | This demo imported some private code from Matt. Make it cripple along. |
| 7578 | |
| 7579 | * Lib/lib-tk/Tkinter.py: |
| 7580 | Delete an accidentally checked-in feature that actually broke more |
| 7581 | than was worth it: when deleting a canvas item, it would try to |
| 7582 | automatically delete the bindings for that item. Since there's |
| 7583 | nothing that says you can't reuse the tag and still have the bindings, |
| 7584 | this is not correct. Also, it broke at least one demo |
| 7585 | (Demo/tkinter/matt/rubber-band-box-demo-1.py). |
| 7586 | |
| 7587 | * Python/thread_wince.h: Win/CE thread support by Mark Hammond. |
| 7588 | |
| 7589 | Wed Apr 7 20:23:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7590 | |
| 7591 | * Modules/zlibmodule.c: |
| 7592 | Patch by Andrew Kuchling to unflush() (flush() for deflating). |
| 7593 | Without this, if inflate() returned Z_BUF_ERROR asking for more output |
| 7594 | space, we would report the error; now, we increase the buffer size and |
| 7595 | try again, just as for Z_OK. |
| 7596 | |
| 7597 | * Lib/test/test_gzip.py: Use binary mode for all gzip files we open. |
| 7598 | |
| 7599 | * Tools/idle/ChangeLog: New change log. |
| 7600 | |
| 7601 | * Tools/idle/README.txt, Tools/idle/NEWS.txt: New version. |
| 7602 | |
| 7603 | * Python/pythonrun.c: |
| 7604 | Alas, get rid of the Win specific hack to ask the user to press Return |
| 7605 | before exiting when an error happened. This didn't work right when |
| 7606 | Python is invoked from a daemon. |
| 7607 | |
| 7608 | * Tools/idle/idlever.py: Version bump awaiting impending new release. |
| 7609 | (Not much has changed :-( ) |
| 7610 | |
| 7611 | * Lib/lib-tk/Tkinter.py: |
| 7612 | lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift, |
| 7613 | so the preferred name for them is tag_lower, tag_raise |
| 7614 | (similar to tag_bind, and similar to the Text widget); |
| 7615 | unfortunately can't delete the old ones yet (maybe in 1.6) |
| 7616 | |
| 7617 | * Python/thread.c, Python/strtod.c, Python/mystrtoul.c, Python/import.c, Python/ceval.c: |
| 7618 | Changes by Mark Hammond for Windows CE. Mostly of the form |
| 7619 | #ifdef DONT_HAVE_header_H ... #endif around #include <header.h>. |
| 7620 | |
| 7621 | * Python/bltinmodule.c: |
| 7622 | Remove unused variable from complex_from_string() code. |
| 7623 | |
| 7624 | * Include/patchlevel.h: |
| 7625 | Add the possibility of a gamma release (release candidate). |
| 7626 | Add '+' to string version number to indicate we're beyond b2 now. |
| 7627 | |
| 7628 | * Modules/posixmodule.c: Add extern decl for fsync() for SunOS 4.x. |
| 7629 | |
| 7630 | * Lib/smtplib.py: Changes by Per Cederquist and The Dragon. |
| 7631 | |
| 7632 | Per writes: |
| 7633 | |
| 7634 | """ |
| 7635 | The application where Signum Support uses smtplib needs to be able to |
| 7636 | report good error messages to the user when sending email fails. To |
| 7637 | help in diagnosing problems it is useful to be able to report the |
| 7638 | entire message sent by the server, not only the SMTP error code of the |
| 7639 | offending command. |
| 7640 | |
| 7641 | A lot of the functions in sendmail.py unfortunately discards the |
| 7642 | message, leaving only the code. The enclosed patch fixes that |
| 7643 | problem. |
| 7644 | |
| 7645 | The enclosed patch also introduces a base class for exceptions that |
| 7646 | include an SMTP error code and error message, and make the code and |
| 7647 | message available on separate attributes, so that surrounding code can |
| 7648 | deal with them in whatever way it sees fit. I've also added some |
| 7649 | documentation to the exception classes. |
| 7650 | |
| 7651 | The constructor will now raise an exception if it cannot connect to |
| 7652 | the SMTP server. |
| 7653 | |
| 7654 | The data() method will raise an SMTPDataError if it doesn't receive |
| 7655 | the expected 354 code in the middle of the exchange. |
| 7656 | |
| 7657 | According to section 5.2.10 of RFC 1123 a smtp client must accept "any |
| 7658 | text, including no text at all" after the error code. If the response |
| 7659 | of a HELO command contains no text self.helo_resp will be set to the |
| 7660 | empty string (""). The patch fixes the test in the sendmail() method |
| 7661 | so that helo_resp is tested against None; if it has the empty string |
| 7662 | as value the sendmail() method would invoke the helo() method again. |
| 7663 | |
| 7664 | The code no longer accepts a -1 reply from the ehlo() method in |
| 7665 | sendmail(). |
| 7666 | |
| 7667 | [Text about removing SMTPRecipientsRefused deleted --GvR] |
| 7668 | """ |
| 7669 | |
| 7670 | and also: |
| 7671 | |
| 7672 | """ |
| 7673 | smtplib.py appends an extra blank line to the outgoing mail if the |
| 7674 | `msg' argument to the sendmail method already contains a trailing |
| 7675 | newline. This patch should fix the problem. |
| 7676 | """ |
| 7677 | |
| 7678 | The Dragon writes: |
| 7679 | |
| 7680 | """ |
| 7681 | Mostly I just re-added the SMTPRecipientsRefused exception |
| 7682 | (the exeption object now has the appropriate info in it ) [Per had |
| 7683 | removed this in his patch --GvR] and tweaked the behavior of the |
| 7684 | sendmail method whence it throws the newly added SMTPHeloException (it |
| 7685 | was closing the connection, which it shouldn't. whatever catches the |
| 7686 | exception should do that. ) |
| 7687 | |
| 7688 | I pondered the change of the return values to tuples all around, |
| 7689 | and after some thinking I decided that regularizing the return values was |
| 7690 | too much of the Right Thing (tm) to not do. |
| 7691 | |
| 7692 | My one concern is that code expecting an integer & getting a tuple |
| 7693 | may fail silently. |
| 7694 | |
| 7695 | (i.e. if it's doing : |
| 7696 | |
| 7697 | x.somemethod() >= 400: |
| 7698 | expecting an integer, the expression will always be true if it gets a |
| 7699 | tuple instead. ) |
| 7700 | |
| 7701 | However, most smtplib code I've seen only really uses the |
| 7702 | sendmail() method, so this wouldn't bother it. Usually code I've seen |
| 7703 | that calls the other methods usually only calls helo() and ehlo() for |
| 7704 | doing ESMTP, a feature which was not in the smtplib included with 1.5.1, |
| 7705 | and thus I would think not much code uses it yet. |
| 7706 | """ |
| 7707 | |
| 7708 | Tue Apr 6 19:38:18 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7709 | |
| 7710 | * Lib/test/test_ntpath.py: |
| 7711 | Fix the tests now that splitdrive() no longer treats UNC paths special. |
| 7712 | (Some tests converted to splitunc() tests.) |
| 7713 | |
| 7714 | * Lib/ntpath.py: |
| 7715 | Withdraw the UNC support from splitdrive(). Instead, a new function |
| 7716 | splitunc() parses UNC paths. The contributor of the UNC parsing in |
| 7717 | splitdrive() doesn't like it, but I haven't heard a good reason to |
| 7718 | keep it, and it causes some problems. (I think there's a |
| 7719 | philosophical problem -- to me, the split*() functions are purely |
| 7720 | syntactical, and the fact that \\foo is not a valid path doesn't mean |
| 7721 | that it shouldn't be considered an absolute path.) |
| 7722 | |
| 7723 | Also (quite separately, but strangely related to the philosophical |
| 7724 | issue above) fix abspath() so that if win32api exists, it doesn't fail |
| 7725 | when the path doesn't actually exist -- if GetFullPathName() fails, |
| 7726 | fall back on the old strategy (join with getcwd() if neccessary, and |
| 7727 | then use normpath()). |
| 7728 | |
| 7729 | * configure.in, configure, config.h.in, acconfig.h: |
| 7730 | For BeOS PowerPC. Chris Herborth. |
| 7731 | |
| 7732 | Mon Apr 5 21:54:14 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7733 | |
| 7734 | * Modules/timemodule.c: |
| 7735 | Jonathan Giddy notes, and Chris Lawrence agrees, that some comments on |
| 7736 | #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef. |
| 7737 | |
| 7738 | * Misc/ACKS: |
| 7739 | Bunch of new contributors, including 9 who contributed to the Docs, |
| 7740 | reported by Fred. |
| 7741 | |
| 7742 | Mon Apr 5 18:37:59 1999 Fred Drake <fdrake@eric.cnri.reston.va.us> |
| 7743 | |
| 7744 | * Lib/gzip.py: |
| 7745 | Oops, missed mode parameter to open(). |
| 7746 | |
| 7747 | * Lib/gzip.py: |
| 7748 | Made the default mode 'rb' instead of 'r', for better cross-platform |
| 7749 | support. (Based on comment on the documentation by Bernhard Reiter |
| 7750 | <bernhard@csd.uwm.edu>). |
| 7751 | |
| 7752 | Fri Apr 2 22:18:25 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7753 | |
| 7754 | * Tools/scripts/dutree.py: |
| 7755 | For reasons I dare not explain, this script should always execute |
| 7756 | main() when imported (in other words, it is not usable as a module). |
| 7757 | |
| 7758 | Thu Apr 1 15:32:30 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7759 | |
| 7760 | * Lib/test/test_cpickle.py: Jonathan Giddy write: |
| 7761 | |
| 7762 | In test_cpickle.py, the module os got imported, but the line to remove |
| 7763 | the temp file has gone missing. |
| 7764 | |
| 7765 | Tue Mar 30 20:17:31 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7766 | |
| 7767 | * Lib/BaseHTTPServer.py: Per Cederqvist writes: |
| 7768 | |
| 7769 | If you send something like "PUT / HTTP/1.0" to something derived from |
| 7770 | BaseHTTPServer that doesn't define do_PUT, you will get a response |
| 7771 | that begins like this: |
| 7772 | |
| 7773 | HTTP/1.0 501 Unsupported method ('do_PUT') |
| 7774 | Server: SimpleHTTP/0.3 Python/1.5 |
| 7775 | Date: Tue, 30 Mar 1999 18:53:53 GMT |
| 7776 | |
| 7777 | The server should complain about 'PUT' instead of 'do_PUT'. This |
| 7778 | patch should fix the problem. |
| 7779 | |
| 7780 | Mon Mar 29 20:33:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7781 | |
| 7782 | * Lib/smtplib.py: Patch by Per Cederqvist, who writes: |
| 7783 | |
| 7784 | """ |
| 7785 | - It needlessly used the makefile() method for each response that is |
| 7786 | read from the SMTP server. |
| 7787 | |
| 7788 | - If the remote SMTP server closes the connection unexpectedly the |
| 7789 | code raised an IndexError. It now raises an SMTPServerDisconnected |
| 7790 | exception instead. |
| 7791 | |
| 7792 | - The code now checks that all lines in a multiline response actually |
| 7793 | contains an error code. |
| 7794 | """ |
| 7795 | |
| 7796 | The Dragon approves. |
| 7797 | |
| 7798 | Mon Mar 29 20:25:40 1999 Fred Drake <fdrake@eric.cnri.reston.va.us> |
| 7799 | |
| 7800 | * Lib/compileall.py: |
| 7801 | When run as a script, report failures in the exit code as well. |
| 7802 | Patch largely based on changes by Andrew Dalke, as discussed in the |
| 7803 | distutils-sig. |
| 7804 | |
| 7805 | Mon Mar 29 20:23:41 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7806 | |
| 7807 | * Lib/urllib.py: |
| 7808 | Hack so that if a 302 or 301 redirect contains a relative URL, the |
| 7809 | right thing "just happens" (basejoin() with old URL). |
| 7810 | |
| 7811 | * Modules/cPickle.c: |
| 7812 | Protection against picling to/from closed (real) file. |
| 7813 | The problem was reported by Moshe Zadka. |
| 7814 | |
| 7815 | * Lib/test/test_cpickle.py: |
| 7816 | Test protection against picling to/from closed (real) file. |
| 7817 | |
| 7818 | * Modules/timemodule.c: Chris Lawrence writes: |
| 7819 | |
| 7820 | """ |
| 7821 | The GNU folks, in their infinite wisdom, have decided not to implement |
| 7822 | altzone in libc6; this would not be horrible, except that timezone |
| 7823 | (which is implemented) includes the current DST setting (i.e. timezone |
| 7824 | for Central is 18000 in summer and 21600 in winter). So Python's |
| 7825 | timezone and altzone variables aren't set correctly during DST. |
| 7826 | |
| 7827 | Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone |
| 7828 | show the "right" thing on Linux (by using the tm_gmtoff stuff |
| 7829 | available in BSD, which is how the GLIBC manual claims things should |
| 7830 | be done) and (b) should cope with the southern hemisphere. In pursuit |
| 7831 | of (b), I also took the liberty of renaming the "summer" and "winter" |
| 7832 | variables to "july" and "jan". This patch should also make certain |
| 7833 | time calculations on Linux actually work right (like the tz-aware |
| 7834 | functions in the rfc822 module). |
| 7835 | |
| 7836 | (It's hard to find DST that's currently being used in the southern |
| 7837 | hemisphere; I tested using Africa/Windhoek.) |
| 7838 | """ |
| 7839 | |
| 7840 | * Lib/test/output/test_gzip: |
| 7841 | Jonathan Giddy discovered this file was missing. |
| 7842 | |
| 7843 | * Modules/shamodule.c: |
| 7844 | Avoid warnings from AIX compiler. Reported by Vladimir (AIX is my |
| 7845 | middlename) Marangozov, patch coded by Greg Stein. |
| 7846 | |
| 7847 | * Tools/idle/ScriptBinding.py, Tools/idle/PyShell.py: |
| 7848 | At Tim Peters' recommendation, add a dummy flush() method to PseudoFile. |
| 7849 | |
| 7850 | Sun Mar 28 17:55:32 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7851 | |
| 7852 | * Tools/scripts/ndiff.py: Tim Peters writes: |
| 7853 | |
| 7854 | I should have waited overnight <wink/sigh>. Nothing wrong with the one I |
| 7855 | sent, but I couldn't resist going on to add new -r1 / -r2 cmdline options |
| 7856 | for recreating the original files from ndiff's output. That's attached, if |
| 7857 | you're game! Us Windows guys don't usually have a sed sitting around |
| 7858 | <wink>. |
| 7859 | |
| 7860 | Sat Mar 27 13:34:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7861 | |
| 7862 | * Tools/scripts/ndiff.py: Tim Peters writes: |
| 7863 | |
| 7864 | Attached is a cleaned-up version of ndiff (added useful module |
| 7865 | docstring, now echo'ed in case of cmd line mistake); added -q option |
| 7866 | to suppress initial file identification lines; + other minor cleanups, |
| 7867 | & a slightly faster match engine. |
| 7868 | |
| 7869 | Fri Mar 26 22:36:00 1999 Fred Drake <fdrake@eric.cnri.reston.va.us> |
| 7870 | |
| 7871 | * Tools/scripts/dutree.py: |
| 7872 | During display, if EPIPE is raised, it's probably because a pager was |
| 7873 | killed. Discard the error in that case, but propogate it otherwise. |
| 7874 | |
| 7875 | Fri Mar 26 16:20:45 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7876 | |
| 7877 | * Lib/test/output/test_userlist, Lib/test/test_userlist.py: |
| 7878 | Test suite for UserList. |
| 7879 | |
| 7880 | * Lib/UserList.py: Use isinstance() where appropriate. |
| 7881 | Reformatted with 4-space indent. |
| 7882 | |
| 7883 | Fri Mar 26 16:11:40 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us> |
| 7884 | |
| 7885 | * Tools/pynche/PyncheWidget.py: |
| 7886 | Helpwin.__init__(): The text widget should get focus. |
| 7887 | |
| 7888 | * Tools/pynche/pyColorChooser.py: |
| 7889 | Removed unnecessary import `from PyncheWidget import PyncheWidget' |
| 7890 | |
| 7891 | Fri Mar 26 15:32:05 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7892 | |
| 7893 | * Lib/test/output/test_userdict, Lib/test/test_userdict.py: |
| 7894 | Test suite for UserDict |
| 7895 | |
| 7896 | * Lib/UserDict.py: Improved a bunch of things. |
| 7897 | The constructor now takes an optional dictionary. |
| 7898 | Use isinstance() where appropriate. |
| 7899 | |
| 7900 | Thu Mar 25 22:38:49 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7901 | |
| 7902 | * Lib/test/output/test_pickle, Lib/test/output/test_cpickle, Lib/test/test_pickle.py, Lib/test/test_cpickle.py: |
| 7903 | Basic regr tests for pickle/cPickle |
| 7904 | |
| 7905 | * Lib/pickle.py: |
| 7906 | Don't use "exec" in find_class(). It's slow, unnecessary, and (as AMK |
| 7907 | points out) it doesn't work in JPython Applets. |
| 7908 | |
| 7909 | Thu Mar 25 21:50:27 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us> |
| 7910 | |
| 7911 | * Lib/test/test_gzip.py: |
| 7912 | Added a simple test suite for gzip. It simply opens a temp file, |
| 7913 | writes a chunk of compressed data, closes it, writes another chunk, and |
| 7914 | reads the contents back to verify that they are the same. |
| 7915 | |
| 7916 | * Lib/gzip.py: |
| 7917 | Based on a suggestion from bruce@hams.com, make a trivial change to |
| 7918 | allow using the 'a' flag as a mode for opening a GzipFile. gzip |
| 7919 | files, surprisingly enough, can be concatenated and then decompressed; |
| 7920 | the effect is to concatenate the two chunks of data. |
| 7921 | |
| 7922 | If we support it on writing, it should also be supported on reading. |
| 7923 | This *wasn't* trivial, and required rearranging the code in the |
| 7924 | reading path, particularly the _read() method. |
| 7925 | |
| 7926 | Raise IOError instead of RuntimeError in two cases, 'Not a gzipped file' |
| 7927 | and 'Unknown compression method' |
| 7928 | |
| 7929 | Thu Mar 25 21:25:01 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7930 | |
| 7931 | * Lib/test/test_b1.py: |
| 7932 | Add tests for float() and complex() with string args (Nick/Stephanie |
| 7933 | Lockwood). |
| 7934 | |
| 7935 | Thu Mar 25 21:21:08 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us> |
| 7936 | |
| 7937 | * Modules/zlibmodule.c: |
| 7938 | Add an .unused_data attribute to decompressor objects. If .unused_data |
| 7939 | is not an empty string, this means that you have arrived at the |
| 7940 | end of the stream of compressed data, and the contents of .unused_data are |
| 7941 | whatever follows the compressed stream. |
| 7942 | |
| 7943 | Thu Mar 25 21:16:07 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7944 | |
| 7945 | * Python/bltinmodule.c: |
| 7946 | Patch by Nick and Stephanie Lockwood to implement complex() with a string |
| 7947 | argument. This closes TODO item 2.19. |
| 7948 | |
| 7949 | Wed Mar 24 19:09:00 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 7950 | |
| 7951 | * Tools/webchecker/wcnew.py: Added Samuel Bayer's new webchecker. |
| 7952 | Unfortunately his code breaks wcgui.py in a way that's not easy |
| 7953 | to fix. I expect that this is a temporary situation -- |
| 7954 | eventually Sam's changes will be merged back in. |
| 7955 | (The changes add a -t option to specify exceptions to the -x |
| 7956 | option, and explicit checking for #foo style fragment ids.) |
| 7957 | |
| 7958 | * Objects/dictobject.c: |
| 7959 | Vladimir Marangozov contributed updated comments. |
| 7960 | |
| 7961 | * Objects/bufferobject.c: Folded long lines. |
| 7962 | |
| 7963 | * Lib/test/output/test_sha, Lib/test/test_sha.py: |
| 7964 | Added Jeremy's test code for the sha module. |
| 7965 | |
| 7966 | * Modules/shamodule.c, Modules/Setup.in: |
| 7967 | Added Greg Stein and Andrew Kuchling's sha module. |
| 7968 | Fix comments about zlib version and URL. |
| 7969 | |
| 7970 | * Lib/test/test_bsddb.py: Remove the temp file when we're done. |
| 7971 | |
| 7972 | * Include/pythread.h: Conform to standard boilerplate. |
| 7973 | |
| 7974 | * configure.in, configure, BeOS/linkmodule, BeOS/ar-fake: |
| 7975 | Chris Herborth: the new compiler in R4.1 needs some new options to work... |
| 7976 | |
| 7977 | * Modules/socketmodule.c: |
| 7978 | Implement two suggestions by Jonathan Giddy: (1) in AIX, clear the |
| 7979 | data struct before calling gethostby{name,addr}_r(); (2) ignore the |
| 7980 | 3/5/6 args determinations made by the configure script and switch on |
| 7981 | platform identifiers instead: |
| 7982 | |
| 7983 | AIX, OSF have 3 args |
| 7984 | Sun, SGI have 5 args |
| 7985 | Linux has 6 args |
| 7986 | |
| 7987 | On all other platforms, undef HAVE_GETHOSTBYNAME_R altogether. |
| 7988 | |
| 7989 | * Modules/socketmodule.c: |
| 7990 | Vladimir Marangozov implements the AIX 3-arg gethostbyname_r code. |
| 7991 | |
| 7992 | * Lib/mailbox.py: |
| 7993 | Add readlines() to _Subfile class. Not clear who would need it, but |
| 7994 | Chris Lawrence sent me a broken version; this one is a tad simpler and |
| 7995 | more conforming to the standard. |
| 7996 | |
| 7997 | Tue Mar 23 23:05:34 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us> |
| 7998 | |
| 7999 | * Lib/gzip.py: use struct instead of bit-manipulate in Python |
| 8000 | |
| 8001 | Tue Mar 23 19:00:55 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8002 | |
| 8003 | * Modules/Makefile.pre.in: |
| 8004 | Add $(EXE) to various occurrences of python so it will work on Cygwin |
| 8005 | with egcs (after setting EXE=.exe). Patch by Norman Vine. |
| 8006 | |
| 8007 | * configure, configure.in: |
| 8008 | Ack! It never defined HAVE_GETHOSTBYNAME_R so that code was never tested! |
| 8009 | |
| 8010 | Mon Mar 22 22:25:39 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8011 | |
| 8012 | * Include/thread.h: |
| 8013 | Adding thread.h -- unused but for b/w compatibility. |
| 8014 | As requested by Bill Janssen. |
| 8015 | |
| 8016 | * configure.in, configure: |
| 8017 | Add code to test for all sorts of gethostbyname_r variants, |
| 8018 | donated by David Arnold. |
| 8019 | |
| 8020 | * config.h.in, acconfig.h: |
| 8021 | Add symbols for gethostbyname_r variants (sigh). |
| 8022 | |
| 8023 | * Modules/socketmodule.c: Clean up pass for the previous patches. |
| 8024 | |
| 8025 | - Use HAVE_GETHOSTBYNAME_R_6_ARG instead of testing for Linux and |
| 8026 | glibc2. |
| 8027 | |
| 8028 | - If gethostbyname takes 3 args, undefine HAVE_GETHOSTBYNAME_R -- |
| 8029 | don't know what code should be used. |
| 8030 | |
| 8031 | - New symbol USE_GETHOSTBYNAME_LOCK defined iff the lock should be used. |
| 8032 | |
| 8033 | - Modify the gethostbyaddr() code to also hold on to the lock until |
| 8034 | after it is safe to release, overlapping with the Python lock. |
| 8035 | |
| 8036 | (Note: I think that it could in theory be possible that Python code |
| 8037 | executed while gethostbyname_lock is held could attempt to reacquire |
| 8038 | the lock -- e.g. in a signal handler or destructor. I will simply say |
| 8039 | "don't do that then.") |
| 8040 | |
| 8041 | * Modules/socketmodule.c: Jonathan Giddy writes: |
| 8042 | |
| 8043 | Here's a patch to fix the race condition, which wasn't fixed by Rob's |
| 8044 | patch. It holds the gethostbyname lock until the results are copied out, |
| 8045 | which means that this lock and the Python global lock are held at the same |
| 8046 | time. This shouldn't be a problem as long as the gethostbyname lock is |
| 8047 | always acquired when the global lock is not held. |
| 8048 | |
| 8049 | Mon Mar 22 19:25:30 1999 Andrew Kuchling <akuchlin@eric.cnri.reston.va.us> |
| 8050 | |
| 8051 | * Modules/zlibmodule.c: |
| 8052 | Fixed the flush() method of compression objects; the test for |
| 8053 | the end of loop was incorrect, and failed when the flushmode != Z_FINISH. |
| 8054 | Logic cleaned up and commented. |
| 8055 | |
| 8056 | * Lib/test/test_zlib.py: |
| 8057 | Added simple test for the flush() method of compression objects, trying the |
| 8058 | different flush values Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH. |
| 8059 | |
| 8060 | Mon Mar 22 15:28:08 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8061 | |
| 8062 | * Lib/shlex.py: |
| 8063 | Bug reported by Tobias Thelen: missing "self." in assignment target. |
| 8064 | |
| 8065 | Fri Mar 19 21:50:11 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8066 | |
| 8067 | * Modules/arraymodule.c: |
| 8068 | Use an unsigned cast to avoid a warning in VC++. |
| 8069 | |
| 8070 | * Lib/dospath.py, Lib/ntpath.py: |
| 8071 | New code for split() by Tim Peters, behaves more like posixpath.split(). |
| 8072 | |
| 8073 | * Objects/floatobject.c: |
| 8074 | Fix a problem with Vladimir's PyFloat_Fini code: clear the free list; if |
| 8075 | a block cannot be freed, add its free items back to the free list. |
| 8076 | This is necessary to avoid leaking when Python is reinitialized later. |
| 8077 | |
| 8078 | * Objects/intobject.c: |
| 8079 | Fix a problem with Vladimir's PyInt_Fini code: clear the free list; if |
| 8080 | a block cannot be freed, add its free items back to the free list, and |
| 8081 | add its valid ints back to the small_ints array if they are in range. |
| 8082 | This is necessary to avoid leaking when Python is reinitialized later. |
| 8083 | |
| 8084 | * Lib/types.py: |
| 8085 | Added BufferType, the type returned by the new builtin buffer(). Greg Stein. |
| 8086 | |
| 8087 | * Python/bltinmodule.c: |
| 8088 | New builtin buffer() creates a derived read-only buffer from any |
| 8089 | object that supports the buffer interface (e.g. strings, arrays). |
| 8090 | |
| 8091 | * Objects/bufferobject.c: |
| 8092 | Added check for negative offset for PyBuffer_FromObject and check for |
| 8093 | negative size for PyBuffer_FromMemory. Greg Stein. |
| 8094 | |
| 8095 | Thu Mar 18 15:10:44 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8096 | |
| 8097 | * Lib/urlparse.py: Sjoerd Mullender writes: |
| 8098 | |
| 8099 | If a filename on Windows starts with \\, it is converted to a URL |
| 8100 | which starts with ////. If this URL is passed to urlparse.urlparse |
| 8101 | you get a path that starts with // (and an empty netloc). If you pass |
| 8102 | the result back to urlparse.urlunparse, you get a URL that starts with |
| 8103 | //, which is parsed differently by urlparse.urlparse. The fix is to |
| 8104 | add the (empty) netloc with accompanying slashes if the path in |
| 8105 | urlunparse starts with //. Do this for all schemes that use a netloc. |
| 8106 | |
| 8107 | * Lib/nturl2path.py: Sjoerd Mullender writes: |
| 8108 | |
| 8109 | Pathnames of files on other hosts in the same domain |
| 8110 | (\\host\path\to\file) are not translated correctly to URLs and back. |
| 8111 | The URL should be something like file:////host/path/to/file. |
| 8112 | Note that a combination of drive letter and remote host is not |
| 8113 | possible. |
| 8114 | |
| 8115 | Wed Mar 17 22:30:10 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8116 | |
| 8117 | * Lib/urlparse.py: |
| 8118 | Delete non-standard-conforming code in urljoin() that would use the |
| 8119 | netloc from the base url as the default netloc for the resulting url |
| 8120 | even if the schemes differ. |
| 8121 | |
| 8122 | Once upon a time, when the web was wild, this was a valuable hack |
| 8123 | because some people had a URL referencing an ftp server colocated with |
| 8124 | an http server without having the host in the ftp URL (so they could |
| 8125 | replicate it or change the hostname easily). |
| 8126 | |
| 8127 | More recently, after the file: scheme got added back to the list of |
| 8128 | schemes that accept a netloc, it turns out that this caused weirdness |
| 8129 | when joining an http: URL with a file: URL -- the resulting file: URL |
| 8130 | would always inherit the host from the http: URL because the file: |
| 8131 | scheme supports a netloc but in practice never has one. |
| 8132 | |
| 8133 | There are two reasons to get rid of the old, once-valuable hack, |
| 8134 | instead of removing the file: scheme from the uses_netloc list. One, |
| 8135 | the RFC says that file: uses the netloc syntax, and does not endorse |
| 8136 | the old hack. Two, neither netscape 4.5 nor IE 4.0 support the old |
| 8137 | hack. |
| 8138 | |
| 8139 | * Include/ceval.h, Include/abstract.h: |
| 8140 | Add DLL level b/w compat for PySequence_In and PyEval_CallObject |
| 8141 | |
| 8142 | Tue Mar 16 21:54:50 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8143 | |
| 8144 | * Lib/lib-tk/Tkinter.py: Bug reported by Jim Robinson: |
| 8145 | |
| 8146 | An attempt to execute grid_slaves with arguments (0,0) results in |
| 8147 | *all* of the slaves being returned, not just the slave associated with |
| 8148 | row 0, column 0. This is because the test for arguments in the method |
| 8149 | does not test to see if row (and column) does not equal None, but |
| 8150 | rather just whether is evaluates to non-false. A value of 0 fails |
| 8151 | this test. |
| 8152 | |
| 8153 | Tue Mar 16 14:17:48 1999 Fred Drake <fdrake@eric.cnri.reston.va.us> |
| 8154 | |
| 8155 | * Modules/cmathmodule.c: |
| 8156 | Docstring fix: acosh() returns the hyperbolic arccosine, not the |
| 8157 | hyperbolic cosine. Problem report via David Ascher by one of his |
| 8158 | students. |
| 8159 | |
| 8160 | Mon Mar 15 21:40:59 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8161 | |
| 8162 | * configure.in: |
| 8163 | Should test for gethost*by*name_r, not for gethostname_r (which |
| 8164 | doesn't exist and doesn't make sense). |
| 8165 | |
| 8166 | * Modules/socketmodule.c: |
| 8167 | Patch by Rob Riggs for Linux -- glibc2 has a different argument |
| 8168 | converntion for gethostbyname_r() etc. than Solaris! |
| 8169 | |
| 8170 | * Python/thread_pthread.h: Rob Riggs wrote: |
| 8171 | |
| 8172 | """ |
| 8173 | Spec says that on success pthread_create returns 0. It does not say |
| 8174 | that an error code will be < 0. Linux glibc2 pthread_create() returns |
| 8175 | ENOMEM (12) when one exceed process limits. (It looks like it should |
| 8176 | return EAGAIN, but that's another story.) |
| 8177 | |
| 8178 | For reference, see: |
| 8179 | http://www.opengroup.org/onlinepubs/7908799/xsh/pthread_create.html |
| 8180 | """ |
| 8181 | |
| 8182 | [I have a feeling that similar bugs were fixed before; perhaps someone |
| 8183 | could check that all error checks no check for != 0?] |
| 8184 | |
| 8185 | * Tools/bgen/bgen/bgenObjectDefinition.py: |
| 8186 | New mixin class that defines cmp and hash that use |
| 8187 | the ob_itself pointer. This allows (when using the mixin) |
| 8188 | different Python objects pointing to the same C object and |
| 8189 | behaving well as dictionary keys. |
| 8190 | |
| 8191 | Or so sez Jack Jansen... |
| 8192 | |
| 8193 | * Lib/urllib.py: Yet another patch by Sjoerd Mullender: |
| 8194 | |
| 8195 | Don't convert URLs to URLs using pathname2url. |
| 8196 | |
| 8197 | Fri Mar 12 22:15:43 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8198 | |
| 8199 | * Lib/cmd.py: Patch by Michael Scharf. He writes: |
| 8200 | |
| 8201 | The module cmd requires for each do_xxx command a help_xxx |
| 8202 | function. I think this is a little old fashioned. |
| 8203 | |
| 8204 | Here is a patch: use the docstring as help if no help_xxx |
| 8205 | function can be found. |
| 8206 | |
| 8207 | [I'm tempted to rip out all the help_* functions from pdb, but I'll |
| 8208 | resist it. Any takers? --Guido] |
| 8209 | |
| 8210 | * Tools/freeze/freeze.py: Bug submitted by Wayne Knowles, who writes: |
| 8211 | |
| 8212 | Under Windows, python freeze.py -o hello hello.py |
| 8213 | creates all the correct files in the hello subdirectory, but the |
| 8214 | Makefile has the directory prefix in it for frozen_extensions.c |
| 8215 | nmake fails because it tries to locate hello/frozen_extensions.c |
| 8216 | |
| 8217 | (His fix adds a call to os.path.basename() in the appropriate place.) |
| 8218 | |
| 8219 | * Objects/floatobject.c, Objects/intobject.c: |
| 8220 | Vladimir has restructured his code somewhat so that the blocks are now |
| 8221 | represented by an explicit structure. (There are still too many casts |
| 8222 | in the code, but that may be unavoidable.) |
| 8223 | |
| 8224 | Also added code so that with -vv it is very chatty about what it does. |
| 8225 | |
| 8226 | * Demo/zlib/zlibdemo.py, Demo/zlib/minigzip.py: |
| 8227 | Change #! line to modern usage; also chmod +x |
| 8228 | |
| 8229 | * Demo/pdist/rrcs, Demo/pdist/rcvs, Demo/pdist/rcsbump: |
| 8230 | Change #! line to modern usage |
| 8231 | |
| 8232 | * Lib/nturl2path.py, Lib/urllib.py: From: Sjoerd Mullender |
| 8233 | |
| 8234 | The filename to URL conversion didn't properly quote special |
| 8235 | characters. |
| 8236 | The URL to filename didn't properly unquote special chatacters. |
| 8237 | |
| 8238 | * Objects/floatobject.c: |
| 8239 | OK, try again. Vladimir gave me a fix for the alignment bus error, |
| 8240 | so here's his patch again. This time it works (at least on Solaris, |
| 8241 | Linux and Irix). |
| 8242 | |
| 8243 | Thu Mar 11 23:21:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8244 | |
| 8245 | * Tools/idle/PathBrowser.py: |
| 8246 | Don't crash when sys.path contains an empty string. |
| 8247 | |
| 8248 | * Tools/idle/PathBrowser.py: |
| 8249 | - Don't crash in the case where a superclass is a string instead of a |
| 8250 | pyclbr.Class object; this can happen when the superclass is |
| 8251 | unrecognizable (to pyclbr), e.g. when module renaming is used. |
| 8252 | |
| 8253 | - Show a watch cursor when calling pyclbr (since it may take a while |
| 8254 | recursively parsing imported modules!). |
| 8255 | |
| 8256 | Thu Mar 11 16:04:04 1999 Fred Drake <fdrake@eric.cnri.reston.va.us> |
| 8257 | |
| 8258 | * Lib/mimetypes.py: |
| 8259 | Added .rdf and .xsl as application/xml types. (.rdf is for the |
| 8260 | Resource Description Framework, a metadata encoding, and .xsl is for |
| 8261 | the Extensible Stylesheet Language.) |
| 8262 | |
| 8263 | Thu Mar 11 13:26:23 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8264 | |
| 8265 | * Lib/test/output/test_popen2, Lib/test/test_popen2.py: |
| 8266 | Test for popen2 module, by Chris Tismer. |
| 8267 | |
| 8268 | * Objects/floatobject.c: |
| 8269 | Alas, Vladimir's patch caused a bus error (probably double |
| 8270 | alignment?), and I didn't test it. Withdrawing it for now. |
| 8271 | |
| 8272 | Wed Mar 10 22:55:47 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8273 | |
| 8274 | * Objects/floatobject.c: |
| 8275 | Patch by Vladimir Marangoz to allow freeing of the allocated blocks of |
| 8276 | floats on finalization. |
| 8277 | |
| 8278 | * Objects/intobject.c: |
| 8279 | Patch by Vladimir Marangoz to allow freeing of the allocated blocks of |
| 8280 | integers on finalization. |
| 8281 | |
| 8282 | * Tools/idle/EditorWindow.py, Tools/idle/Bindings.py: |
| 8283 | Add PathBrowser to File module |
| 8284 | |
| 8285 | * Tools/idle/PathBrowser.py: |
| 8286 | "Path browser" - 4 scrolled lists displaying: |
| 8287 | directories on sys.path |
| 8288 | modules in selected directory |
| 8289 | classes in selected module |
| 8290 | methods of selected class |
| 8291 | |
| 8292 | Sinlge clicking in a directory, module or class item updates the next |
| 8293 | column with info about the selected item. Double clicking in a |
| 8294 | module, class or method item opens the file (and selects the clicked |
| 8295 | item if it is a class or method). |
| 8296 | |
| 8297 | I guess eventually I should be using a tree widget for this, but the |
| 8298 | ones I've seen don't work well enough, so for now I use the old |
| 8299 | Smalltalk or NeXT style multi-column hierarchical browser. |
| 8300 | |
| 8301 | * Tools/idle/MultiScrolledLists.py: |
| 8302 | New utility: multiple scrolled lists in parallel |
| 8303 | |
| 8304 | * Tools/idle/ScrolledList.py: - White background. |
| 8305 | - Display "(None)" (or text of your choosing) when empty. |
| 8306 | - Don't set the focus. |
| 8307 | |
| 8308 | Tue Mar 9 19:31:21 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8309 | |
| 8310 | * Lib/urllib.py: |
| 8311 | open_http also had the 'data is None' test backwards. don't call with the |
| 8312 | extra argument if data is None. |
| 8313 | |
| 8314 | * Demo/embed/demo.c: |
| 8315 | Call Py_SetProgramName() instead of redefining getprogramname(), |
| 8316 | reflecting changes in the runtime around 1.5 or earlier. |
| 8317 | |
| 8318 | * Python/ceval.c: |
| 8319 | Always test for an error return (usually NULL or -1) without setting |
| 8320 | an exception. |
| 8321 | |
| 8322 | * Modules/timemodule.c: Patch by Chris Herborth for BeOS code. |
| 8323 | He writes: |
| 8324 | |
| 8325 | I had an off-by-1000 error in floatsleep(), |
| 8326 | and the problem with time.clock() is that it's not implemented properly |
| 8327 | on QNX... ANSI says it's supposed to return _CPU_ time used by the |
| 8328 | process, but on QNX it returns the amount of real time used... so I was |
| 8329 | confused. |
| 8330 | |
| 8331 | * Tools/bgen/bgen/macsupport.py: Small change by Jack Jansen. |
| 8332 | Test for self.returntype behaving like OSErr rather than being it. |
| 8333 | |
| 8334 | Thu Feb 25 16:14:58 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us> |
| 8335 | |
| 8336 | * Lib/urllib.py: |
| 8337 | http_error had the 'data is None' test backwards. don't call with the |
| 8338 | extra argument if data is None. |
| 8339 | |
| 8340 | * Lib/urllib.py: change indentation from 8 spaces to 4 spaces |
| 8341 | |
| 8342 | * Lib/urllib.py: pleasing the tabnanny |
| 8343 | |
| 8344 | Thu Feb 25 14:26:02 1999 Fred Drake <fdrake@eric.cnri.reston.va.us> |
| 8345 | |
| 8346 | * Lib/colorsys.py: |
| 8347 | Oops, one more "x, y, z" to convert... |
| 8348 | |
| 8349 | * Lib/colorsys.py: |
| 8350 | Adjusted comment at the top to be less confusing, following Fredrik |
| 8351 | Lundh's example. |
| 8352 | |
| 8353 | Converted comment to docstring. |
| 8354 | |
| 8355 | Wed Feb 24 18:49:15 1999 Fred Drake <fdrake@eric.cnri.reston.va.us> |
| 8356 | |
| 8357 | * Lib/toaiff.py: |
| 8358 | Use sndhdr instead of the obsolete whatsound module. |
| 8359 | |
| 8360 | Wed Feb 24 18:42:38 1999 Jeremy Hylton <jhylton@eric.cnri.reston.va.us> |
| 8361 | |
| 8362 | * Lib/urllib.py: |
| 8363 | When performing a POST request, i.e. when the second argument to |
| 8364 | urlopen is used to specify form data, make sure the second argument is |
| 8365 | threaded through all of the http_error_NNN calls. This allows error |
| 8366 | handlers like the redirect and authorization handlers to properly |
| 8367 | re-start the connection. |
| 8368 | |
| 8369 | Wed Feb 24 16:25:17 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8370 | |
| 8371 | * Lib/mhlib.py: Patch by Lars Wirzenius: |
| 8372 | |
| 8373 | o the initial comment is wrong: creating messages is already |
| 8374 | implemented |
| 8375 | |
| 8376 | o Message.getbodytext: if the mail or it's part contains an |
| 8377 | empty content-transfer-encoding header, the code used to |
| 8378 | break; the change below treats an empty encoding value the same |
| 8379 | as the other types that do not need decoding |
| 8380 | |
| 8381 | o SubMessage.getbodytext was missing the decode argument; the |
| 8382 | change below adds it; I also made it unconditionally return |
| 8383 | the raw text if decoding was not desired, because my own |
| 8384 | routines needed that (and it was easier than rewriting my |
| 8385 | own routines ;-) |
| 8386 | |
| 8387 | Wed Feb 24 00:35:43 1999 Barry Warsaw <bwarsaw@eric.cnri.reston.va.us> |
| 8388 | |
| 8389 | * Python/bltinmodule.c (initerrors): |
| 8390 | Make sure that the exception tuples ("base-classes" when |
| 8391 | string-based exceptions are used) reflect the real class hierarchy, |
| 8392 | i.e. that SystemExit derives from Exception not StandardError. |
| 8393 | |
| 8394 | * Lib/exceptions.py: |
| 8395 | Document the correct class hierarchy for SystemExit. It is not an |
| 8396 | error and so it derives from Exception and not SystemError. The |
| 8397 | docstring was incorrect but the implementation was fine. |
| 8398 | |
| 8399 | Tue Feb 23 23:07:51 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8400 | |
| 8401 | * Lib/shutil.py: |
| 8402 | Add import sys, needed by reference to sys.exc_info() in rmtree(). |
| 8403 | Discovered by Mitch Chapman. |
| 8404 | |
| 8405 | * config.h.in: |
| 8406 | Now that we don't have AC_CHECK_LIB(m, pow), the HAVE_LIBM symbol |
| 8407 | disappears. It wasn't used anywhere anyway... |
| 8408 | |
| 8409 | * Modules/arraymodule.c: |
| 8410 | Carefully check for overflow when allocating the memory for fromfile |
| 8411 | -- someone tried to pass in sys.maxint and got bitten by the bogus |
| 8412 | calculations. |
| 8413 | |
| 8414 | * configure.in: |
| 8415 | Get rid of AC_CHECK_LIB(m, pow) since this is taken care of later with |
| 8416 | LIBM (from --with-libm=...); this actually broke the customizability |
| 8417 | offered by the latter option. Thanks go to Clay Spence for reporting |
| 8418 | this. |
| 8419 | |
| 8420 | * Lib/test/test_dl.py: |
| 8421 | 1. Print the error message (carefully) when a dl.open() fails in verbose mode. |
| 8422 | 2. When no test case worked, raise ImportError instead of failing. |
| 8423 | |
| 8424 | * Python/bltinmodule.c: |
| 8425 | Patch by Tim Peters to improve the range checks for range() and |
| 8426 | xrange(), especially for platforms where int and long are different |
| 8427 | sizes (so sys.maxint isn't actually the theoretical limit for the |
| 8428 | length of a list, but the largest C int is -- sys.maxint is the |
| 8429 | largest Python int, which is actually a C long). |
| 8430 | |
| 8431 | * Makefile.in: |
| 8432 | 1. Augment the DG/UX rule so it doesn't break the BeOS build. |
| 8433 | 2. Add $(EXE) to various occurrences of python so it will work on |
| 8434 | Cygwin with egcs (after setting EXE=.exe). These patches by |
| 8435 | Norman Vine. |
| 8436 | |
| 8437 | * Lib/posixfile.py: |
| 8438 | According to Jeffrey Honig, bsd/os 2.0 - 4.0 should be added to the |
| 8439 | list (of bsd variants that have a different lock structure). |
| 8440 | |
| 8441 | * Lib/test/test_fcntl.py: |
| 8442 | According to Jeffrey Honig, bsd/os 4.0 should be added to the list. |
| 8443 | |
| 8444 | * Modules/timemodule.c: |
| 8445 | Patch by Tadayoshi Funaba (with some changes) to be smarter about |
| 8446 | guessing what happened when strftime() returns 0. Is it buffer |
| 8447 | overflow or was the result simply 0 bytes long? (This happens for an |
| 8448 | empty format string, or when the format string is a single %Z and the |
| 8449 | timezone is unknown.) if the buffer is at least 256 times as long as |
| 8450 | the format, assume the latter. |
| 8451 | |
| 8452 | Mon Feb 22 19:01:42 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8453 | |
| 8454 | * Lib/urllib.py: |
| 8455 | As Des Barry points out, we need to call pathname2url(file) in two |
| 8456 | calls to addinfourl() in open_file(). |
| 8457 | |
| 8458 | * Modules/Setup.in: Document *static* -- in two places! |
| 8459 | |
| 8460 | * Modules/timemodule.c: |
| 8461 | We don't support leap seconds, so the seconds field of a time 9-tuple |
| 8462 | should be in the range [0-59]. Noted by Tadayoshi Funaba. |
| 8463 | |
| 8464 | * Modules/stropmodule.c: |
| 8465 | In atoi(), don't use isxdigit() to test whether the last character |
| 8466 | converted was a "digit" -- use isalnum(). This test is there only to |
| 8467 | guard against "+" or "-" being interpreted as a valid int literal. |
| 8468 | Reported by Takahiro Nakayama. |
| 8469 | |
| 8470 | * Lib/os.py: |
| 8471 | As Finn Bock points out, _P_WAIT etc. don't have a leading underscore |
| 8472 | so they don't need to be treated specially here. |
| 8473 | |
| 8474 | Mon Feb 22 15:38:58 1999 Fred Drake <fdrake@eric.cnri.reston.va.us> |
| 8475 | |
| 8476 | * Misc/NEWS: |
| 8477 | Typo: "apparentlt" --> "apparently" |
| 8478 | |
| 8479 | Mon Feb 22 15:38:46 1999 Guido van Rossum <guido@eric.cnri.reston.va.us> |
| 8480 | |
| 8481 | * Lib/urlparse.py: Steve Clift pointed out that 'file' allows a netloc. |
| 8482 | |
| 8483 | * Modules/posixmodule.c: |
| 8484 | The docstring for ttyname(..) claims a second "mode" argument. The |
| 8485 | actual code does not allow such an argument. (Finn Bock.) |
| 8486 | |
| 8487 | * Lib/lib-old/poly.py: |
| 8488 | Dang. Even though this is obsolete code, somebody found a bug, and I |
| 8489 | fix it. Oh well. |
| 8490 | |
| 8491 | Thu Feb 18 20:51:50 1999 Fred Drake <fdrake@eric.cnri.reston.va.us> |
| 8492 | |
| 8493 | * Lib/pyclbr.py: |
| 8494 | Bow to font-lock at the end of the docstring, since it throws stuff |
| 8495 | off. |
| 8496 | |
| 8497 | Make sure the path paramter to readmodule() is a list before adding it |
| 8498 | with sys.path, or the addition could fail. |
| 8499 | |
| 8500 | |
| 8501 | ====================================================================== |
| 8502 | |
| 8503 | |
| 8504 | From 1.5.2b1 to 1.5.2b2 |
| 8505 | ======================= |
| 8506 | |
| 8507 | General |
| 8508 | ------- |
| 8509 | |
| 8510 | - Many memory leaks fixed. |
| 8511 | |
| 8512 | - Many small bugs fixed. |
| 8513 | |
| 8514 | - Command line option -OO (or -O -O) suppresses inclusion of doc |
| 8515 | strings in resulting bytecode. |
| 8516 | |
| 8517 | Windows-specific changes |
| 8518 | ------------------------ |
| 8519 | |
| 8520 | - New built-in module winsound provides an interface to the Win32 |
| 8521 | PlaySound() call. |
| 8522 | |
| 8523 | - Re-enable the audioop module in the config.c file. |
| 8524 | |
| 8525 | - On Windows, support spawnv() and associated P_* symbols. |
| 8526 | |
| 8527 | - Fixed the conversion of times() return values on Windows. |
| 8528 | |
| 8529 | - Removed freeze from the installer -- it doesn't work without the |
| 8530 | source tree. (See FAQ 8.11.) |
| 8531 | |
| 8532 | - On Windows 95/98, the Tkinter module now is smart enough to find |
| 8533 | Tcl/Tk even when the PATH environment variable hasn't been set -- when |
| 8534 | the import of _tkinter fails, it searches in a standard locations, |
| 8535 | patches os.environ["PATH"], and tries again. When it still fails, a |
| 8536 | clearer error message is produced. This should avoid most |
| 8537 | installation problems with Tkinter use (e.g. in IDLE). |
| 8538 | |
| 8539 | - The -i option doesn't make any calls to set[v]buf() for stdin -- |
| 8540 | this apparently screwed up _kbhit() and the _tkinter main loop. |
| 8541 | |
| 8542 | - The ntpath module (and hence, os.path on Windows) now parses out UNC |
| 8543 | paths (e.g. \\host\mountpoint\dir\file) as "drive letters", so that |
| 8544 | splitdrive() will \\host\mountpoint as the drive and \dir\file as the |
| 8545 | path. ** EXPERIMENTAL ** |
| 8546 | |
| 8547 | - Added a hack to the exit code so that if (1) the exit status is |
| 8548 | nonzero and (2) we think we have our own DOS box (i.e. we're not |
| 8549 | started from a command line shell), we print a message and wait for |
| 8550 | the user to hit a key before the DOS box is closed. |
| 8551 | |
| 8552 | - Updated the installer to WISE 5.0g. Added a dialog warning about |
| 8553 | the imminent Tcl installation. Added a dialog to specify the program |
| 8554 | group name in the start menu. Upgraded the Tcl installer to Tcl |
| 8555 | 8.0.4. |
| 8556 | |
| 8557 | Changes to intrinsics |
| 8558 | --------------------- |
| 8559 | |
| 8560 | - The repr() or str() of a module object now shows the __file__ |
| 8561 | attribute (i.e., the file which it was loaded), or the string |
| 8562 | "(built-in)" if there is no __file__ attribute. |
| 8563 | |
| 8564 | - The range() function now avoids overflow during its calculations (if |
| 8565 | at all possible). |
| 8566 | |
| 8567 | - New info string sys.hexversion, which is an integer encoding the |
| 8568 | version in hexadecimal. In other words, hex(sys.hexversion) == |
| 8569 | 0x010502b2 for Python 1.5.2b2. |
| 8570 | |
| 8571 | New or improved ports |
| 8572 | --------------------- |
| 8573 | |
| 8574 | - Support for Nextstep descendants (future Mac systems). |
| 8575 | |
| 8576 | - Improved BeOS support. |
| 8577 | |
| 8578 | - Support dynamic loading of shared libraries on NetBSD platforms that |
| 8579 | use ELF (i.e., MIPS and Alpha systems). |
| 8580 | |
| 8581 | Configuration/build changes |
| 8582 | --------------------------- |
| 8583 | |
| 8584 | - The Lib/test directory is no longer included in the default module |
| 8585 | search path (sys.path) -- "test" has been a package ever since 1.5. |
| 8586 | |
| 8587 | - Now using autoconf 2.13. |
| 8588 | |
| 8589 | New library modules |
| 8590 | ------------------- |
| 8591 | |
| 8592 | - New library modules asyncore and asynchat: these form Sam Rushing's |
| 8593 | famous asynchronous socket library. Sam has gracefully allowed me to |
| 8594 | incorporate these in the standard Python library. |
| 8595 | |
| 8596 | - New module statvfs contains indexing constants for [f]statvfs() |
| 8597 | return tuple. |
| 8598 | |
| 8599 | Changes to the library |
| 8600 | ---------------------- |
| 8601 | |
| 8602 | - The wave module (platform-independent support for Windows sound |
| 8603 | files) has been fixed to actually make it work. |
| 8604 | |
| 8605 | - The sunau module (platform-independent support for Sun/NeXT sound |
| 8606 | files) has been fixed to work across platforms. Also, a weird |
| 8607 | encoding bug in the header of the audio test data file has been |
| 8608 | corrected. |
| 8609 | |
| 8610 | - Fix a bug in the urllib module that occasionally tripped up |
| 8611 | webchecker and other ftp retrieves. |
| 8612 | |
| 8613 | - ConfigParser's get() method now accepts an optional keyword argument |
| 8614 | (vars) that is substituted on top of the defaults that were setup in |
| 8615 | __init__. You can now also have recusive references in your |
| 8616 | configuration file. |
| 8617 | |
| 8618 | - Some improvements to the Queue module, including a put_nowait() |
| 8619 | module and an optional "block" second argument, to get() and put(), |
| 8620 | defaulting to 1. |
| 8621 | |
| 8622 | - The updated xmllib module is once again compatible with the version |
| 8623 | present in Python 1.5.1 (this was accidentally broken in 1.5.2b1). |
| 8624 | |
| 8625 | - The bdb module (base class for the debugger) now supports |
| 8626 | canonicalizing pathnames used in breakpoints. The derived class must |
| 8627 | override the new canonical() method for this to work. Also changed |
| 8628 | clear_break() to the backwards compatible old signature, and added |
| 8629 | clear_bpbynumber() for the new functionality. |
| 8630 | |
| 8631 | - In sgmllib (and hence htmllib), recognize attributes even if they |
| 8632 | don't have space in front of them. I.e. '<a |
| 8633 | name="foo"href="bar.html">' will now have two attributes recognized. |
| 8634 | |
| 8635 | - In the debugger (pdb), change clear syntax to support three |
| 8636 | alternatives: clear; clear file:line; clear bpno bpno ... |
| 8637 | |
| 8638 | - The os.path module now pretends to be a submodule within the os |
| 8639 | "package", so you can do things like "from os.path import exists". |
| 8640 | |
| 8641 | - The standard exceptions now have doc strings. |
| 8642 | |
| 8643 | - In the smtplib module, exceptions are now classes. Also avoid |
| 8644 | inserting a non-standard space after "TO" in rcpt() command. |
| 8645 | |
| 8646 | - The rfc822 module's getaddrlist() method now uses all occurrences of |
| 8647 | the specified header instead of just the first. Some other bugfixes |
| 8648 | too (to handle more weird addresses found in a very large test set, |
| 8649 | and to avoid crashes on certain invalid dates), and a small test |
| 8650 | module has been added. |
| 8651 | |
| 8652 | - Fixed bug in urlparse in the common-case code for HTTP URLs; it |
| 8653 | would lose the query, fragment, and/or parameter information. |
| 8654 | |
| 8655 | - The sndhdr module no longer supports whatraw() -- it depended on a |
| 8656 | rare extenral program. |
| 8657 | |
| 8658 | - The UserList module/class now supports the extend() method, like |
| 8659 | real list objects. |
| 8660 | |
| 8661 | - The uu module now deals better with trailing garbage generated by |
| 8662 | some broke uuencoders. |
| 8663 | |
| 8664 | - The telnet module now has an my_interact() method which uses threads |
| 8665 | instead of select. The interact() method uses this by default on |
| 8666 | Windows (where the single-threaded version doesn't work). |
| 8667 | |
| 8668 | - Add a class to mailbox.py for dealing with qmail directory |
| 8669 | mailboxes. The test code was extended to notice these being used as |
| 8670 | well. |
| 8671 | |
| 8672 | Changes to extension modules |
| 8673 | ---------------------------- |
| 8674 | |
| 8675 | - Support for the [f]statvfs() system call, where it exists. |
| 8676 | |
| 8677 | - Fixed some bugs in cPickle where bad input could cause it to dump |
| 8678 | core. |
| 8679 | |
| 8680 | - Fixed cStringIO to make the writelines() function actually work. |
| 8681 | |
| 8682 | - Added strop.expandtabs() so string.expandtabs() is now much faster. |
| 8683 | |
| 8684 | - Added fsync() and fdatasync(), if they appear to exist. |
| 8685 | |
| 8686 | - Support for "long files" (64-bit seek pointers). |
| 8687 | |
| 8688 | - Fixed a bug in the zlib module's flush() function. |
| 8689 | |
| 8690 | - Added access() system call. It returns 1 if access granted, 0 if |
| 8691 | not. |
| 8692 | |
| 8693 | - The curses module implements an optional nlines argument to |
| 8694 | w.scroll(). (It then calls wscrl(win, nlines) instead of scoll(win).) |
| 8695 | |
| 8696 | Changes to tools |
| 8697 | ---------------- |
| 8698 | |
| 8699 | - Some changes to IDLE; see Tools/idle/NEWS.txt. |
| 8700 | |
| 8701 | - Latest version of Misc/python-mode.el included. |
| 8702 | |
| 8703 | Changes to Tkinter |
| 8704 | ------------------ |
| 8705 | |
| 8706 | - Avoid tracebacks when an image is deleted after its root has been |
| 8707 | destroyed. |
| 8708 | |
| 8709 | Changes to the Python/C API |
| 8710 | --------------------------- |
| 8711 | |
| 8712 | - When parentheses are used in a PyArg_Parse[Tuple]() call, any |
| 8713 | sequence is now accepted, instead of requiring a tuple. This is in |
| 8714 | line with the general trend towards accepting arbitrary sequences. |
| 8715 | |
| 8716 | - Added PyModule_GetFilename(). |
| 8717 | |
| 8718 | - In PyNumber_Power(), remove unneeded and even harmful test for float |
| 8719 | to the negative power (which is already and better done in |
| 8720 | floatobject.c). |
| 8721 | |
| 8722 | - New version identification symbols; read patchlevel.h for info. The |
| 8723 | version numbers are now exported by Python.h. |
| 8724 | |
| 8725 | - Rolled back the API version change -- it's back to 1007! |
| 8726 | |
| 8727 | - The frozenmain.c function calls PyInitFrozenExtensions(). |
| 8728 | |
| 8729 | - Added 'N' format character to Py_BuildValue -- like 'O' but doesn't |
| 8730 | INCREF. |
| 8731 | |
| 8732 | |
| 8733 | ====================================================================== |
| 8734 | |
| 8735 | |
| 8736 | From 1.5.2a2 to 1.5.2b1 |
| 8737 | ======================= |
| 8738 | |
| 8739 | Changes to intrinsics |
| 8740 | --------------------- |
| 8741 | |
| 8742 | - New extension NotImplementedError, derived from RuntimeError. Not |
| 8743 | used, but recommended use is for "abstract" methods to raise this. |
| 8744 | |
| 8745 | - The parser will now spit out a warning or error when -t or -tt is |
| 8746 | used for parser input coming from a string, too. |
| 8747 | |
| 8748 | - The code generator now inserts extra SET_LINENO opcodes when |
| 8749 | compiling multi-line argument lists. |
| 8750 | |
| 8751 | - When comparing bound methods, use identity test on the objects, not |
| 8752 | equality test. |
| 8753 | |
| 8754 | New or improved ports |
| 8755 | --------------------- |
| 8756 | |
| 8757 | - Chris Herborth has redone his BeOS port; it now works on PowerPC |
| 8758 | (R3/R4) and x86 (R4 only). Threads work too in this port. |
| 8759 | |
| 8760 | Renaming |
| 8761 | -------- |
| 8762 | |
| 8763 | - Thanks to Chris Herborth, the thread primitives now have proper Py* |
| 8764 | names in the source code (they already had those for the linker, |
| 8765 | through some smart macros; but the source still had the old, un-Py |
| 8766 | names). |
| 8767 | |
| 8768 | Configuration/build changes |
| 8769 | --------------------------- |
| 8770 | |
| 8771 | - Improved support for FreeBSD/3. |
| 8772 | |
| 8773 | - Check for pthread_detach instead of pthread_create in libc. |
| 8774 | |
| 8775 | - The makesetup script now searches EXECINCLUDEPY before INCLUDEPY. |
| 8776 | |
| 8777 | - Misc/Makefile.pre.in now also looks at Setup.thread and Setup.local. |
| 8778 | Otherwise modules such as thread didn't get incorporated in extensions. |
| 8779 | |
| 8780 | New library modules |
| 8781 | ------------------- |
| 8782 | |
| 8783 | - shlex.py by Eric Raymond provides a lexical analyzer class for |
| 8784 | simple shell-like syntaxes. |
| 8785 | |
| 8786 | - netrc.py by Eric Raymond provides a parser for .netrc files. (The |
| 8787 | undocumented Netrc class in ftplib.py is now obsolete.) |
| 8788 | |
| 8789 | - codeop.py is a new module that contains the compile_command() |
| 8790 | function that was previously in code.py. This is so that JPython can |
| 8791 | provide its own version of this function, while still sharing the |
| 8792 | higher-level classes in code.py. |
| 8793 | |
| 8794 | - turtle.py is a new module for simple turtle graphics. I'm still |
| 8795 | working on it; let me know if you use this to teach Python to children |
| 8796 | or other novices without prior programming experience. |
| 8797 | |
| 8798 | Obsoleted library modules |
| 8799 | ------------------------- |
| 8800 | |
| 8801 | - poly.py and zmod.py have been moved to Lib/lib-old to emphasize |
| 8802 | their status of obsoleteness. They don't do a particularly good job |
| 8803 | and don't seem particularly relevant to the Python core. |
| 8804 | |
| 8805 | New tools |
| 8806 | --------- |
| 8807 | |
| 8808 | - I've added IDLE: my Integrated DeveLopment Environment for Python. |
| 8809 | Requires Tcl/Tk (and Tkinter). Works on Windows and Unix (and should |
| 8810 | work on Macintosh, but I haven't been able to test it there; it does |
| 8811 | depend on new features in 1.5.2 and perhaps even new features in |
| 8812 | 1.5.2b1, especially the new code module). This is very much a work in |
| 8813 | progress. I'd like to hear how people like it compared to PTUI (or |
| 8814 | any other IDE they are familiar with). |
| 8815 | |
| 8816 | - New tools by Barry Warsaw: |
| 8817 | |
| 8818 | = audiopy: controls the Solaris Audio device |
| 8819 | = pynche: The PYthonically Natural Color and Hue Editor |
| 8820 | = world: Print mappings between country names and DNS country codes |
| 8821 | |
| 8822 | New demos |
| 8823 | --------- |
| 8824 | |
| 8825 | - Demo/scripts/beer.py prints the lyrics to an arithmetic drinking |
| 8826 | song. |
| 8827 | |
| 8828 | - Demo/tkinter/guido/optionmenu.py shows how to do an option menu in |
| 8829 | Tkinter. (By Fredrik Lundh -- not by me!) |
| 8830 | |
| 8831 | Changes to the library |
| 8832 | ---------------------- |
| 8833 | |
| 8834 | - compileall.py now avoids recompiling .py files that haven't changed; |
| 8835 | it adds a -f option to force recompilation. |
| 8836 | |
| 8837 | - New version of xmllib.py by Sjoerd Mullender (0.2 with latest |
| 8838 | patches). |
| 8839 | |
| 8840 | - nntplib.py: statparse() no longer lowercases the message-id. |
| 8841 | |
| 8842 | - types.py: use type(__stdin__) for FileType. |
| 8843 | |
| 8844 | - urllib.py: fix translations for filenames with "funny" characters. |
| 8845 | Patch by Sjoerd Mullender. Note that if you subclass one of the |
| 8846 | URLopener classes, and you have copied code from the old urllib.py, |
| 8847 | your subclass may stop working. A long-term solution is to provide |
| 8848 | more methods so that you don't have to copy code. |
| 8849 | |
| 8850 | - cgi.py: In read_multi, allow a subclass to override the class we |
| 8851 | instantiate when we create a recursive instance, by setting the class |
| 8852 | variable 'FieldStorageClass' to the desired class. By default, this |
| 8853 | is set to None, in which case we use self.__class__ (as before). |
| 8854 | Also, a patch by Jim Fulton to pass additional arguments to recursive |
| 8855 | calls to the FieldStorage constructor from its read_multi method. |
| 8856 | |
| 8857 | - UserList.py: In __getslice__, use self.__class__ instead of |
| 8858 | UserList. |
| 8859 | |
| 8860 | - In SimpleHTTPServer.py, the server specified in test() should be |
| 8861 | BaseHTTPServer.HTTPServer, in case the request handler should want to |
| 8862 | reference the two attributes added by BaseHTTPServer.server_bind. (By |
| 8863 | Jeff Rush, for Bobo). Also open the file in binary mode, so serving |
| 8864 | images from a Windows box might actually work. |
| 8865 | |
| 8866 | - In CGIHTTPServer.py, the list of acceptable formats is -split- |
| 8867 | on spaces but -joined- on commas, resulting in double commas |
| 8868 | in the joined text. (By Jeff Rush.) |
| 8869 | |
| 8870 | - SocketServer.py, patch by Jeff Bauer: a minor change to declare two |
| 8871 | new threaded versions of Unix Server classes, using the ThreadingMixIn |
| 8872 | class: ThreadingUnixStreamServer, ThreadingUnixDatagramServer. |
| 8873 | |
| 8874 | - bdb.py: fix bomb on deleting a temporary breakpoint: there's no |
| 8875 | method do_delete(); do_clear() was meant. By Greg Ward. |
| 8876 | |
| 8877 | - getopt.py: accept a non-list sequence for the long options (request |
| 8878 | by Jack Jansen). Because it might be a common mistake to pass a |
| 8879 | single string, this situation is treated separately. Also added |
| 8880 | docstrings (copied from the library manual) and removed the (now |
| 8881 | redundant) module comments. |
| 8882 | |
| 8883 | - tempfile.py: improvements to avoid security leaks. |
| 8884 | |
| 8885 | - code.py: moved compile_command() to new module codeop.py. |
| 8886 | |
| 8887 | - pickle.py: support pickle format 1.3 (binary float added). By Jim |
| 8888 | Fulton. Also get rid of the undocumented obsolete Pickler dump_special |
| 8889 | method. |
| 8890 | |
| 8891 | - uu.py: Move 'import sys' to top of module, as noted by Tim Peters. |
| 8892 | |
| 8893 | - imaplib.py: fix problem with some versions of IMAP4 servers that |
| 8894 | choose to mix the case in their CAPABILITIES response. |
| 8895 | |
| 8896 | - cmp.py: use (f1, f2) as cache key instead of f1 + ' ' + f2. Noted |
| 8897 | by Fredrik Lundh. |
| 8898 | |
| 8899 | Changes to extension modules |
| 8900 | ---------------------------- |
| 8901 | |
| 8902 | - More doc strings for several modules were contributed by Chris |
| 8903 | Petrilli: math, cmath, fcntl. |
| 8904 | |
| 8905 | - Fixed a bug in zlibmodule.c that could cause core dumps on |
| 8906 | decompression of rarely occurring input. |
| 8907 | |
| 8908 | - cPickle.c: new version from Jim Fulton, with Open Source copyright |
| 8909 | notice. Also, initialize self->safe_constructors early on to prevent |
| 8910 | crash in early dealloc. |
| 8911 | |
| 8912 | - cStringIO.c: new version from Jim Fulton, with Open Source copyright |
| 8913 | notice. Also fixed a core dump in cStringIO.c when doing seeks. |
| 8914 | |
| 8915 | - mpzmodule.c: fix signed character usage in mpz.mpz(stringobjecty). |
| 8916 | |
| 8917 | - readline.c: Bernard Herzog pointed out that rl_parse_and_bind |
| 8918 | modifies its argument string (bad function!), so we make a temporary |
| 8919 | copy. |
| 8920 | |
| 8921 | - sunaudiodev.c: Barry Warsaw added more smarts to get the device and |
| 8922 | control pseudo-device, per audio(7I). |
| 8923 | |
| 8924 | Changes to tools |
| 8925 | ---------------- |
| 8926 | |
| 8927 | - New, improved version of Barry Warsaw's Misc/python-mode.el (editing |
| 8928 | support for Emacs). |
| 8929 | |
| 8930 | - tabnanny.py: added a -q ('quiet') option to tabnanny, which causes |
| 8931 | only the names of offending files to be printed. |
| 8932 | |
| 8933 | - freeze: when printing missing modules, also print the module they |
| 8934 | were imported from. |
| 8935 | |
| 8936 | - untabify.py: patch by Detlef Lannert to implement -t option |
| 8937 | (set tab size). |
| 8938 | |
| 8939 | Changes to Tkinter |
| 8940 | ------------------ |
| 8941 | |
| 8942 | - grid_bbox(): support new Tk API: grid bbox ?column row? ?column2 |
| 8943 | row2? |
| 8944 | |
| 8945 | - _tkinter.c: RajGopal Srinivasan noted that the latest code (1.5.2a2) |
| 8946 | doesn't work when running in a non-threaded environment. He added |
| 8947 | some #ifdefs that fix this. |
| 8948 | |
| 8949 | Changes to the Python/C API |
| 8950 | --------------------------- |
| 8951 | |
| 8952 | - Bumped API version number to 1008 -- enough things have changed! |
| 8953 | |
| 8954 | - There's a new macro, PyThreadState_GET(), which does the same work |
| 8955 | as PyThreadState_Get() without the overhead of a function call (it |
| 8956 | also avoids the error check). The two top calling locations of |
| 8957 | PyThreadState_Get() have been changed to use this macro. |
| 8958 | |
| 8959 | - All symbols intended for export from a DLL or shared library are now |
| 8960 | marked as such (with the DL_IMPORT() macro) in the header file that |
| 8961 | declares them. This was needed for the BeOS port, and should also |
| 8962 | make some other ports easier. The PC port no longer needs the file |
| 8963 | with exported symbols (PC/python_nt.def). There's also a DL_EXPORT |
| 8964 | macro which is only used for init methods in extension modules, and |
| 8965 | for Py_Main(). |
| 8966 | |
| 8967 | Invisible changes to internals |
| 8968 | ------------------------------ |
| 8969 | |
| 8970 | - Fixed a bug in new_buffersize() in fileobject.c which could |
| 8971 | return a buffer size that was way too large. |
| 8972 | |
| 8973 | - Use PySys_WriteStderr instead of fprintf in most places. |
| 8974 | |
| 8975 | - dictobject.c: remove dead code discovered by Vladimir Marangozov. |
| 8976 | |
| 8977 | - tupleobject.c: make tuples less hungry -- an extra item was |
| 8978 | allocated but never used. Tip by Vladimir Marangozov. |
| 8979 | |
| 8980 | - mymath.h: Metrowerks PRO4 finally fixes the hypot snafu. (Jack |
| 8981 | Jansen) |
| 8982 | |
| 8983 | - import.c: Jim Fulton fixes a reference count bug in |
| 8984 | PyEval_GetGlobals. |
| 8985 | |
| 8986 | - glmodule.c: check in the changed version after running the stubber |
| 8987 | again -- this solves the conflict with curses over the 'clear' entry |
| 8988 | point much nicer. (Jack Jansen had checked in the changes to cstubs |
| 8989 | eons ago, but I never regenrated glmodule.c :-( ) |
| 8990 | |
| 8991 | - frameobject.c: fix reference count bug in PyFrame_New. Vladimir |
| 8992 | Marangozov. |
| 8993 | |
| 8994 | - stropmodule.c: add a missing DECREF in an error exit. Submitted by |
| 8995 | Jonathan Giddy. |
| 8996 | |
| 8997 | |
| 8998 | ====================================================================== |
| 8999 | |
| 9000 | |
| 9001 | From 1.5.2a1 to 1.5.2a2 |
| 9002 | ======================= |
| 9003 | |
| 9004 | General |
| 9005 | ------- |
| 9006 | |
| 9007 | - It is now a syntax error to have a function argument without a |
| 9008 | default following one with a default. |
| 9009 | |
| 9010 | - __file__ is now set to the .py file if it was parsed (it used to |
| 9011 | always be the .pyc/.pyo file). |
| 9012 | |
| 9013 | - Don't exit with a fatal error during initialization when there's a |
| 9014 | problem with the exceptions.py module. |
| 9015 | |
| 9016 | - New environment variable PYTHONOPTIMIZE can be used to set -O. |
| 9017 | |
| 9018 | - New version of python-mode.el for Emacs. |
| 9019 | |
| 9020 | Miscellaneous fixed bugs |
| 9021 | ------------------------ |
| 9022 | |
| 9023 | - No longer print the (confusing) error message about stack underflow |
| 9024 | while compiling. |
| 9025 | |
| 9026 | - Some threading and locking bugs fixed. |
| 9027 | |
| 9028 | - When errno is zero, report "Error", not "Success". |
| 9029 | |
| 9030 | Documentation |
| 9031 | ------------- |
| 9032 | |
| 9033 | - Documentation will be released separately. |
| 9034 | |
| 9035 | - Doc strings added to array and md5 modules by Chris Petrilli. |
| 9036 | |
| 9037 | Ports and build procedure |
| 9038 | ------------------------- |
| 9039 | |
| 9040 | - Stop installing when a move or copy fails. |
| 9041 | |
| 9042 | - New version of the OS/2 port code by Jeff Rush. |
| 9043 | |
| 9044 | - The makesetup script handles absolute filenames better. |
| 9045 | |
| 9046 | - The 'new' module is now enabled by default in the Setup file. |
| 9047 | |
| 9048 | - I *think* I've solved the problem with the Linux build blowing up |
| 9049 | sometimes due to a conflict between sigcheck/intrcheck and |
| 9050 | signalmodule. |
| 9051 | |
| 9052 | Built-in functions |
| 9053 | ------------------ |
| 9054 | |
| 9055 | - The second argument to apply() can now be any sequence, not just a |
| 9056 | tuple. |
| 9057 | |
| 9058 | Built-in types |
| 9059 | -------------- |
| 9060 | |
| 9061 | - Lists have a new method: L1.extend(L2) is equivalent to the common |
| 9062 | idiom L1[len(L1):] = L2. |
| 9063 | |
| 9064 | - Better error messages when a sequence is indexed with a non-integer. |
| 9065 | |
| 9066 | - Bettter error message when calling a non-callable object (include |
| 9067 | the type in the message). |
| 9068 | |
| 9069 | Python services |
| 9070 | --------------- |
| 9071 | |
| 9072 | - New version of cPickle.c fixes some bugs. |
| 9073 | |
| 9074 | - pickle.py: improved instantiation error handling. |
| 9075 | |
| 9076 | - code.py: reworked quite a bit. New base class |
| 9077 | InteractiveInterpreter and derived class InteractiveConsole. Fixed |
| 9078 | several problems in compile_command(). |
| 9079 | |
| 9080 | - py_compile.py: print error message and continue on syntax errors. |
| 9081 | Also fixed an old bug with the fstat code (it was never used). |
| 9082 | |
| 9083 | - pyclbr.py: support submodules of packages. |
| 9084 | |
| 9085 | String Services |
| 9086 | --------------- |
| 9087 | |
| 9088 | - StringIO.py: raise the right exception (ValueError) for attempted |
| 9089 | I/O on closed StringIO objects. |
| 9090 | |
| 9091 | - re.py: fixed a bug in subn(), which caused .groups() to fail inside |
| 9092 | the replacement function called by sub(). |
| 9093 | |
| 9094 | - The struct module has a new format 'P': void * in native mode. |
| 9095 | |
| 9096 | Generic OS Services |
| 9097 | ------------------- |
| 9098 | |
| 9099 | - Module time: Y2K robustness. 2-digit year acceptance depends on |
| 9100 | value of time.accept2dyear, initialized from env var PYTHONY2K, |
| 9101 | default 0. Years 00-68 mean 2000-2068, while 69-99 mean 1969-1999 |
| 9102 | (POSIX or X/Open recommendation). |
| 9103 | |
| 9104 | - os.path: normpath(".//x") should return "x", not "/x". |
| 9105 | |
| 9106 | - getpass.py: fall back on default_getpass() when sys.stdin.fileno() |
| 9107 | doesn't work. |
| 9108 | |
| 9109 | - tempfile.py: regenerate the template after a fork() call. |
| 9110 | |
| 9111 | Optional OS Services |
| 9112 | -------------------- |
| 9113 | |
| 9114 | - In the signal module, disable restarting interrupted system calls |
| 9115 | when we have siginterrupt(). |
| 9116 | |
| 9117 | Debugger |
| 9118 | -------- |
| 9119 | |
| 9120 | - No longer set __args__; this feature is no longer supported and can |
| 9121 | affect the debugged code. |
| 9122 | |
| 9123 | - cmd.py, pdb.py and bdb.py have been overhauled by Richard Wolff, who |
| 9124 | added aliases and some other useful new features, e.g. much better |
| 9125 | breakpoint support: temporary breakpoint, disabled breakpoints, |
| 9126 | breakpoints with ignore counts, and conditions; breakpoints can be set |
| 9127 | on a file before it is loaded. |
| 9128 | |
| 9129 | Profiler |
| 9130 | -------- |
| 9131 | |
| 9132 | - Changes so that JPython can use it. Also fix the calibration code |
| 9133 | so it actually works again |
| 9134 | . |
| 9135 | Internet Protocols and Support |
| 9136 | ------------------------------ |
| 9137 | |
| 9138 | - imaplib.py: new version from Piers Lauder. |
| 9139 | |
| 9140 | - smtplib.py: change sendmail() method to accept a single string or a |
| 9141 | list or strings as the destination (commom newbie mistake). |
| 9142 | |
| 9143 | - poplib.py: LIST with a msg argument fixed. |
| 9144 | |
| 9145 | - urlparse.py: some optimizations for common case (http). |
| 9146 | |
| 9147 | - urllib.py: support content-length in info() for ftp protocol; |
| 9148 | support for a progress meter through a third argument to |
| 9149 | urlretrieve(); commented out gopher test (the test site is dead). |
| 9150 | |
| 9151 | Internet Data handling |
| 9152 | ---------------------- |
| 9153 | |
| 9154 | - sgmllib.py: support tags with - or . in their name. |
| 9155 | |
| 9156 | - mimetypes.py: guess_type() understands 'data' URLs. |
| 9157 | |
| 9158 | Restricted Execution |
| 9159 | -------------------- |
| 9160 | |
| 9161 | - The classes rexec.RModuleLoader and rexec.RModuleImporter no |
| 9162 | longer exist. |
| 9163 | |
| 9164 | Tkinter |
| 9165 | ------- |
| 9166 | |
| 9167 | - When reporting an exception, store its info in sys.last_*. Also, |
| 9168 | write all of it to stderr. |
| 9169 | |
| 9170 | - Added NS, EW, and NSEW constants, for grid's sticky option. |
| 9171 | |
| 9172 | - Fixed last-minute bug in 1.5.2a1 release: need to include "mytime.h". |
| 9173 | |
| 9174 | - Make bind variants without a sequence return a tuple of sequences |
| 9175 | (formerly it returned a string, which wasn't very convenient). |
| 9176 | |
| 9177 | - Add image commands to the Text widget (these are new in Tk 8.0). |
| 9178 | |
| 9179 | - Added new listbox and canvas methods: {xview,yview}_{scroll,moveto}.) |
| 9180 | |
| 9181 | - Improved the thread code (but you still can't call update() from |
| 9182 | another thread on Windows). |
| 9183 | |
| 9184 | - Fixed unnecessary references to _default_root in the new dialog |
| 9185 | modules. |
| 9186 | |
| 9187 | - Miscellaneous problems fixed. |
| 9188 | |
| 9189 | |
| 9190 | Windows General |
| 9191 | --------------- |
| 9192 | |
| 9193 | - Call LoadLibraryEx(..., ..., LOAD_WITH_ALTERED_SEARCH_PATH) to |
| 9194 | search for dependent dlls in the directory containing the .pyd. |
| 9195 | |
| 9196 | - In debugging mode, call DebugBreak() in Py_FatalError(). |
| 9197 | |
| 9198 | Windows Installer |
| 9199 | ----------------- |
| 9200 | |
| 9201 | - Install zlib.dll in the DLLs directory instead of in the win32 |
| 9202 | system directory, to avoid conflicts with other applications that have |
| 9203 | their own zlib.dll. |
| 9204 | |
| 9205 | Test Suite |
| 9206 | ---------- |
| 9207 | |
| 9208 | - test_long.py: new test for long integers, by Tim Peters. |
| 9209 | |
| 9210 | - regrtest.py: improved so it can be used for other test suites as |
| 9211 | well. |
| 9212 | |
| 9213 | - test_strftime.py: use re to compare test results, to support legal |
| 9214 | variants (e.g. on Linux). |
| 9215 | |
| 9216 | Tools and Demos |
| 9217 | --------------- |
| 9218 | |
| 9219 | - Four new scripts in Tools/scripts: crlf.py and lfcr.py (to |
| 9220 | remove/add Windows style '\r\n' line endings), untabify.py (to remove |
| 9221 | tabs), and rgrep.yp (reverse grep). |
| 9222 | |
| 9223 | - Improvements to Tools/freeze/. Each Python module is now written to |
| 9224 | its own C file. This prevents some compilers or assemblers from |
| 9225 | blowing up on large frozen programs, and saves recompilation time if |
| 9226 | only a few modules are changed. Other changes too, e.g. new command |
| 9227 | line options -x and -i. |
| 9228 | |
| 9229 | - Much improved (and smaller!) version of Tools/scripts/mailerdaemon.py. |
| 9230 | |
| 9231 | Python/C API |
| 9232 | ------------ |
| 9233 | |
| 9234 | - New mechanism to support extensions of the type object while |
| 9235 | remaining backward compatible with extensions compiled for previous |
| 9236 | versions of Python 1.5. A flags field indicates presence of certain |
| 9237 | fields. |
| 9238 | |
| 9239 | - Addition to the buffer API to differentiate access to bytes and |
| 9240 | 8-bit characters (in anticipation of Unicode characters). |
| 9241 | |
| 9242 | - New argument parsing format t# ("text") to indicate 8-bit |
| 9243 | characters; s# simply means 8-bit bytes, for backwards compatibility. |
| 9244 | |
| 9245 | - New object type, bufferobject.c is an example and can be used to |
| 9246 | create buffers from memory. |
| 9247 | |
| 9248 | - Some support for 64-bit longs, including some MS platforms. |
| 9249 | |
| 9250 | - Many calls to fprintf(stderr, ...) have been replaced with calls to |
| 9251 | PySys_WriteStderr(...). |
| 9252 | |
| 9253 | - The calling context for PyOS_Readline() has changed: it must now be |
| 9254 | called with the interpreter lock held! It releases the lock around |
| 9255 | the call to the function pointed to by PyOS_ReadlineFunctionPointer |
| 9256 | (default PyOS_StdioReadline()). |
| 9257 | |
| 9258 | - New APIs PyLong_FromVoidPtr() and PyLong_AsVoidPtr(). |
| 9259 | |
| 9260 | - Renamed header file "thread.h" to "pythread.h". |
| 9261 | |
| 9262 | - The code string of code objects may now be anything that supports the |
| 9263 | buffer API. |
| 9264 | |
| 9265 | |
| 9266 | ====================================================================== |
| 9267 | |
| 9268 | |
| 9269 | From 1.5.1 to 1.5.2a1 |
| 9270 | ===================== |
| 9271 | |
| 9272 | General |
| 9273 | ------- |
| 9274 | |
| 9275 | - When searching for the library, a landmark that is a compiled module |
| 9276 | (string.pyc or string.pyo) is also accepted. |
| 9277 | |
| 9278 | - When following symbolic links to the python executable, use a loop |
| 9279 | so that a symlink to a symlink can work. |
| 9280 | |
| 9281 | - Added a hack so that when you type 'quit' or 'exit' at the |
| 9282 | interpreter, you get a friendly explanation of how to press Ctrl-D (or |
| 9283 | Ctrl-Z) to exit. |
| 9284 | |
| 9285 | - New and improved Misc/python-mode.el (Python mode for Emacs). |
| 9286 | |
| 9287 | - Revert a new feature in Unix dynamic loading: for one or two |
| 9288 | revisions, modules were loaded using the RTLD_GLOBAL flag. It turned |
| 9289 | out to be a bad idea. |
| 9290 | |
| 9291 | Miscellaneous fixed bugs |
| 9292 | ------------------------ |
| 9293 | |
| 9294 | - All patches on the patch page have been integrated. (But much more |
| 9295 | has been done!) |
| 9296 | |
| 9297 | - Several memory leaks plugged (e.g. the one for classes with a |
| 9298 | __getattr__ method). |
| 9299 | |
| 9300 | - Removed the only use of calloc(). This triggered an obscure bug on |
| 9301 | multiprocessor Sparc Solaris 2.6. |
| 9302 | |
| 9303 | - Fix a peculiar bug that would allow "import sys.time" to succeed |
| 9304 | (believing the built-in time module to be a part of the sys package). |
| 9305 | |
| 9306 | - Fix a bug in the overflow checking when converting a Python long to |
| 9307 | a C long (failed to convert -2147483648L, and some other cases). |
| 9308 | |
| 9309 | Documentation |
| 9310 | ------------- |
| 9311 | |
| 9312 | - Doc strings have been added to many extension modules: __builtin__, |
| 9313 | errno, select, signal, socket, sys, thread, time. Also to methods of |
| 9314 | list objects (try [].append.__doc__). A doc string on a type will now |
| 9315 | automatically be propagated to an instance if the instance has methods |
| 9316 | that are accessed in the usual way. |
| 9317 | |
| 9318 | - The documentation has been expanded and the formatting improved. |
| 9319 | (Remember that the documentation is now unbundled and has its own |
| 9320 | release cycle though; see http://www.python.org/doc/.) |
| 9321 | |
| 9322 | - Added Misc/Porting -- a mini-FAQ on porting to a new platform. |
| 9323 | |
| 9324 | Ports and build procedure |
| 9325 | ------------------------- |
| 9326 | |
| 9327 | - The BeOS port is now integrated. Courtesy Chris Herborth. |
| 9328 | |
| 9329 | - Symbol files for FreeBSD 2.x and 3.x have been contributed |
| 9330 | (Lib/plat-freebsd[23]/*). |
| 9331 | |
| 9332 | - Support HPUX 10.20 DCE threads. |
| 9333 | |
| 9334 | - Finally fixed the configure script so that (on SGI) if -OPT:Olimit=0 |
| 9335 | works, it won't also use -Olimit 1500 (which gives a warning for every |
| 9336 | file). Also support the SGI_ABI environment variable better. |
| 9337 | |
| 9338 | - The makesetup script now understands absolute pathnames ending in .o |
| 9339 | in the module -- it assumes it's a file for which we have no source. |
| 9340 | |
| 9341 | - Other miscellaneous improvements to the configure script and |
| 9342 | Makefiles. |
| 9343 | |
| 9344 | - The test suite now uses a different sound sample. |
| 9345 | |
| 9346 | Built-in functions |
| 9347 | ------------------ |
| 9348 | |
| 9349 | - Better checks for invalid input to int(), long(), string.atoi(), |
| 9350 | string.atol(). (Formerly, a sign without digits would be accepted as |
| 9351 | a legal ways to spell zero.) |
| 9352 | |
| 9353 | - Changes to map() and filter() to use the length of a sequence only |
| 9354 | as a hint -- if an IndexError happens earlier, take that. (Formerly, |
| 9355 | this was considered an error.) |
| 9356 | |
| 9357 | - Experimental feature in getattr(): a third argument can specify a |
| 9358 | default (instead of raising AttributeError). |
| 9359 | |
| 9360 | - Implement round() slightly different, so that for negative ndigits |
| 9361 | no additional errors happen in the last step. |
| 9362 | |
| 9363 | - The open() function now adds the filename to the exception when it |
| 9364 | fails. |
| 9365 | |
| 9366 | Built-in exceptions |
| 9367 | ------------------- |
| 9368 | |
| 9369 | - New standard exceptions EnvironmentError and PosixError. |
| 9370 | EnvironmentError is the base class for IOError and PosixError; |
| 9371 | PosixError is the same as os.error. All this so that either exception |
| 9372 | class can be instantiated with a third argument indicating a filename. |
| 9373 | The built-in function open() and most os/posix functions that take a |
| 9374 | filename argument now use this. |
| 9375 | |
| 9376 | Built-in types |
| 9377 | -------------- |
| 9378 | |
| 9379 | - List objects now have an experimental pop() method; l.pop() returns |
| 9380 | and removes the last item; l.pop(i) returns and removes the item at |
| 9381 | i. Also, the sort() method is faster again. Sorting is now also |
| 9382 | safer: it is impossible for the sorting function to modify the list |
| 9383 | while the sort is going on (which could cause core dumps). |
| 9384 | |
| 9385 | - Changes to comparisons: numbers are now smaller than any other type. |
| 9386 | This is done to prevent the circularity where [] < 0L < 1 < [] is |
| 9387 | true. As a side effect, cmp(None, 0) is now positive instead of |
| 9388 | negative. This *shouldn't* affect any working code, but I've found |
| 9389 | that the change caused several "sleeping" bugs to become active, so |
| 9390 | beware! |
| 9391 | |
| 9392 | - Instance methods may now have other callable objects than just |
| 9393 | Python functions as their im_func. Use new.instancemethod() or write |
| 9394 | your own C code to create them; new.instancemethod() may be called |
| 9395 | with None for the instance to create an unbound method. |
| 9396 | |
| 9397 | - Assignment to __name__, __dict__ or __bases__ of a class object is |
| 9398 | now allowed (with stringent type checks); also allow assignment to |
| 9399 | __getattr__ etc. The cached values for __getattr__ etc. are |
| 9400 | recomputed after such assignments (but not for derived classes :-( ). |
| 9401 | |
| 9402 | - Allow assignment to some attributes of function objects: func_code, |
| 9403 | func_defaults and func_doc / __doc__. (With type checks except for |
| 9404 | __doc__ / func_doc .) |
| 9405 | |
| 9406 | Python services |
| 9407 | --------------- |
| 9408 | |
| 9409 | - New tests (in Lib/test): reperf.py (regular expression benchmark), |
| 9410 | sortperf.py (list sorting benchmark), test_MimeWriter.py (test case |
| 9411 | for the MimeWriter module). |
| 9412 | |
| 9413 | - Generalized test/regrtest.py so that it is useful for testing other |
| 9414 | packages. |
| 9415 | |
| 9416 | - The ihooks.py module now understands package imports. |
| 9417 | |
| 9418 | - In code.py, add a class that subsumes Fredrik Lundh's |
| 9419 | PythonInterpreter class. The interact() function now uses this. |
| 9420 | |
| 9421 | - In rlcompleter.py, in completer(), return None instead of raising an |
| 9422 | IndexError when there are no more completions left. |
| 9423 | |
| 9424 | - Fixed the marshal module to test for certain common kinds of invalid |
| 9425 | input. (It's still not foolproof!) |
| 9426 | |
| 9427 | - In the operator module, add an alias (now the preferred name) |
| 9428 | "contains" for "sequenceincludes". |
| 9429 | |
| 9430 | String Services |
| 9431 | --------------- |
| 9432 | |
| 9433 | - In the string and strop modules, in the replace() function, treat an |
| 9434 | empty pattern as an error (since it's not clear what was meant!). |
| 9435 | |
| 9436 | - Some speedups to re.py, especially the string substitution and split |
| 9437 | functions. Also added new function/method findall(), to find all |
| 9438 | occurrences of a given substring. |
| 9439 | |
| 9440 | - In cStringIO, add better argument type checking and support the |
| 9441 | readonly 'closed' attribute (like regular files). |
| 9442 | |
| 9443 | - In the struct module, unsigned 1-2 byte sized formats no longer |
| 9444 | result in long integer values. |
| 9445 | |
| 9446 | Miscellaneous services |
| 9447 | ---------------------- |
| 9448 | |
| 9449 | - In whrandom.py, added new method and function randrange(), same as |
| 9450 | choice(range(start, stop, step)) but faster. This addresses the |
| 9451 | problem that randint() was accidentally defined as taking an inclusive |
| 9452 | range. Also, randint(a, b) is now redefined as randrange(a, b+1), |
| 9453 | adding extra range and type checking to its arguments! |
| 9454 | |
| 9455 | - Add some semi-thread-safety to random.gauss() (it used to be able to |
| 9456 | crash when invoked from separate threads; now the worst it can do is |
| 9457 | give a duplicate result occasionally). |
| 9458 | |
| 9459 | - Some restructuring and generalization done to cmd.py. |
| 9460 | |
| 9461 | - Major upgrade to ConfigParser.py; converted to using 're', added new |
| 9462 | exceptions, support underscore in section header and option name. No |
| 9463 | longer add 'name' option to every section; instead, add '__name__'. |
| 9464 | |
| 9465 | - In getpass.py, don't use raw_input() to ask for the password -- we |
| 9466 | don't want it to show up in the readline history! Also don't catch |
| 9467 | interrupts (the try-finally already does all necessary cleanup). |
| 9468 | |
| 9469 | Generic OS Services |
| 9470 | ------------------- |
| 9471 | |
| 9472 | - New functions in os.py: makedirs(), removedirs(), renames(). New |
| 9473 | variable: linesep (the line separator as found in binary files, |
| 9474 | i.e. '\n' on Unix, '\r\n' on DOS/Windows, '\r' on Mac. Do *not* use |
| 9475 | this with files opened in (default) text mode; the line separator used |
| 9476 | will always be '\n'! |
| 9477 | |
| 9478 | - Changes to the 'os.path' submodule of os.py: added getsize(), |
| 9479 | getmtime(), getatime() -- these fetch the most popular items from the |
| 9480 | stat return tuple. |
| 9481 | |
| 9482 | - In the time module, add strptime(), if it exists. (This parses a |
| 9483 | time according to a format -- the inverse of strftime().) Also, |
| 9484 | remove the call to mktime() from strftime() -- it messed up the |
| 9485 | formatting of some non-local times. |
| 9486 | |
| 9487 | - In the socket module, added a new function gethostbyname_ex(). |
| 9488 | Also, don't use #ifdef to test for some symbols that are enums on some |
| 9489 | platforms (and should exist everywhere). |
| 9490 | |
| 9491 | Optional OS Services |
| 9492 | -------------------- |
| 9493 | |
| 9494 | - Some fixes to gzip.py. In particular, the readlines() method now |
| 9495 | returns the lines *with* trailing newline characters, like readlines() |
| 9496 | of regular file objects. Also, it didn't work together with cPickle; |
| 9497 | fixed that. |
| 9498 | |
| 9499 | - In whichdb.py, support byte-swapped dbhash (bsddb) files. |
| 9500 | |
| 9501 | - In anydbm.py, look at the type of an existing database to determine |
| 9502 | which module to use to open it. (The anydbm.error exception is now a |
| 9503 | tuple.) |
| 9504 | |
| 9505 | Unix Services |
| 9506 | ------------- |
| 9507 | |
| 9508 | - In the termios module, in tcsetattr(), initialize the structure vy |
| 9509 | calling tcgetattr(). |
| 9510 | |
| 9511 | - Added some of the "wait status inspection" macros as functions to |
| 9512 | the posix module (and thus to the os module): WEXITSTATUS(), |
| 9513 | WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(), WSTOPSIG(), WTERMSIG(). |
| 9514 | |
| 9515 | - In the syslog module, make the default facility more intuitive |
| 9516 | (matching the docs). |
| 9517 | |
| 9518 | Debugger |
| 9519 | -------- |
| 9520 | |
| 9521 | - In pdb.py, support for setting breaks on files/modules that haven't |
| 9522 | been loaded yet. |
| 9523 | |
| 9524 | Internet Protocols and Support |
| 9525 | ------------------------------ |
| 9526 | |
| 9527 | - Changes in urllib.py; sped up unquote() and quote(). Fixed an |
| 9528 | obscure bug in quote_plus(). Added urlencode(dict) -- convenience |
| 9529 | function for sending a POST request with urlopen(). Use the getpass |
| 9530 | module to ask for a password. Rewrote the (test) main program so that |
| 9531 | when used as a script, it can retrieve one or more URLs to stdout. |
| 9532 | Use -t to run the self-test. Made the proxy code work again. |
| 9533 | |
| 9534 | - In cgi.py, treat "HEAD" the same as "GET", so that CGI scripts don't |
| 9535 | fail when someone asks for their HEAD. Also, for POST, set the |
| 9536 | default content-type to application/x-www-form-urlencoded. Also, in |
| 9537 | FieldStorage.__init__(), when method='GET', always get the query |
| 9538 | string from environ['QUERY_STRING'] or sys.argv[1] -- ignore an |
| 9539 | explicitly passed in fp. |
| 9540 | |
| 9541 | - The smtplib.py module now supports ESMTP and has improved standard |
| 9542 | compliance, for picky servers. |
| 9543 | |
| 9544 | - Improved imaplib.py. |
| 9545 | |
| 9546 | - Fixed UDP support in SocketServer.py (it never worked). |
| 9547 | |
| 9548 | - Fixed a small bug in CGIHTTPServer.py. |
| 9549 | |
| 9550 | Internet Data handling |
| 9551 | ---------------------- |
| 9552 | |
| 9553 | - In rfc822.py, add a new class AddressList. Also support a new |
| 9554 | overridable method, isheader(). Also add a get() method similar to |
| 9555 | dictionaries (and make getheader() an alias for it). Also, be smarter |
| 9556 | about seekable (test whether fp.tell() works) and test for presence of |
| 9557 | unread() method before trying seeks. |
| 9558 | |
| 9559 | - In sgmllib.py, restore the call to report_unbalanced() that was lost |
| 9560 | long ago. Also some other improvements: handle <? processing |
| 9561 | instructions >, allow . and - in entity names, and allow \r\n as line |
| 9562 | separator. |
| 9563 | |
| 9564 | - Some restructuring and generalization done to multifile.py; support |
| 9565 | a 'seekable' flag. |
| 9566 | |
| 9567 | Restricted Execution |
| 9568 | -------------------- |
| 9569 | |
| 9570 | - Improvements to rexec.py: package support; support a (minimal) |
| 9571 | sys.exc_info(). Also made the (test) main program a bit fancier (you |
| 9572 | can now use it to run arbitrary Python scripts in restricted mode). |
| 9573 | |
| 9574 | Tkinter |
| 9575 | ------- |
| 9576 | |
| 9577 | - On Unix, Tkinter can now safely be used from a multi-threaded |
| 9578 | application. (Formerly, no threads would make progress while |
| 9579 | Tkinter's mainloop() was active, because it didn't release the Python |
| 9580 | interpreter lock.) Unfortunately, on Windows, threads other than the |
| 9581 | main thread should not call update() or update_idletasks() because |
| 9582 | this will deadlock the application. |
| 9583 | |
| 9584 | - An interactive interpreter that uses readline and Tkinter no longer |
| 9585 | uses up all available CPU time. |
| 9586 | |
| 9587 | - Even if readline is not used, Tk windows created in an interactive |
| 9588 | interpreter now get continuously updated. (This even works in Windows |
| 9589 | as long as you don't hit a key.) |
| 9590 | |
| 9591 | - New demos in Demo/tkinter/guido/: brownian.py, redemo.py, switch.py. |
| 9592 | |
| 9593 | - No longer register Tcl_finalize() as a low-level exit handler. It |
| 9594 | may call back into Python, and that's a bad idea. |
| 9595 | |
| 9596 | - Allow binding of Tcl commands (given as a string). |
| 9597 | |
| 9598 | - Some minor speedups; replace explicitly coded getint() with int() in |
| 9599 | most places. |
| 9600 | |
| 9601 | - In FileDialog.py, remember the directory of the selected file, if |
| 9602 | given. |
| 9603 | |
| 9604 | - Change the names of all methods in the Wm class: they are now |
| 9605 | wm_title(), etc. The old names (title() etc.) are still defined as |
| 9606 | aliases. |
| 9607 | |
| 9608 | - Add a new method of interpreter objects, interpaddr(). This returns |
| 9609 | the address of the Tcl interpreter object, as an integer. Not very |
| 9610 | useful for the Python programmer, but this can be called by another C |
| 9611 | extension that needs to make calls into the Tcl/Tk C API and needs to |
| 9612 | get the address of the Tcl interpreter object. A simple cast of the |
| 9613 | return value to (Tcl_Interp *) will do the trick. |
| 9614 | |
| 9615 | Windows General |
| 9616 | --------------- |
| 9617 | |
| 9618 | - Don't insist on proper case for module source files if the filename |
| 9619 | is all uppercase (e.g. FOO.PY now matches foo; but FOO.py still |
| 9620 | doesn't). This should address problems with this feature on |
| 9621 | oldfashioned filesystems (Novell servers?). |
| 9622 | |
| 9623 | Windows Library |
| 9624 | --------------- |
| 9625 | |
| 9626 | - os.environ is now all uppercase, but accesses are case insensitive, |
| 9627 | and the putenv() calls made as a side effect of changing os.environ |
| 9628 | are case preserving. |
| 9629 | |
| 9630 | - Removed samefile(), sameopenfile(), samestat() from os.path (aka |
| 9631 | ntpath.py) -- these cannot be made to work reliably (at least I |
| 9632 | wouldn't know how). |
| 9633 | |
| 9634 | - Fixed os.pipe() so that it returns file descriptors acceptable to |
| 9635 | os.read() and os.write() (like it does on Unix), rather than Windows |
| 9636 | file handles. |
| 9637 | |
| 9638 | - Added a table of WSA error codes to socket.py. |
| 9639 | |
| 9640 | - In the select module, put the (huge) file descriptor arrays on the |
| 9641 | heap. |
| 9642 | |
| 9643 | - The getpass module now raises KeyboardInterrupt when it sees ^C. |
| 9644 | |
| 9645 | - In mailbox.py, fix tell/seek when using files opened in text mode. |
| 9646 | |
| 9647 | - In rfc822.py, fix tell/seek when using files opened in text mode. |
| 9648 | |
| 9649 | - In the msvcrt extension module, release the interpreter lock for |
| 9650 | calls that may block: _locking(), _getch(), _getche(). Also fix a |
| 9651 | bogus error return when open_osfhandle() doesn't have the right |
| 9652 | argument list. |
| 9653 | |
| 9654 | Windows Installer |
| 9655 | ----------------- |
| 9656 | |
| 9657 | - The registry key used is now "1.5" instead of "1.5.x" -- so future |
| 9658 | versions of 1.5 and Mark Hammond's win32all installer don't need to be |
| 9659 | resynchronized. |
| 9660 | |
| 9661 | Windows Tools |
| 9662 | ------------- |
| 9663 | |
| 9664 | - Several improvements to freeze specifically for Windows. |
| 9665 | |
| 9666 | Windows Build Procedure |
| 9667 | ----------------------- |
| 9668 | |
| 9669 | - The VC++ project files and the WISE installer have been moved to the |
| 9670 | PCbuild subdirectory, so they are distributed in the same subdirectory |
| 9671 | where they must be used. This avoids confusion. |
| 9672 | |
| 9673 | - New project files for Windows 3.1 port by Jim Ahlstrom. |
| 9674 | |
| 9675 | - Got rid of the obsolete subdirectory PC/setup_nt/. |
| 9676 | |
| 9677 | - The projects now use distinct filenames for the .exe, .dll, .lib and |
| 9678 | .pyd files built in debug mode (by appending "_d" to the base name, |
| 9679 | before the extension). This makes it easier to switch between the two |
| 9680 | and get the right versions. There's a pragma in config.h that directs |
| 9681 | the linker to include the appropriate .lib file (so python15.lib no |
| 9682 | longer needs to be explicit in your project). |
| 9683 | |
| 9684 | - The installer now installs more files (e.g. config.h). The idea is |
| 9685 | that you shouldn't need the source distribution if you want build your |
| 9686 | own extensions in C or C++. |
| 9687 | |
| 9688 | Tools and Demos |
| 9689 | --------------- |
| 9690 | |
| 9691 | - New script nm2def.py by Marc-Andre Lemburg, to construct |
| 9692 | PC/python_nt.def automatically (some hand editing still required). |
| 9693 | |
| 9694 | - New tool ndiff.py: Tim Peters' text diffing tool. |
| 9695 | |
| 9696 | - Various and sundry improvements to the freeze script. |
| 9697 | |
| 9698 | - The script texi2html.py (which was part of the Doc tree but is no |
| 9699 | longer used there) has been moved to the Tools/scripts subdirectory. |
| 9700 | |
| 9701 | - Some generalizations in the webchecker code. There's now a |
| 9702 | primnitive gui for websucker.py: wsgui.py. (In Tools/webchecker/.) |
| 9703 | |
| 9704 | - The ftpmirror.py script now handles symbolic links properly, and |
| 9705 | also files with multiple spaces in their names. |
| 9706 | |
| 9707 | - The 1.5.1 tabnanny.py suffers an assert error if fed a script whose |
| 9708 | last line is both indented and lacks a newline. This is now fixed. |
| 9709 | |
| 9710 | Python/C API |
| 9711 | ------------ |
| 9712 | |
| 9713 | - Added missing prototypes for PyEval_CallFunction() and |
| 9714 | PyEval_CallMethod(). |
| 9715 | |
| 9716 | - New macro PyList_SET_ITEM(). |
| 9717 | |
| 9718 | - New macros to access object members for PyFunction, PyCFunction |
| 9719 | objects. |
| 9720 | |
| 9721 | - New APIs PyImport_AppendInittab() an PyImport_ExtendInittab() to |
| 9722 | dynamically add one or many entries to the table of built-in modules. |
| 9723 | |
| 9724 | - New macro Py_InitModule3(name, methods, doc) which calls |
| 9725 | Py_InitModule4() with appropriate arguments. (The -4 variant requires |
| 9726 | you to pass an obscure version number constant which is always the same.) |
| 9727 | |
| 9728 | - New APIs PySys_WriteStdout() and PySys_WriteStderr() to write to |
| 9729 | sys.stdout or sys.stderr using a printf-like interface. (Used in |
| 9730 | _tkinter.c, for example.) |
| 9731 | |
| 9732 | - New APIs for conversion between Python longs and C 'long long' if |
| 9733 | your compiler supports it. |
| 9734 | |
| 9735 | - PySequence_In() is now called PySequence_Contains(). |
| 9736 | (PySequence_In() is still supported for b/w compatibility; it is |
| 9737 | declared obsolete because its argument order is confusing.) |
| 9738 | |
| 9739 | - PyDict_GetItem() and PyDict_GetItemString() are changed so that they |
| 9740 | *never* raise an exception -- (even if the hash() fails, simply clear |
| 9741 | the error). This was necessary because there is lots of code out |
| 9742 | there that already assumes this. |
| 9743 | |
| 9744 | - Changes to PySequence_Tuple() and PySequence_List() to use the |
| 9745 | length of a sequence only as a hint -- if an IndexError happens |
| 9746 | earlier, take that. (Formerly, this was considered an error.) |
| 9747 | |
| 9748 | - Reformatted abstract.c to give it a more familiar "look" and fixed |
| 9749 | many error checking bugs. |
| 9750 | |
| 9751 | - Add NULL pointer checks to all calls of a C function through a type |
| 9752 | object and extensions (e.g. nb_add). |
| 9753 | |
| 9754 | - The code that initializes sys.path now calls Py_GetPythonHome() |
| 9755 | instead of getenv("PYTHONHOME"). This, together with the new API |
| 9756 | Py_SetPythonHome(), makes it easier for embedding applications to |
| 9757 | change the notion of Python's "home" directory (where the libraries |
| 9758 | etc. are sought). |
| 9759 | |
| 9760 | - Fixed a very old bug in the parsing of "O?" format specifiers. |
| 9761 | |
| 9762 | |
| 9763 | ====================================================================== |
| 9764 | |
| 9765 | |
Guido van Rossum | f2eac99 | 2000-09-04 17:24:24 +0000 | [diff] [blame] | 9766 | ======================================== |
| 9767 | ==> Release 1.5.1 (October 31, 1998) <== |
| 9768 | ======================================== |
| 9769 | |
Guido van Rossum | 439d1fa | 1998-12-21 21:41:14 +0000 | [diff] [blame] | 9770 | From 1.5 to 1.5.1 |
| 9771 | ================= |
| 9772 | |
| 9773 | General |
| 9774 | ------- |
| 9775 | |
| 9776 | - The documentation is now unbundled. It has also been extensively |
| 9777 | modified (mostly to implement a new and more uniform formatting |
| 9778 | style). We figure that most people will prefer to download one of the |
| 9779 | preformatted documentation sets (HTML, PostScript or PDF) and that |
| 9780 | only a minority have a need for the LaTeX or FrameMaker sources. Of |
| 9781 | course, the unbundled documentation sources still released -- just not |
| 9782 | in the same archive file, and perhaps not on the same date. |
| 9783 | |
| 9784 | - All bugs noted on the errors page (and many unnoted) are fixed. All |
| 9785 | new bugs take their places. |
| 9786 | |
| 9787 | - No longer a core dump when attempting to print (or repr(), or str()) |
| 9788 | a list or dictionary that contains an instance of itself; instead, the |
| 9789 | recursive entry is printed as [...] or {...}. See Py_ReprEnter() and |
| 9790 | Py_ReprLeave() below. Comparisons of such objects still go beserk, |
| 9791 | since this requires a different kind of fix; fortunately, this is a |
| 9792 | less common scenario in practice. |
| 9793 | |
| 9794 | Syntax change |
| 9795 | ------------- |
| 9796 | |
| 9797 | - The raise statement can now be used without arguments, to re-raise |
| 9798 | a previously set exception. This should be used after catching an |
| 9799 | exception with an except clause only, either in the except clause or |
| 9800 | later in the same function. |
| 9801 | |
| 9802 | Import and module handling |
| 9803 | -------------------------- |
| 9804 | |
| 9805 | - The implementation of import has changed to use a mutex (when |
| 9806 | threading is supported). This means that when two threads |
| 9807 | simultaneously import the same module, the import statements are |
| 9808 | serialized. Recursive imports are not affected. |
| 9809 | |
| 9810 | - Rewrote the finalization code almost completely, to be much more |
| 9811 | careful with the order in which modules are destroyed. Destructors |
| 9812 | will now generally be able to reference built-in names such as None |
| 9813 | without trouble. |
| 9814 | |
| 9815 | - Case-insensitive platforms such as Mac and Windows require the case |
| 9816 | of a module's filename to match the case of the module name as |
| 9817 | specified in the import statement (see below). |
| 9818 | |
| 9819 | - The code for figuring out the default path now distinguishes between |
| 9820 | files, modules, executable files, and directories. When expecting a |
| 9821 | module, we also look for the .pyc or .pyo file. |
| 9822 | |
| 9823 | Parser/tokenizer changes |
| 9824 | ------------------------ |
| 9825 | |
| 9826 | - The tokenizer can now warn you when your source code mixes tabs and |
| 9827 | spaces for indentation in a manner that depends on how much a tab is |
| 9828 | worth in spaces. Use "python -t" or "python -v" to enable this |
| 9829 | option. Use "python -tt" to turn the warnings into errors. (See also |
| 9830 | tabnanny.py and tabpolice.py below.) |
| 9831 | |
| 9832 | - Return unsigned characters from tok_nextc(), so '\377' isn't |
| 9833 | mistaken for an EOF character. |
| 9834 | |
| 9835 | - Fixed two pernicious bugs in the tokenizer that only affected AIX. |
| 9836 | One was actually a general bug that was triggered by AIX's smaller I/O |
| 9837 | buffer size. The other was a bug in the AIX optimizer's loop |
| 9838 | unrolling code; swapping two statements made the problem go away. |
| 9839 | |
| 9840 | Tools, demos and miscellaneous files |
| 9841 | ------------------------------------ |
| 9842 | |
| 9843 | - There's a new version of Misc/python-mode.el (the Emacs mode for |
| 9844 | Python) which is much smarter about guessing the indentation style |
| 9845 | used in a particular file. Lots of other cool features too! |
| 9846 | |
| 9847 | - There are two new tools in Tools/scripts: tabnanny.py and |
| 9848 | tabpolice.py, implementing two different ways of checking whether a |
| 9849 | file uses indentation in a way that is sensitive to the interpretation |
| 9850 | of a tab. The preferred module is tabnanny.py (by Tim Peters). |
| 9851 | |
| 9852 | - Some new demo programs: |
| 9853 | |
| 9854 | Demo/tkinter/guido/paint.py -- Dave Mitchell |
| 9855 | Demo/sockets/unixserver.py -- Piet van Oostrum |
| 9856 | |
| 9857 | |
| 9858 | - Much better freeze support. The freeze script can now freeze |
| 9859 | hierarchical module names (with a corresponding change to import.c), |
| 9860 | and has a few extra options (e.g. to suppress freezing specific |
| 9861 | modules). It also does much more on Windows NT. |
| 9862 | |
| 9863 | - Version 1.0 of the faq wizard is included (only very small changes |
| 9864 | since version 0.9.0). |
| 9865 | |
| 9866 | - New feature for the ftpmirror script: when removing local files |
| 9867 | (i.e., only when -r is used), do a recursive delete. |
| 9868 | |
| 9869 | Configuring and building Python |
| 9870 | ------------------------------- |
| 9871 | |
| 9872 | - Get rid of the check for -linet -- recent Sequent Dynix systems don't |
| 9873 | need this any more and apparently it screws up their configuration. |
| 9874 | |
| 9875 | - Some changes because gcc on SGI doesn't support '-all'. |
| 9876 | |
| 9877 | - Changed the build rules to use $(LIBRARY) instead of |
| 9878 | -L.. -lpython$(VERSION) |
| 9879 | since the latter trips up the SunOS 4.1.x linker (sigh). |
| 9880 | |
| 9881 | - Fix the bug where the '# dgux is broken' comment in the Makefile |
| 9882 | tripped over Make on some platforms. |
| 9883 | |
| 9884 | - Changes for AIX: install the python.exp file; properly use |
| 9885 | $(srcdir); the makexp_aix script now removes C++ entries of the form |
| 9886 | Class::method. |
| 9887 | |
| 9888 | - Deleted some Makefile targets only used by the (long obsolete) |
| 9889 | gMakefile hacks. |
| 9890 | |
| 9891 | Extension modules |
| 9892 | ----------------- |
| 9893 | |
| 9894 | - Performance and threading improvements to the socket and bsddb |
| 9895 | modules, by Christopher Lindblad of Infoseek. |
| 9896 | |
| 9897 | - Added operator.__not__ and operator.not_. |
| 9898 | |
| 9899 | - In the thread module, when a thread exits due to an unhandled |
| 9900 | exception, don't store the exception information in sys.last_*; it |
| 9901 | prevents proper calling of destructors of local variables. |
| 9902 | |
| 9903 | - Fixed a number of small bugs in the cPickle module. |
| 9904 | |
| 9905 | - Changed find() and rfind() in the strop module so that |
| 9906 | find("x","",2) returns -1, matching the implementation in string.py. |
| 9907 | |
| 9908 | - In the time module, be more careful with the result of ctime(), and |
| 9909 | test for HAVE_MKTIME before usinmg mktime(). |
| 9910 | |
| 9911 | - Doc strings contributed by Mitch Chapman to the termios, pwd, gdbm |
| 9912 | modules. |
| 9913 | |
| 9914 | - Added the LOG_SYSLOG constant to the syslog module, if defined. |
| 9915 | |
| 9916 | Standard library modules |
| 9917 | ------------------------ |
| 9918 | |
| 9919 | - All standard library modules have been converted to an indentation |
| 9920 | style using either only tabs or only spaces -- never a mixture -- if |
| 9921 | they weren't already consistent according to tabnanny. This means |
| 9922 | that the new -t option (see above) won't complain about standard |
| 9923 | library modules. |
| 9924 | |
| 9925 | - New standard library modules: |
| 9926 | |
| 9927 | threading -- GvR and the thread-sig |
| 9928 | Java style thread objects -- USE THIS!!! |
| 9929 | |
| 9930 | getpass -- Piers Lauder |
| 9931 | simple utilities to prompt for a password and to |
| 9932 | retrieve the current username |
| 9933 | |
| 9934 | imaplib -- Piers Lauder |
| 9935 | interface for the IMAP4 protocol |
| 9936 | |
| 9937 | poplib -- David Ascher, Piers Lauder |
| 9938 | interface for the POP3 protocol |
| 9939 | |
| 9940 | smtplib -- Dragon De Monsyne |
| 9941 | interface for the SMTP protocol |
| 9942 | |
| 9943 | - Some obsolete modules moved to a separate directory (Lib/lib-old) |
| 9944 | which is *not* in the default module search path: |
| 9945 | |
| 9946 | Para |
| 9947 | addpack |
| 9948 | codehack |
| 9949 | fmt |
| 9950 | lockfile |
| 9951 | newdir |
| 9952 | ni |
| 9953 | rand |
| 9954 | tb |
| 9955 | |
| 9956 | - New version of the PCRE code (Perl Compatible Regular Expressions -- |
| 9957 | the re module and the supporting pcre extension) by Andrew Kuchling. |
| 9958 | Incompatible new feature in re.sub(): the handling of escapes in the |
| 9959 | replacement string has changed. |
| 9960 | |
| 9961 | - Interface change in the copy module: a __deepcopy__ method is now |
| 9962 | called with the memo dictionary as an argument. |
| 9963 | |
| 9964 | - Feature change in the tokenize module: differentiate between NEWLINE |
| 9965 | token (an official newline) and NL token (a newline that the grammar |
| 9966 | ignores). |
| 9967 | |
| 9968 | - Several bugfixes to the urllib module. It is now truly thread-safe, |
| 9969 | and several bugs and a portability problem have been fixed. New |
| 9970 | features, all due to Sjoerd Mullender: When creating a temporary file, |
| 9971 | it gives it an appropriate suffix. Support the "data:" URL scheme. |
| 9972 | The open() method uses the tempcache. |
| 9973 | |
| 9974 | - New version of the xmllib module (this time with a test suite!) by |
| 9975 | Sjoerd Mullender. |
| 9976 | |
| 9977 | - Added debugging code to the telnetlib module, to be able to trace |
| 9978 | the actual traffic. |
| 9979 | |
| 9980 | - In the rfc822 module, added support for deleting a header (still no |
| 9981 | support for adding headers, though). Also fixed a bug where an |
| 9982 | illegal address would cause a crash in getrouteaddr(), fixed a |
| 9983 | sign reversal in mktime_tz(), and use the local timezone by default |
| 9984 | (the latter two due to Bill van Melle). |
| 9985 | |
| 9986 | - The normpath() function in the dospath and ntpath modules no longer |
| 9987 | does case normalization -- for that, use the separate function |
| 9988 | normcase() (which always existed); normcase() has been sped up and |
| 9989 | fixed (it was the cause of a crash in Mark Hammond's installer in |
| 9990 | certain locales). |
| 9991 | |
| 9992 | - New command supported by the ftplib module: rmd(); also fixed some |
| 9993 | minor bugs. |
| 9994 | |
| 9995 | - The profile module now uses a different timer function by default -- |
| 9996 | time.clock() is generally better than os.times(). This makes it work |
| 9997 | better on Windows NT, too. |
| 9998 | |
| 9999 | - The tempfile module now recovers when os.getcwd() raises an |
| 10000 | exception. |
| 10001 | |
| 10002 | - Fixed some bugs in the random module; gauss() was subtly wrong, and |
| 10003 | vonmisesvariate() should return a full circle. Courtesy Mike Miller, |
| 10004 | Lambert Meertens (gauss()), and Magnus Kessler (vonmisesvariate()). |
| 10005 | |
| 10006 | - Better default seed in the whrandom module, courtesy Andrew Kuchling. |
| 10007 | |
| 10008 | - Fix slow close() in shelve module. |
| 10009 | |
| 10010 | - The Unix mailbox class in the mailbox module is now more robust when |
| 10011 | a line begins with the string "From " but is definitely not the start |
| 10012 | of a new message. The pattern used can be changed by overriding a |
| 10013 | method or class variable. |
| 10014 | |
| 10015 | - Added a rmtree() function to the copy module. |
| 10016 | |
| 10017 | - Fixed several typos in the pickle module. Also fixed problems when |
| 10018 | unpickling in restricted execution environments. |
| 10019 | |
| 10020 | - Added docstrings and fixed a typo in the py_compile and compileall |
| 10021 | modules. At Mark Hammond's repeated request, py_compile now append a |
| 10022 | newline to the source if it needs one. Both modules support an extra |
| 10023 | parameter to specify the purported source filename (to be used in |
| 10024 | error messages). |
| 10025 | |
| 10026 | - Some performance tweaks by Jeremy Hylton to the gzip module. |
| 10027 | |
| 10028 | - Fixed a bug in the merge order of dictionaries in the ConfigParser |
| 10029 | module. Courtesy Barry Warsaw. |
| 10030 | |
| 10031 | - In the multifile module, support the optional second parameter to |
| 10032 | seek() when possible. |
| 10033 | |
| 10034 | - Several fixes to the gopherlib module by Lars Marius Garshol. Also, |
| 10035 | urlparse now correctly handles Gopher URLs with query strings. |
| 10036 | |
| 10037 | - Fixed a tiny bug in format_exception() in the traceback module. |
| 10038 | Also rewrite tb_lineno() to be compatible with JPython (and not |
| 10039 | disturb the current exception!); by Jim Hugunin. |
| 10040 | |
| 10041 | - The httplib module is more robust when servers send a short response |
| 10042 | -- courtesy Tim O'Malley. |
| 10043 | |
| 10044 | Tkinter and friends |
| 10045 | ------------------- |
| 10046 | |
| 10047 | - Various typos and bugs fixed. |
| 10048 | |
| 10049 | - New module Tkdnd implements a drag-and-drop protocol (within one |
| 10050 | application only). |
| 10051 | |
| 10052 | - The event_*() widget methods have been restructured slightly -- they |
| 10053 | no longer use the default root. |
| 10054 | |
| 10055 | - The interfaces for the bind*() and unbind() widget methods have been |
| 10056 | redesigned; the bind*() methods now return the name of the Tcl command |
| 10057 | created for the callback, and this can be passed as a optional |
| 10058 | argument to unbind() in order to delete the command (normally, such |
| 10059 | commands are automatically unbound when the widget is destroyed, but |
| 10060 | for some applications this isn't enough). |
| 10061 | |
| 10062 | - Variable objects now have trace methods to interface to Tcl's |
| 10063 | variable tracing facilities. |
| 10064 | |
| 10065 | - Image objects now have an optional keyword argument, 'master', to |
| 10066 | specify a widget (tree) to which they belong. The image_names() and |
| 10067 | image_types() calls are now also widget methods. |
| 10068 | |
| 10069 | - There's a new global call, Tkinter.NoDefaultRoot(), which disables |
| 10070 | all use of the default root by the Tkinter library. This is useful to |
| 10071 | debug applications that are in the process of being converted from |
| 10072 | relying on the default root to explicit specification of the root |
| 10073 | widget. |
| 10074 | |
| 10075 | - The 'exit' command is deleted from the Tcl interpreter, since it |
| 10076 | provided a loophole by which one could (accidentally) exit the Python |
| 10077 | interpreter without invoking any cleanup code. |
| 10078 | |
| 10079 | - Tcl_Finalize() is now registered as a Python low-level exit handle, |
| 10080 | so Tcl will be finalized when Python exits. |
| 10081 | |
| 10082 | The Python/C API |
| 10083 | ---------------- |
| 10084 | |
| 10085 | - New function PyThreadState_GetDict() returns a per-thread dictionary |
| 10086 | intended for storing thread-local global variables. |
| 10087 | |
| 10088 | - New functions Py_ReprEnter() and Py_ReprLeave() use the per-thread |
| 10089 | dictionary to allow recursive container types to detect recursion in |
| 10090 | their repr(), str() and print implementations. |
| 10091 | |
| 10092 | - New function PyObject_Not(x) calculates (not x) according to Python's |
| 10093 | standard rules (basically, it negates the outcome PyObject_IsTrue(x). |
| 10094 | |
| 10095 | - New function _PyModule_Clear(), which clears a module's dictionary |
| 10096 | carefully without removing the __builtins__ entry. This is implied |
| 10097 | when a module object is deallocated (this used to clear the dictionary |
| 10098 | completely). |
| 10099 | |
| 10100 | - New function PyImport_ExecCodeModuleEx(), which extends |
| 10101 | PyImport_ExecCodeModule() by adding an extra parameter to pass it the |
| 10102 | true file. |
| 10103 | |
| 10104 | - New functions Py_GetPythonHome() and Py_SetPythonHome(), intended to |
| 10105 | allow embedded applications to force a different value for PYTHONHOME. |
| 10106 | |
| 10107 | - New global flag Py_FrozenFlag is set when this is a "frozen" Python |
| 10108 | binary; it suppresses warnings about not being able to find the |
| 10109 | standard library directories. |
| 10110 | |
| 10111 | - New global flag Py_TabcheckFlag is incremented by the -t option and |
| 10112 | causes the tokenizer to issue warnings or errors about inconsistent |
| 10113 | mixing of tabs and spaces for indentation. |
| 10114 | |
| 10115 | Miscellaneous minor changes and bug fixes |
| 10116 | ----------------------------------------- |
| 10117 | |
| 10118 | - Improved the error message when an attribute of an attribute-less |
| 10119 | object is requested -- include the name of the attribute and the type |
| 10120 | of the object in the message. |
| 10121 | |
| 10122 | - Sped up int(), long(), float() a bit. |
| 10123 | |
| 10124 | - Fixed a bug in list.sort() that would occasionally dump core. |
| 10125 | |
| 10126 | - Fixed a bug in PyNumber_Power() that caused numeric arrays to fail |
| 10127 | when taken tothe real power. |
| 10128 | |
| 10129 | - Fixed a number of bugs in the file reading code, at least one of |
| 10130 | which could cause a core dump on NT, and one of which would |
| 10131 | occasionally cause file.read() to return less than the full contents |
| 10132 | of the file. |
| 10133 | |
| 10134 | - Performance hack by Vladimir Marangozov for stack frame creation. |
| 10135 | |
| 10136 | - Make sure setvbuf() isn't used unless HAVE_SETVBUF is defined. |
| 10137 | |
| 10138 | Windows 95/NT |
| 10139 | ------------- |
| 10140 | |
| 10141 | - The .lib files are now part of the distribution; they are collected |
| 10142 | in the subdirectory "libs" of the installation directory. |
| 10143 | |
| 10144 | - The extension modules (.pyd files) are now collected in a separate |
| 10145 | subdirectory of the installation directory named "DLLs". |
| 10146 | |
| 10147 | - The case of a module's filename must now match the case of the |
| 10148 | module name as specified in the import statement. This is an |
| 10149 | experimental feature -- if it turns out to break in too many |
| 10150 | situations, it will be removed (or disabled by default) in the future. |
| 10151 | It can be disabled on a per-case basis by setting the environment |
| 10152 | variable PYTHONCASEOK (to any value). |
| 10153 | |
| 10154 | |
| 10155 | ====================================================================== |
| 10156 | |
| 10157 | |
Guido van Rossum | f2eac99 | 2000-09-04 17:24:24 +0000 | [diff] [blame] | 10158 | ===================================== |
| 10159 | ==> Release 1.5 (January 3, 1998) <== |
| 10160 | ===================================== |
| 10161 | |
| 10162 | |
Guido van Rossum | 439d1fa | 1998-12-21 21:41:14 +0000 | [diff] [blame] | 10163 | From 1.5b2 to 1.5 |
| 10164 | ================= |
| 10165 | |
| 10166 | - Newly documentated module: BaseHTTPServer.py, thanks to Greg Stein. |
| 10167 | |
| 10168 | - Added doc strings to string.py, stropmodule.c, structmodule.c, |
| 10169 | thanks to Charles Waldman. |
| 10170 | |
| 10171 | - Many nits fixed in the manuals, thanks to Fred Drake and many others |
| 10172 | (especially Rob Hooft and Andrew Kuchling). The HTML version now uses |
| 10173 | HTML markup instead of inline GIF images for tables; only two images |
| 10174 | are left (for obsure bits of math). The index of the HTML version has |
| 10175 | also been much improved. Finally, it is once again possible to |
| 10176 | generate an Emacs info file from the library manual (but I don't |
| 10177 | commit to supporting this in future versions). |
| 10178 | |
| 10179 | - New module: telnetlib.py (a simple telnet client library). |
| 10180 | |
| 10181 | - New tool: Tools/versioncheck/, by Jack Jansen. |
| 10182 | |
| 10183 | - Ported zlibmodule.c and bsddbmodule.c to NT; The project file for MS |
| 10184 | DevStudio 5.0 now includes new subprojects to build the zlib and bsddb |
| 10185 | extension modules. |
| 10186 | |
| 10187 | - Many small changes again to Tkinter.py -- mostly bugfixes and adding |
| 10188 | missing routines. Thanks to Greg McFarlane for reporting a bunch of |
| 10189 | problems and proofreading my fixes. |
| 10190 | |
| 10191 | - The re module and its documentation are up to date with the latest |
| 10192 | version released to the string-sig (Dec. 22). |
| 10193 | |
| 10194 | - Stop test_grp.py from failing when the /etc/group file is empty |
| 10195 | (yes, this happens!). |
| 10196 | |
| 10197 | - Fix bug in integer conversion (mystrtoul.c) that caused |
| 10198 | 4294967296==0 to be true! |
| 10199 | |
| 10200 | - The VC++ 4.2 project file should be complete again. |
| 10201 | |
| 10202 | - In tempfile.py, use a better template on NT, and add a new optional |
| 10203 | argument "suffix" with default "" to specify a specific extension for |
| 10204 | the temporary filename (needed sometimes on NT but perhaps also handy |
| 10205 | elsewhere). |
| 10206 | |
| 10207 | - Fixed some bugs in the FAQ wizard, and converted it to use re |
| 10208 | instead of regex. |
| 10209 | |
| 10210 | - Fixed a mysteriously undetected error in dlmodule.c (it was using a |
| 10211 | totally bogus routine name to raise an exception). |
| 10212 | |
| 10213 | - Fixed bug in import.c which wasn't using the new "dos-8x3" name yet. |
| 10214 | |
| 10215 | - Hopefully harmless changes to the build process to support shared |
| 10216 | libraries on DG/UX. This adds a target to create |
| 10217 | libpython$(VERSION).so; however this target is *only* for DG/UX. |
| 10218 | |
| 10219 | - Fixed a bug in the new format string error checking in getargs.c. |
| 10220 | |
| 10221 | - A simple fix for infinite recursion when printing __builtins__: |
| 10222 | reset '_' to None before printing and set it to the printed variable |
| 10223 | *after* printing (and only when printing is successful). |
| 10224 | |
| 10225 | - Fixed lib-tk/SimpleDialog.py to keep the dialog visible even if the |
| 10226 | parent window is not (Skip Montanaro). |
| 10227 | |
| 10228 | - Fixed the two most annoying problems with ftp URLs in |
| 10229 | urllib.urlopen(); an empty file now correctly raises an error, and it |
| 10230 | is no longer required to explicitly close the returned "file" object |
| 10231 | before opening another ftp URL to the same host and directory. |
| 10232 | |
| 10233 | |
| 10234 | ====================================================================== |
| 10235 | |
| 10236 | |
| 10237 | From 1.5b1 to 1.5b2 |
| 10238 | =================== |
| 10239 | |
| 10240 | - Fixed a bug in cPickle.c that caused it to crash right away because |
| 10241 | the version string had a different format. |
| 10242 | |
| 10243 | - Changes in pickle.py and cPickle.c: when unpickling an instance of a |
| 10244 | class that doesn't define the __getinitargs__() method, the __init__() |
| 10245 | constructor is no longer called. This makes a much larger group of |
| 10246 | classes picklable by default, but may occasionally change semantics. |
| 10247 | To force calling __init__() on unpickling, define a __getinitargs__() |
| 10248 | method. Other changes too, in particular cPickle now handles classes |
| 10249 | defined in packages correctly. The same change applies to copying |
| 10250 | instances with copy.py. The cPickle.c changes and some pickle.py |
| 10251 | changes are courtesy Jim Fulton. |
| 10252 | |
| 10253 | - Locale support in he "re" (Perl regular expressions) module. Use |
| 10254 | the flag re.L (or re.LOCALE) to enable locale-specific matching |
| 10255 | rules for \w and \b. The in-line syntax for this flag is (?L). |
| 10256 | |
| 10257 | - The built-in function isinstance(x, y) now also succeeds when y is |
| 10258 | a type object and type(x) is y. |
| 10259 | |
| 10260 | - repr() and str() of class and instance objects now reflect the |
| 10261 | package/module in which the class is defined. |
| 10262 | |
| 10263 | - Module "ni" has been removed. (If you really need it, it's been |
| 10264 | renamed to "ni1". Let me know if this causes any problems for you. |
| 10265 | Package authors are encouraged to write __init__.py files that |
| 10266 | support both ni and 1.5 package support, so the same version can be |
| 10267 | used with Python 1.4 as well as 1.5.) |
| 10268 | |
| 10269 | - The thread module is now automatically included when threads are |
| 10270 | configured. (You must remove it from your existing Setup file, |
| 10271 | since it is now in its own Setup.thread file.) |
| 10272 | |
| 10273 | - New command line option "-x" to skip the first line of the script; |
| 10274 | handy to make executable scripts on non-Unix platforms. |
| 10275 | |
| 10276 | - In importdl.c, add the RTLD_GLOBAL to the dlopen() flags. I |
| 10277 | haven't checked how this affects things, but it should make symbols |
| 10278 | in one shared library available to the next one. |
| 10279 | |
| 10280 | - The Windows installer now installs in the "Program Files" folder on |
| 10281 | the proper volume by default. |
| 10282 | |
| 10283 | - The Windows configuration adds a new main program, "pythonw", and |
| 10284 | registers a new extension, ".pyw" that invokes this. This is a |
| 10285 | pstandard Python interpreter that does not pop up a console window; |
| 10286 | handy for pure Tkinter applications. All output to the original |
| 10287 | stdout and stderr is lost; reading from the original stdin yields |
| 10288 | EOF. Also, both python.exe and pythonw.exe now have a pretty icon |
| 10289 | (a green snake in a box, courtesy Mark Hammond). |
| 10290 | |
| 10291 | - Lots of improvements to emacs-mode.el again. See Barry's web page: |
| 10292 | http://www.python.org/ftp/emacs/pmdetails.html. |
| 10293 | |
| 10294 | - Lots of improvements and additions to the library reference manual; |
| 10295 | many by Fred Drake. |
| 10296 | |
| 10297 | - Doc strings for the following modules: rfc822.py, posixpath.py, |
| 10298 | ntpath.py, httplib.py. Thanks to Mitch Chapman and Charles Waldman. |
| 10299 | |
| 10300 | - Some more regression testing. |
| 10301 | |
| 10302 | - An optional 4th (maxsplit) argument to strop.replace(). |
| 10303 | |
| 10304 | - Fixed handling of maxsplit in string.splitfields(). |
| 10305 | |
| 10306 | - Tweaked os.environ so it can be pickled and copied. |
| 10307 | |
| 10308 | - The portability problems caused by indented preprocessor commands |
| 10309 | and C++ style comments should be gone now. |
| 10310 | |
| 10311 | - In random.py, added Pareto and Weibull distributions. |
| 10312 | |
| 10313 | - The crypt module is now disabled in Modules/Setup.in by default; it |
| 10314 | is rarely needed and causes errors on some systems where users often |
| 10315 | don't know how to deal with those. |
| 10316 | |
| 10317 | - Some improvements to the _tkinter build line suggested by Case Roole. |
| 10318 | |
| 10319 | - A full suite of platform specific files for NetBSD 1.x, submitted by |
| 10320 | Anders Andersen. |
| 10321 | |
| 10322 | - New Solaris specific header STROPTS.py. |
| 10323 | |
| 10324 | - Moved a confusing occurrence of *shared* from the comments in |
| 10325 | Modules/Setup.in (people would enable this one instead of the real |
| 10326 | one, and get disappointing results). |
| 10327 | |
| 10328 | - Changed the default mode for directories to be group-writable when |
| 10329 | the installation process creates them. |
| 10330 | |
| 10331 | - Check for pthread support in "-l_r" for FreeBSD/NetBSD, and support |
| 10332 | shared libraries for both. |
| 10333 | |
| 10334 | - Support FreeBSD and NetBSD in posixfile.py. |
| 10335 | |
| 10336 | - Support for the "event" command, new in Tk 4.2. By Case Roole. |
| 10337 | |
| 10338 | - Add Tix_SafeInit() support to tkappinit.c. |
| 10339 | |
| 10340 | - Various bugs fixed in "re.py" and "pcre.c". |
| 10341 | |
| 10342 | - Fixed a bug (broken use of the syntax table) in the old "regexpr.c". |
| 10343 | |
| 10344 | - In frozenmain.c, stdin is made unbuffered too when PYTHONUNBUFFERED |
| 10345 | is set. |
| 10346 | |
| 10347 | - Provide default blocksize for retrbinary in ftplib.py (Skip |
| 10348 | Montanaro). |
| 10349 | |
| 10350 | - In NT, pick the username up from different places in user.py (Jeff |
| 10351 | Bauer). |
| 10352 | |
| 10353 | - Patch to urlparse.urljoin() for ".." and "..#1", Marc Lemburg. |
| 10354 | |
| 10355 | - Many small improvements to Jeff Rush' OS/2 support. |
| 10356 | |
| 10357 | - ospath.py is gone; it's been obsolete for so many years now... |
| 10358 | |
| 10359 | - The reference manual is now set up to prepare better HTML (still |
| 10360 | using webmaker, alas). |
| 10361 | |
| 10362 | - Add special handling to /Tools/freeze for Python modules that are |
| 10363 | imported implicitly by the Python runtime: 'site' and 'exceptions'. |
| 10364 | |
| 10365 | - Tools/faqwiz 0.8.3 -- add an option to suppress URL processing |
| 10366 | inside <PRE>, by "Scott". |
| 10367 | |
| 10368 | - Added ConfigParser.py, a generic parser for sectioned configuration |
| 10369 | files. |
| 10370 | |
| 10371 | - In _localemodule.c, LC_MESSAGES is not always defined; put it |
| 10372 | between #ifdefs. |
| 10373 | |
| 10374 | - Typo in resource.c: RUSAGE_CHILDERN -> RUSAGE_CHILDREN. |
| 10375 | |
| 10376 | - Demo/scripts/newslist.py: Fix the way the version number is gotten |
| 10377 | out of the RCS revision. |
| 10378 | |
| 10379 | - PyArg_Parse[Tuple] now explicitly check for bad characters at the |
| 10380 | end of the format string. |
| 10381 | |
| 10382 | - Revamped PC/example_nt to support VC++ 5.x. |
| 10383 | |
| 10384 | - <listobject>.sort() now uses a modified quicksort by Raymund Galvin, |
| 10385 | after studying the GNU libg++ quicksort. This should be much faster |
| 10386 | if there are lots of duplicates, and otherwise at least as good. |
| 10387 | |
| 10388 | - Added "uue" as an alias for "uuencode" to mimetools.py. (Hm, the |
| 10389 | uudecode bug where it complaints about trailing garbage is still there |
| 10390 | :-( ). |
| 10391 | |
| 10392 | - pickle.py requires integers in text mode to be in decimal notation |
| 10393 | (it used to accept octal and hex, even though it would only generate |
| 10394 | decimal numbers). |
| 10395 | |
| 10396 | - In string.atof(), don't fail when the "re" module is unavailable. |
| 10397 | Plug the ensueing security leak by supplying an empty __builtins__ |
| 10398 | directory to eval(). |
| 10399 | |
| 10400 | - A bunch of small fixes and improvements to Tkinter.py. |
| 10401 | |
| 10402 | - Fixed a buffer overrun in PC/getpathp.c. |
| 10403 | |
| 10404 | |
| 10405 | ====================================================================== |
| 10406 | |
| 10407 | |
| 10408 | From 1.5a4 to 1.5b1 |
| 10409 | =================== |
| 10410 | |
| 10411 | - The Windows NT/95 installer now includes full HTML of all manuals. |
| 10412 | It also has a checkbox that lets you decide whether to install the |
| 10413 | interpreter and library. The WISE installer script for the installer |
| 10414 | is included in the source tree as PC/python15.wse, and so are the |
| 10415 | icons used for Python files. The config.c file for the Windows build |
| 10416 | is now complete with the pcre module. |
| 10417 | |
| 10418 | - sys.ps1 and sys.ps2 can now arbitrary objects; their str() is |
| 10419 | evaluated for the prompt. |
| 10420 | |
| 10421 | - The reference manual is brought up to date (more or less -- it still |
| 10422 | needs work, e.g. in the area of package import). |
| 10423 | |
| 10424 | - The icons used by latex2html are now included in the Doc |
| 10425 | subdirectory (mostly so that tarring up the HTML files can be fully |
| 10426 | automated). A simple index.html is also added to Doc (it only works |
| 10427 | after you have successfully run latex2html). |
| 10428 | |
| 10429 | - For all you would-be proselytizers out there: a new version of |
| 10430 | Misc/BLURB describes Python more concisely, and Misc/comparisons |
| 10431 | compares Python to several other languages. Misc/BLURB.WINDOWS |
| 10432 | contains a blurb specifically aimed at Windows programmers (by Mark |
| 10433 | Hammond). |
| 10434 | |
| 10435 | - A new version of the Python mode for Emacs is included as |
| 10436 | Misc/python-mode.el. There are too many new features to list here. |
| 10437 | See http://www.python.org/ftp/emacs/pmdetails.html for more info. |
| 10438 | |
| 10439 | - New module fileinput makes iterating over the lines of a list of |
| 10440 | files easier. (This still needs some more thinking to make it more |
| 10441 | extensible.) |
| 10442 | |
| 10443 | - There's full OS/2 support, courtesy Jeff Rush. To build the OS/2 |
| 10444 | version, see PC/readme.txt and PC/os2vacpp. This is for IBM's Visual |
| 10445 | Age C++ compiler. I expect that Jeff will also provide a binary |
| 10446 | release for this platform. |
| 10447 | |
| 10448 | - On Linux, the configure script now uses '-Xlinker -export-dynamic' |
| 10449 | instead of '-rdynamic' to link the main program so that it exports its |
| 10450 | symbols to shared libraries it loads dynamically. I hope this doesn't |
| 10451 | break on older Linux versions; it is needed for mklinux and appears to |
| 10452 | work on Linux 2.0.30. |
| 10453 | |
| 10454 | - Some Tkinter resstructuring: the geometry methods that apply to a |
| 10455 | master are now properly usable on toplevel master widgets. There's a |
| 10456 | new (internal) widget class, BaseWidget. New, longer "official" names |
| 10457 | for the geometry manager methods have been added, |
| 10458 | e.g. "grid_columnconfigure()" instead of "columnconfigure()". The old |
| 10459 | shorter names still work, and where there's ambiguity, pack wins over |
| 10460 | place wins over grid. Also, the bind_class method now returns its |
| 10461 | value. |
| 10462 | |
| 10463 | - New, RFC-822 conformant parsing of email addresses and address lists |
| 10464 | in the rfc822 module, courtesy Ben Escoto. |
| 10465 | |
| 10466 | - New, revamped tkappinit.c with support for popular packages (PIL, |
| 10467 | TIX, BLT, TOGL). For the last three, you need to execute the Tcl |
| 10468 | command "load {} Tix" (or Blt, or Togl) to gain access to them. |
| 10469 | The Modules/Setup line for the _tkinter module has been rewritten |
| 10470 | using the cool line-breaking feature of most Bourne shells. |
| 10471 | |
| 10472 | - New socket method connect_ex() returns the error code from connect() |
| 10473 | instead of raising an exception on errors; this makes the logic |
| 10474 | required for asynchronous connects simpler and more efficient. |
| 10475 | |
| 10476 | - New "locale" module with (still experimental) interface to the |
| 10477 | standard C library locale interface, courtesy Martin von Loewis. This |
| 10478 | does not repeat my mistake in 1.5a4 of always calling |
| 10479 | setlocale(LC_ALL, ""). In fact, we've pretty much decided that |
| 10480 | Python's standard numerical formatting operations should always use |
| 10481 | the conventions for the C locale; the locale module contains utility |
| 10482 | functions to format numbers according to the user specified locale. |
| 10483 | (All this is accomplished by an explicit call to setlocale(LC_NUMERIC, |
| 10484 | "C") after locale-changing calls.) See the library manual. (Alas, the |
| 10485 | promised changes to the "re" module for locale support have not been |
| 10486 | materialized yet. If you care, volunteer!) |
| 10487 | |
| 10488 | - Memory leak plugged in Py_BuildValue when building a dictionary. |
| 10489 | |
| 10490 | - Shared modules can now live inside packages (hierarchical module |
| 10491 | namespaces). No changes to the shared module itself are needed. |
| 10492 | |
| 10493 | - Improved policy for __builtins__: this is a module in __main__ and a |
| 10494 | dictionary everywhere else. |
| 10495 | |
| 10496 | - Python no longer catches SIGHUP and SIGTERM by default. This was |
| 10497 | impossible to get right in the light of thread contexts. If you want |
| 10498 | your program to clean up when a signal happens, use the signal module |
| 10499 | to set up your own signal handler. |
| 10500 | |
| 10501 | - New Python/C API PyNumber_CoerceEx() does not return an exception |
| 10502 | when no coercion is possible. This is used to fix a problem where |
| 10503 | comparing incompatible numbers for equality would raise an exception |
| 10504 | rather than return false as in Python 1.4 -- it once again will return |
| 10505 | false. |
| 10506 | |
| 10507 | - The errno module is changed again -- the table of error messages |
| 10508 | (errorstr) is removed. Instead, you can use os.strerror(). This |
| 10509 | removes redundance and a potential locale dependency. |
| 10510 | |
| 10511 | - New module xmllib, to parse XML files. By Sjoerd Mullender. |
| 10512 | |
| 10513 | - New C API PyOS_AfterFork() is called after fork() in posixmodule.c. |
| 10514 | It resets the signal module's notion of what the current process ID |
| 10515 | and thread are, so that signal handlers will work after (and across) |
| 10516 | calls to os.fork(). |
| 10517 | |
| 10518 | - Fixed most occurrences of fatal errors due to missing thread state. |
| 10519 | |
| 10520 | - For vgrind (a flexible source pretty printer) fans, there's a simple |
| 10521 | Python definition in Misc/vgrindefs, courtesy Neale Pickett. |
| 10522 | |
| 10523 | - Fixed memory leak in exec statement. |
| 10524 | |
| 10525 | - The test.pystone module has a new function, pystones(loops=LOOPS), |
| 10526 | which returns a (benchtime, stones) tuple. The main() function now |
| 10527 | calls this and prints the report. |
| 10528 | |
| 10529 | - Package directories now *require* the presence of an __init__.py (or |
| 10530 | __init__.pyc) file before they are considered as packages. This is |
| 10531 | done to prevent accidental subdirectories with common names from |
| 10532 | overriding modules with the same name. |
| 10533 | |
| 10534 | - Fixed some strange exceptions in __del__ methods in library modules |
| 10535 | (e.g. urllib). This happens because the builtin names are already |
| 10536 | deleted by the time __del__ is called. The solution (a hack, but it |
| 10537 | works) is to set some instance variables to 0 instead of None. |
| 10538 | |
| 10539 | - The table of built-in module initializers is replaced by a pointer |
| 10540 | variable. This makes it possible to switch to a different table at |
| 10541 | run time, e.g. when a collection of modules is loaded from a shared |
| 10542 | library. (No example code of how to do this is given, but it is |
| 10543 | possible.) The table is still there of course, its name prefixed with |
| 10544 | an underscore and used to initialize the pointer. |
| 10545 | |
| 10546 | - The warning about a thread still having a frame now only happens in |
| 10547 | verbose mode. |
| 10548 | |
| 10549 | - Change the signal finialization so that it also resets the signal |
| 10550 | handlers. After this has been called, our signal handlers are no |
| 10551 | longer active! |
| 10552 | |
| 10553 | - New version of tokenize.py (by Ka-Ping Yee) recognizes raw string |
| 10554 | literals. There's now also a test fort this module. |
| 10555 | |
| 10556 | - The copy module now also uses __dict__.update(state) instead of |
| 10557 | going through individual attribute assignments, for class instances |
| 10558 | without a __setstate__ method. |
| 10559 | |
| 10560 | - New module reconvert translates old-style (regex module) regular |
| 10561 | expressions to new-style (re module, Perl-style) regular expressions. |
| 10562 | |
| 10563 | - Most modules that used to use the regex module now use the re |
| 10564 | module. The grep module has a new pgrep() function which uses |
| 10565 | Perl-style regular expressions. |
| 10566 | |
| 10567 | - The (very old, backwards compatibility) regexp.py module has been |
| 10568 | deleted. |
| 10569 | |
| 10570 | - Restricted execution (rexec): added the pcre module (support for the |
| 10571 | re module) to the list of trusted extension modules. |
| 10572 | |
| 10573 | - New version of Jim Fulton's CObject object type, adds |
| 10574 | PyCObject_FromVoidPtrAndDesc() and PyCObject_GetDesc() APIs. |
| 10575 | |
| 10576 | - Some patches to Lee Busby's fpectl mods that accidentally didn't |
| 10577 | make it into 1.5a4. |
| 10578 | |
| 10579 | - In the string module, add an optional 4th argument to count(), |
| 10580 | matching find() etc. |
| 10581 | |
| 10582 | - Patch for the nntplib module by Charles Waldman to add optional user |
| 10583 | and password arguments to NNTP.__init__(), for nntp servers that need |
| 10584 | them. |
| 10585 | |
| 10586 | - The str() function for class objects now returns |
| 10587 | "modulename.classname" instead of returning the same as repr(). |
| 10588 | |
| 10589 | - The parsing of \xXX escapes no longer relies on sscanf(). |
| 10590 | |
| 10591 | - The "sharedmodules" subdirectory of the installation is renamed to |
| 10592 | "lib-dynload". (You may have to edit your Modules/Setup file to fix |
| 10593 | this in an existing installation!) |
| 10594 | |
| 10595 | - Fixed Don Beaudry's mess-up with the OPT test in the configure |
| 10596 | script. Certain SGI platforms will still issue a warning for each |
| 10597 | compile; there's not much I can do about this since the compiler's |
| 10598 | exit status doesn't indicate that I was using an obsolete option. |
| 10599 | |
| 10600 | - Fixed Barry's mess-up with {}.get(), and added test cases for it. |
| 10601 | |
| 10602 | - Shared libraries didn't quite work under AIX because of the change |
| 10603 | in status of the GNU readline interface. Fix due to by Vladimir |
| 10604 | Marangozov. |
| 10605 | |
| 10606 | |
| 10607 | ====================================================================== |
| 10608 | |
| 10609 | |
| 10610 | From 1.5a3 to 1.5a4 |
| 10611 | =================== |
| 10612 | |
| 10613 | - faqwiz.py: version 0.8; Recognize https:// as URL; <html>...</html> |
| 10614 | feature; better install instructions; removed faqmain.py (which was an |
| 10615 | older version). |
| 10616 | |
| 10617 | - nntplib.py: Fixed some bugs reported by Lars Wirzenius (to Debian) |
| 10618 | about the treatment of lines starting with '.'. Added a minimal test |
| 10619 | function. |
| 10620 | |
| 10621 | - struct module: ignore most whitespace in format strings. |
| 10622 | |
| 10623 | - urllib.py: close the socket and temp file in URLopener.retrieve() so |
| 10624 | that multiple retrievals using the same connection work. |
| 10625 | |
| 10626 | - All standard exceptions are now classes by default; use -X to make |
| 10627 | them strings (for backward compatibility only). |
| 10628 | |
| 10629 | - There's a new standard exception hierarchy, defined in the standard |
| 10630 | library module exceptions.py (which you never need to import |
| 10631 | explicitly). See |
| 10632 | http://grail.cnri.reston.va.us/python/essays/stdexceptions.html for |
| 10633 | more info. |
| 10634 | |
| 10635 | - Three new C API functions: |
| 10636 | |
| 10637 | - int PyErr_GivenExceptionMatches(obj1, obj2) |
| 10638 | |
| 10639 | Returns 1 if obj1 and obj2 are the same object, or if obj1 is an |
| 10640 | instance of type obj2, or of a class derived from obj2 |
| 10641 | |
| 10642 | - int PyErr_ExceptionMatches(obj) |
| 10643 | |
| 10644 | Higher level wrapper around PyErr_GivenExceptionMatches() which uses |
| 10645 | PyErr_Occurred() as obj1. This will be the more commonly called |
| 10646 | function. |
| 10647 | |
| 10648 | - void PyErr_NormalizeException(typeptr, valptr, tbptr) |
| 10649 | |
| 10650 | Normalizes exceptions, and places the normalized values in the |
| 10651 | arguments. If type is not a class, this does nothing. If type is a |
| 10652 | class, then it makes sure that value is an instance of the class by: |
| 10653 | |
| 10654 | 1. if instance is of the type, or a class derived from type, it does |
| 10655 | nothing. |
| 10656 | |
| 10657 | 2. otherwise it instantiates the class, using the value as an |
| 10658 | argument. If value is None, it uses an empty arg tuple, and if |
| 10659 | the value is a tuple, it uses just that. |
| 10660 | |
| 10661 | - Another new C API function: PyErr_NewException() creates a new |
| 10662 | exception class derived from Exception; when -X is given, it creates a |
| 10663 | new string exception. |
| 10664 | |
| 10665 | - core interpreter: remove the distinction between tuple and list |
| 10666 | unpacking; allow an arbitrary sequence on the right hand side of any |
| 10667 | unpack instruction. (UNPACK_LIST and UNPACK_TUPLE now do the same |
| 10668 | thing, which should really be called UNPACK_SEQUENCE.) |
| 10669 | |
| 10670 | - classes: Allow assignments to an instance's __dict__ or __class__, |
| 10671 | so you can change ivars (including shared ivars -- shock horror) and |
| 10672 | change classes dynamically. Also make the check on read-only |
| 10673 | attributes of classes less draconic -- only the specials names |
| 10674 | __dict__, __bases__, __name__ and __{get,set,del}attr__ can't be |
| 10675 | assigned. |
| 10676 | |
| 10677 | - Two new built-in functions: issubclass() and isinstance(). Both |
| 10678 | take classes as their second arguments. The former takes a class as |
| 10679 | the first argument and returns true iff first is second, or is a |
| 10680 | subclass of second. The latter takes any object as the first argument |
| 10681 | and returns true iff first is an instance of the second, or any |
| 10682 | subclass of second. |
| 10683 | |
| 10684 | - configure: Added configuration tests for presence of alarm(), |
| 10685 | pause(), and getpwent(). |
| 10686 | |
| 10687 | - Doc/Makefile: changed latex2html targets. |
| 10688 | |
| 10689 | - classes: Reverse the search order for the Don Beaudry hook so that |
| 10690 | the first class with an applicable hook wins. Makes more sense. |
| 10691 | |
| 10692 | - Changed the checks made in Py_Initialize() and Py_Finalize(). It is |
| 10693 | now legal to call these more than once. The first call to |
| 10694 | Py_Initialize() initializes, the first call to Py_Finalize() |
| 10695 | finalizes. There's also a new API, Py_IsInitalized() which checks |
| 10696 | whether we are already initialized (in case you want to leave things |
| 10697 | as they were). |
| 10698 | |
| 10699 | - Completely disable the declarations for malloc(), realloc() and |
| 10700 | free(). Any 90's C compiler has these in header files, and the tests |
| 10701 | to decide whether to suppress the declarations kept failing on some |
| 10702 | platforms. |
| 10703 | |
| 10704 | - *Before* (instead of after) signalmodule.o is added, remove both |
| 10705 | intrcheck.o and sigcheck.o. This should get rid of warnings in ar or |
| 10706 | ld on various systems. |
| 10707 | |
| 10708 | - Added reop to PC/config.c |
| 10709 | |
| 10710 | - configure: Decided to use -Aa -D_HPUX_SOURCE on HP-UX platforms. |
| 10711 | Removed outdated HP-UX comments from README. Added Cray T3E comments. |
| 10712 | |
| 10713 | - Various renames of statically defined functions that had name |
| 10714 | conflicts on some systems, e.g. strndup (GNU libc), join (Cray), |
| 10715 | roundup (sys/types.h). |
| 10716 | |
| 10717 | - urllib.py: Interpret three slashes in file: URL as local file (for |
| 10718 | Netscape on Windows/Mac). |
| 10719 | |
| 10720 | - copy.py: Make sure the objects returned by __getinitargs__() are |
| 10721 | kept alive (in the memo) to avoid a certain kind of nasty crash. (Not |
| 10722 | easily reproducable because it requires a later call to |
| 10723 | __getinitargs__() to return a tuple that happens to be allocated at |
| 10724 | the same address.) |
| 10725 | |
| 10726 | - Added definition of AR to toplevel Makefile. Renamed @buildno temp |
| 10727 | file to buildno1. |
| 10728 | |
| 10729 | - Moved Include/assert.h to Parser/assert.h, which seems to be the |
| 10730 | only place where it's needed. |
| 10731 | |
| 10732 | - Tweaked the dictionary lookup code again for some more speed |
| 10733 | (Vladimir Marangozov). |
| 10734 | |
| 10735 | - NT build: Changed the way python15.lib is included in the other |
| 10736 | projects. Per Mark Hammond's suggestion, add it to the extra libs in |
| 10737 | Settings instead of to the project's source files. |
| 10738 | |
| 10739 | - regrtest.py: Change default verbosity so that there are only three |
| 10740 | levels left: -q, default and -v. In default mode, the name of each |
| 10741 | test is now printed. -v is the same as the old -vv. -q is more quiet |
| 10742 | than the old default mode. |
| 10743 | |
| 10744 | - Removed the old FAQ from the distribution. You now have to get it |
| 10745 | from the web! |
| 10746 | |
| 10747 | - Removed the PC/make_nt.in file from the distribution; it is no |
| 10748 | longer needed. |
| 10749 | |
| 10750 | - Changed the build sequence so that shared modules are built last. |
| 10751 | This fixes things for AIX and doesn't hurt elsewhere. |
| 10752 | |
| 10753 | - Improved test for GNU MP v1 in mpzmodule.c |
| 10754 | |
| 10755 | - fileobject.c: ftell() on Linux discards all buffered data; changed |
| 10756 | read() code to use lseek() instead to get the same effect |
| 10757 | |
| 10758 | - configure.in, configure, importdl.c: NeXT sharedlib fixes |
| 10759 | |
| 10760 | - tupleobject.c: PyTuple_SetItem asserts refcnt==1 |
| 10761 | |
| 10762 | - resource.c: Different strategy regarding whether to declare |
| 10763 | getrusage() and getpagesize() -- #ifdef doesn't work, Linux has |
| 10764 | conflicting decls in its headers. Choice: only declare the return |
| 10765 | type, not the argument prototype, and not on Linux. |
| 10766 | |
| 10767 | - importdl.c, configure*: set sharedlib extensions properly for NeXT |
| 10768 | |
| 10769 | - configure*, Makefile.in, Modules/Makefile.pre.in: AIX shared libraries |
| 10770 | fixed; moved addition of PURIFY to LINKCC to configure |
| 10771 | |
| 10772 | - reopmodule.c, regexmodule.c, regexpr.c, zlibmodule.c: needed casts |
| 10773 | added to shup up various compilers. |
| 10774 | |
| 10775 | - _tkinter.c: removed buggy mac #ifndef |
| 10776 | |
| 10777 | - Doc: various Mac documentation changes, added docs for 'ic' module |
| 10778 | |
| 10779 | - PC/make_nt.in: deleted |
| 10780 | |
| 10781 | - test_time.py, test_strftime.py: tweaks to catch %Z (which may return |
| 10782 | "") |
| 10783 | |
| 10784 | - test_rotor.py: print b -> print `b` |
| 10785 | |
| 10786 | - Tkinter.py: (tagOrId) -> (tagOrId,) |
| 10787 | |
| 10788 | - Tkinter.py: the Tk class now also has a configure() method and |
| 10789 | friends (they have been moved to the Misc class to accomplish this). |
| 10790 | |
| 10791 | - dict.get(key[, default]) returns dict[key] if it exists, or default |
| 10792 | if it doesn't. The default defaults to None. This is quicker for |
| 10793 | some applications than using either has_key() or try:...except |
| 10794 | KeyError:.... |
| 10795 | |
| 10796 | - Tools/webchecker/: some small changes to webchecker.py; added |
| 10797 | websucker.py (a simple web site mirroring script). |
| 10798 | |
| 10799 | - Dictionary objects now have a get() method (also in UserDict.py). |
| 10800 | dict.get(key, default) returns dict[key] if it exists and default |
| 10801 | otherwise; default defaults to None. |
| 10802 | |
| 10803 | - Tools/scripts/logmerge.py: print the author, too. |
| 10804 | |
| 10805 | - Changes to import: support for "import a.b.c" is now built in. See |
| 10806 | http://grail.cnri.reston.va.us/python/essays/packages.html |
| 10807 | for more info. Most important deviations from "ni.py": __init__.py is |
| 10808 | executed in the package's namespace instead of as a submodule; and |
| 10809 | there's no support for "__" or "__domain__". Note that "ni.py" is not |
| 10810 | changed to match this -- it is simply declared obsolete (while at the |
| 10811 | same time, it is documented...:-( ). |
| 10812 | Unfortunately, "ihooks.py" has not been upgraded (but see "knee.py" |
| 10813 | for an example implementation of hierarchical module import written in |
| 10814 | Python). |
| 10815 | |
| 10816 | - More changes to import: the site.py module is now imported by |
| 10817 | default when Python is initialized; use -S to disable it. The site.py |
| 10818 | module extends the path with several more directories: site-packages |
| 10819 | inside the lib/python1.5/ directory, site-python in the lib/ |
| 10820 | directory, and pathnames mentioned in *.pth files found in either of |
| 10821 | those directories. See |
| 10822 | http://grail.cnri.reston.va.us/python/essays/packages.html |
| 10823 | for more info. |
| 10824 | |
| 10825 | - Changes to standard library subdirectory names: those subdirectories |
| 10826 | that are not packages have been renamed with a hypen in their name, |
| 10827 | e.g. lib-tk, lib-stdwin, plat-win, plat-linux2, plat-sunos5, dos-8x3. |
| 10828 | The test suite is now a package -- to run a test, you must now use |
| 10829 | "import test.test_foo". |
| 10830 | |
| 10831 | - A completely new re.py module is provided (thanks to Andrew |
| 10832 | Kuchling, Tim Peters and Jeffrey Ollie) which uses Philip Hazel's |
| 10833 | "pcre" re compiler and engine. For a while, the "old" re.py (which |
| 10834 | was new in 1.5a3!) will be kept around as re1.py. The "old" regex |
| 10835 | module and underlying parser and engine are still present -- while |
| 10836 | regex is now officially obsolete, it will probably take several major |
| 10837 | release cycles before it can be removed. |
| 10838 | |
| 10839 | - The posix module now has a strerror() function which translates an |
| 10840 | error code to a string. |
| 10841 | |
| 10842 | - The emacs.py module (which was long obsolete) has been removed. |
| 10843 | |
| 10844 | - The universal makefile Misc/Makefile.pre.in now features an |
| 10845 | "install" target. By default, installed shared libraries go into |
| 10846 | $exec_prefix/lib/python$VERSION/site-packages/. |
| 10847 | |
| 10848 | - The install-sh script is installed with the other configuration |
| 10849 | specific files (in the config/ subdirectory). |
| 10850 | |
| 10851 | - It turns out whatsound.py and sndhdr.py were identical modules. |
| 10852 | Since there's also an imghdr.py file, I propose to make sndhdr.py the |
| 10853 | official one. For compatibility, whatsound.py imports * from |
| 10854 | sndhdr.py. |
| 10855 | |
| 10856 | - Class objects have a new attribute, __module__, giving the name of |
| 10857 | the module in which they were declared. This is useful for pickle and |
| 10858 | for printing the full name of a class exception. |
| 10859 | |
| 10860 | - Many extension modules no longer issue a fatal error when their |
| 10861 | initialization fails; the importing code now checks whether an error |
| 10862 | occurred during module initialization, and correctly propagates the |
| 10863 | exception to the import statement. |
| 10864 | |
| 10865 | - Most extension modules now raise class-based exceptions (except when |
| 10866 | -X is used). |
| 10867 | |
| 10868 | - Subtle changes to PyEval_{Save,Restore}Thread(): always swap the |
| 10869 | thread state -- just don't manipulate the lock if it isn't there. |
| 10870 | |
| 10871 | - Fixed a bug in Python/getopt.c that made it do the wrong thing when |
| 10872 | an option was a single '-'. Thanks to Andrew Kuchling. |
| 10873 | |
| 10874 | - New module mimetypes.py will guess a MIME type from a filename's |
| 10875 | extension. |
| 10876 | |
| 10877 | - Windows: the DLL version is now settable via a resource rather than |
| 10878 | being hardcoded. This can be used for "branding" a binary Python |
| 10879 | distribution. |
| 10880 | |
| 10881 | - urllib.py is now threadsafe -- it now uses re instead of regex, and |
| 10882 | sys.exc_info() instead of sys.exc_{type,value}. |
| 10883 | |
| 10884 | - Many other library modules that used to use |
| 10885 | sys.exc_{type,value,traceback} are now more thread-safe by virtue of |
| 10886 | using sys.exc_info(). |
| 10887 | |
| 10888 | - The functions in popen2 have an optional buffer size parameter. |
| 10889 | Also, the command argument can now be either a string (passed to the |
| 10890 | shell) or a list of arguments (passed directly to execv). |
| 10891 | |
| 10892 | - Alas, the thread support for _tkinter released with 1.5a3 didn't |
| 10893 | work. It's been rewritten. The bad news is that it now requires a |
| 10894 | modified version of a file in the standard Tcl distribution, which you |
| 10895 | must compile with a -I option pointing to the standard Tcl source |
| 10896 | tree. For this reason, the thread support is disabled by default. |
| 10897 | |
| 10898 | - The errno extension module adds two tables: errorcode maps errno |
| 10899 | numbers to errno names (e.g. EINTR), and errorstr maps them to |
| 10900 | message strings. (The latter is redundant because the new call |
| 10901 | posix.strerror() now does the same, but alla...) (Marc-Andre Lemburg) |
| 10902 | |
| 10903 | - The readline extension module now provides some interfaces to |
| 10904 | internal readline routines that make it possible to write a completer |
| 10905 | in Python. An example completer, rlcompleter.py, is provided. |
| 10906 | |
| 10907 | When completing a simple identifier, it completes keywords, |
| 10908 | built-ins and globals in __main__; when completing |
| 10909 | NAME.NAME..., it evaluates (!) the expression up to the last |
| 10910 | dot and completes its attributes. |
| 10911 | |
| 10912 | It's very cool to do "import string" type "string.", hit the |
| 10913 | completion key (twice), and see the list of names defined by |
| 10914 | the string module! |
| 10915 | |
| 10916 | Tip: to use the tab key as the completion key, call |
| 10917 | |
| 10918 | readline.parse_and_bind("tab: complete") |
| 10919 | |
| 10920 | - The traceback.py module has a new function tb_lineno() by Marc-Andre |
| 10921 | Lemburg which extracts the line number from the linenumber table in |
| 10922 | the code object. Apparently the traceback object doesn't contains the |
| 10923 | right linenumber when -O is used. Rather than guessing whether -O is |
| 10924 | on or off, the module itself uses tb_lineno() unconditionally. |
| 10925 | |
| 10926 | - Fixed Demo/tkinter/matt/canvas-moving-or-creating.py: change bind() |
| 10927 | to tag_bind() so it works again. |
| 10928 | |
| 10929 | - The pystone script is now a standard library module. Example use: |
| 10930 | "import test.pystone; test.pystone.main()". |
| 10931 | |
| 10932 | - The import of the readline module in interactive mode is now also |
| 10933 | attempted when -i is specified. (Yes, I know, giving in to Marc-Andre |
| 10934 | Lemburg, who asked for this. :-) |
| 10935 | |
| 10936 | - rfc822.py: Entirely rewritten parseaddr() function by Sjoerd |
| 10937 | Mullender, to be closer to the standard. This fixes the getaddr() |
| 10938 | method. Unfortunately, getaddrlist() is as broken as ever, since it |
| 10939 | splits on commas without regard for RFC 822 quoting conventions. |
| 10940 | |
| 10941 | - pprint.py: correctly emit trailing "," in singleton tuples. |
| 10942 | |
| 10943 | - _tkinter.c: export names for its type objects, TkappType and |
| 10944 | TkttType. |
| 10945 | |
| 10946 | - pickle.py: use __module__ when defined; fix a particularly hard to |
| 10947 | reproduce bug that confuses the memo when temporary objects are |
| 10948 | returned by custom pickling interfaces; and a semantic change: when |
| 10949 | unpickling the instance variables of an instance, use |
| 10950 | inst.__dict__.update(value) instead of a for loop with setattr() over |
| 10951 | the value.keys(). This is more consistent (the pickling doesn't use |
| 10952 | getattr() either but pickles inst.__dict__) and avoids problems with |
| 10953 | instances that have a __setattr__ hook. But it *is* a semantic change |
| 10954 | (because the setattr hook is no longer used). So beware! |
| 10955 | |
| 10956 | - config.h is now installed (at last) in |
| 10957 | $exec_prefix/include/python1.5/. For most sites, this means that it |
| 10958 | is actually in $prefix/include/python1.5/, with all the other Python |
| 10959 | include files, since $prefix and $exec_prefix are the same by |
| 10960 | default. |
| 10961 | |
| 10962 | - The imp module now supports parts of the functionality to implement |
| 10963 | import of hierarchical module names. It now supports find_module() |
| 10964 | and load_module() for all types of modules. Docstrings have been |
| 10965 | added for those functions in the built-in imp module that are still |
| 10966 | relevant (some old interfaces are obsolete). For a sample |
| 10967 | implementation of hierarchical module import in Python, see the new |
| 10968 | library module knee.py. |
| 10969 | |
| 10970 | - The % operator on string objects now allows arbitrary nested parens |
| 10971 | in a %(...)X style format. (Brad Howes) |
| 10972 | |
| 10973 | - Reverse the order in which Setup and Setup.local are passed to the |
| 10974 | makesetup script. This allows variable definitions in Setup.local to |
| 10975 | override definitions in Setup. (But you'll still have to edit Setup |
| 10976 | if you want to disable modules that are enabled by default, or if such |
| 10977 | modules need non-standard options.) |
| 10978 | |
| 10979 | - Added PyImport_ImportModuleEx(name, globals, locals, fromlist); this |
| 10980 | is like PyImport_ImporModule(name) but receives the globals and locals |
| 10981 | dict and the fromlist arguments as well. (The name is a char*; the |
| 10982 | others are PyObject*s). |
| 10983 | |
| 10984 | - The 'p' format in the struct extension module alloded to above is |
| 10985 | new in 1.5a4. |
| 10986 | |
| 10987 | - The types.py module now uses try-except in a few places to make it |
| 10988 | more likely that it can be imported in restricted mode. Some type |
| 10989 | names are undefined in that case, e.g. CodeType (inaccessible), |
| 10990 | FileType (not always accessible), and TracebackType and FrameType |
| 10991 | (inaccessible). |
| 10992 | |
| 10993 | - In urllib.py: added separate administration of temporary files |
| 10994 | created y URLopener.retrieve() so cleanup() can properly remove them. |
| 10995 | The old code removed everything in tempcache which was a bad idea if |
| 10996 | the user had passed a non-temp file into it. Also, in basejoin(), |
| 10997 | interpret relative paths starting in "../". This is necessary if the |
| 10998 | server uses symbolic links. |
| 10999 | |
| 11000 | - The Windows build procedure and project files are now based on |
| 11001 | Microsoft Visual C++ 5.x. The build now takes place in the PCbuild |
| 11002 | directory. It is much more robust, and properly builds separate Debug |
| 11003 | and Release versions. (The installer will be added shortly.) |
| 11004 | |
| 11005 | - Added casts and changed some return types in regexpr.c to avoid |
| 11006 | compiler warnings or errors on some platforms. |
| 11007 | |
| 11008 | - The AIX build tools for shared libraries now supports VPATH. (Donn |
| 11009 | Cave) |
| 11010 | |
| 11011 | - By default, disable the "portable" multimedia modules audioop, |
| 11012 | imageop, and rgbimg, since they don't work on 64-bit platforms. |
| 11013 | |
| 11014 | - Fixed a nasty bug in cStringIO.c when code was actually using the |
| 11015 | close() method (the destructors would try to free certain fields a |
| 11016 | second time). |
| 11017 | |
| 11018 | - For those who think they need it, there's a "user.py" module. This |
| 11019 | is *not* imported by default, but can be imported to run user-specific |
| 11020 | setup commands, ~/.pythonrc.py. |
| 11021 | |
| 11022 | - Various speedups suggested by Fredrik Lundh, Marc-Andre Lemburg, |
| 11023 | Vladimir Marangozov, and others. |
| 11024 | |
| 11025 | - Added os.altsep; this is '/' on DOS/Windows, and None on systems |
| 11026 | with a sane filename syntax. |
| 11027 | |
| 11028 | - os.py: Write out the dynamic OS choice, to avoid exec statements. |
| 11029 | Adding support for a new OS is now a bit more work, but I bet that |
| 11030 | 'dos' or 'nt' will cover most situations... |
| 11031 | |
| 11032 | - The obsolete exception AccessError is now really gone. |
| 11033 | |
| 11034 | - Tools/faqwiz/: New installation instructions show how to maintain |
| 11035 | multiple FAQs. Removed bootstrap script from end of faqwiz.py module. |
| 11036 | Added instructions to bootstrap script, too. Version bumped to 0.8.1. |
| 11037 | Added <html>...</html> feature suggested by Skip Montanaro. Added |
| 11038 | leading text for Roulette, default to 'Hit Reload ...'. Fix typo in |
| 11039 | default SRCDIR. |
| 11040 | |
| 11041 | - Documentation for the relatively new modules "keyword" and "symbol" |
| 11042 | has been added (to the end of the section on the parser extension |
| 11043 | module). |
| 11044 | |
| 11045 | - In module bisect.py, but functions have two optional argument 'lo' |
| 11046 | and 'hi' which allow you to specify a subsequence of the array to |
| 11047 | operate on. |
| 11048 | |
| 11049 | - In ftplib.py, changed most methods to return their status (even when |
| 11050 | it is always "200 OK") rather than swallowing it. |
| 11051 | |
| 11052 | - main() now calls setlocale(LC_ALL, ""), if setlocale() and |
| 11053 | <locale.h> are defined. |
| 11054 | |
| 11055 | - Changes to configure.in, the configure script, and both |
| 11056 | Makefile.pre.in files, to support SGI's SGI_ABI platform selection |
| 11057 | environment variable. |
| 11058 | |
| 11059 | |
| 11060 | ====================================================================== |
| 11061 | |
| 11062 | |
| 11063 | From 1.4 to 1.5a3 |
| 11064 | ================= |
| 11065 | |
| 11066 | Security |
| 11067 | -------- |
| 11068 | |
| 11069 | - If you are using the setuid script C wrapper (Misc/setuid-prog.c), |
| 11070 | please use the new version. The old version has a huge security leak. |
| 11071 | |
| 11072 | Miscellaneous |
| 11073 | ------------- |
| 11074 | |
| 11075 | - Because of various (small) incompatible changes in the Python |
| 11076 | bytecode interpreter, the magic number for .pyc files has changed |
| 11077 | again. |
| 11078 | |
| 11079 | - The default module search path is now much saner. Both on Unix and |
| 11080 | Windows, it is essentially derived from the path to the executable |
| 11081 | (which can be overridden by setting the environment variable |
| 11082 | $PYTHONHOME). The value of $PYTHONPATH on Windows is now inserted in |
| 11083 | front of the default path, like in Unix (instead of overriding the |
| 11084 | default path). On Windows, the directory containing the executable is |
| 11085 | added to the end of the path. |
| 11086 | |
| 11087 | - A new version of python-mode.el for Emacs has been included. Also, |
| 11088 | a new file ccpy-style.el has been added to configure Emacs cc-mode for |
| 11089 | the preferred style in Python C sources. |
| 11090 | |
| 11091 | - On Unix, when using sys.argv[0] to insert the script directory in |
| 11092 | front of sys.path, expand a symbolic link. You can now install a |
| 11093 | program in a private directory and have a symbolic link to it in a |
| 11094 | public bin directory, and it will put the private directory in the |
| 11095 | module search path. Note that the symlink is expanded in sys.path[0] |
| 11096 | but not in sys.argv[0], so you can still tell the name by which you |
| 11097 | were invoked. |
| 11098 | |
| 11099 | - It is now recommended to use ``#!/usr/bin/env python'' instead of |
| 11100 | ``#!/usr/local/bin/python'' at the start of executable scripts, except |
| 11101 | for CGI scripts. It has been determined that the use of /usr/bin/env |
| 11102 | is more portable than that of /usr/local/bin/python -- scripts almost |
| 11103 | never have to be edited when the Python interpreter lives in a |
| 11104 | non-standard place. Note that this doesn't work for CGI scripts since |
| 11105 | the python executable often doesn't live in the HTTP server's default |
| 11106 | search path. |
| 11107 | |
| 11108 | - The silly -s command line option and the corresponding |
| 11109 | PYTHONSUPPRESS environment variable (and the Py_SuppressPrint global |
| 11110 | flag in the Python/C API) are gone. |
| 11111 | |
| 11112 | - Most problems on 64-bit platforms should now be fixed. Andrew |
| 11113 | Kuchling helped. Some uncommon extension modules are still not |
| 11114 | clean (image and audio ops?). |
| 11115 | |
| 11116 | - Fixed a bug where multiple anonymous tuple arguments would be mixed up |
| 11117 | when using the debugger or profiler (reported by Just van Rossum). |
| 11118 | The simplest example is ``def f((a,b),(c,d)): print a,b,c,d''; this |
| 11119 | would print the wrong value when run under the debugger or profiler. |
| 11120 | |
| 11121 | - The hacks that the dictionary implementation used to speed up |
| 11122 | repeated lookups of the same C string were removed; these were a |
| 11123 | source of subtle problems and don't seem to serve much of a purpose |
| 11124 | any longer. |
| 11125 | |
| 11126 | - All traces of support for the long dead access statement have been |
| 11127 | removed from the sources. |
| 11128 | |
| 11129 | - Plugged the two-byte memory leak in the tokenizer when reading an |
| 11130 | interactive EOF. |
| 11131 | |
| 11132 | - There's a -O option to the interpreter that removes SET_LINENO |
| 11133 | instructions and assert statements (see below); it uses and produces |
| 11134 | .pyo files instead of .pyc files. The speedup is only a few percent |
| 11135 | in most cases. The line numbers are still available in the .pyo file, |
| 11136 | as a separate table (which is also available in .pyc files). However, |
| 11137 | the removal of the SET_LINENO instructions means that the debugger |
| 11138 | (pdb) can't set breakpoints on lines in -O mode. The traceback module |
| 11139 | contains a function to extract a line number from the code object |
| 11140 | referenced in a traceback object. In the future it should be possible |
| 11141 | to write external bytecode optimizers that create better optimized |
| 11142 | .pyo files, and there should be more control over optimization; |
| 11143 | consider the -O option a "teaser". Without -O, the assert statement |
| 11144 | actually generates code that first checks __debug__; if this variable |
| 11145 | is false, the assertion is not checked. __debug__ is a built-in |
| 11146 | variable whose value is initialized to track the -O flag (it's true |
| 11147 | iff -O is not specified). With -O, no code is generated for assert |
| 11148 | statements, nor for code of the form ``if __debug__: <something>''. |
| 11149 | Sorry, no further constant folding happens. |
| 11150 | |
| 11151 | |
| 11152 | Performance |
| 11153 | ----------- |
| 11154 | |
| 11155 | - It's much faster (almost twice for pystone.py -- see |
| 11156 | Tools/scripts). See the entry on string interning below. |
| 11157 | |
| 11158 | - Some speedup by using separate free lists for method objects (both |
| 11159 | the C and the Python variety) and for floating point numbers. |
| 11160 | |
| 11161 | - Big speedup by allocating frame objects with a single malloc() call. |
| 11162 | The Python/C API for frames is changed (you shouldn't be using this |
| 11163 | anyway). |
| 11164 | |
| 11165 | - Significant speedup by inlining some common opcodes for common operand |
| 11166 | types (e.g. i+i, i-i, and list[i]). Fredrik Lundh. |
| 11167 | |
| 11168 | - Small speedup by reordering the method tables of some common |
| 11169 | objects (e.g. list.append is now first). |
| 11170 | |
| 11171 | - Big optimization to the read() method of file objects. A read() |
| 11172 | without arguments now attempts to use fstat to allocate a buffer of |
| 11173 | the right size; for pipes and sockets, it will fall back to doubling |
| 11174 | the buffer size. While that the improvement is real on all systems, |
| 11175 | it is most dramatic on Windows. |
| 11176 | |
| 11177 | |
| 11178 | Documentation |
| 11179 | ------------- |
| 11180 | |
| 11181 | - Many new pieces of library documentation were contributed, mostly by |
| 11182 | Andrew Kuchling. Even cmath is now documented! There's also a |
| 11183 | chapter of the library manual, "libundoc.tex", which provides a |
| 11184 | listing of all undocumented modules, plus their status (e.g. internal, |
| 11185 | obsolete, or in need of documentation). Also contributions by Sue |
| 11186 | Williams, Skip Montanaro, and some module authors who succumbed to |
| 11187 | pressure to document their own contributed modules :-). Note that |
| 11188 | printing the documentation now kills fewer trees -- the margins have |
| 11189 | been reduced. |
| 11190 | |
| 11191 | - I have started documenting the Python/C API. Unfortunately this project |
| 11192 | hasn't been completed yet. It will be complete before the final release of |
| 11193 | Python 1.5, though. At the moment, it's better to read the LaTeX source |
| 11194 | than to attempt to run it through LaTeX and print the resulting dvi file. |
| 11195 | |
| 11196 | - The posix module (and hence os.py) now has doc strings! Thanks to Neil |
| 11197 | Schemenauer. I received a few other contributions of doc strings. In most |
| 11198 | other places, doc strings are still wishful thinking... |
| 11199 | |
| 11200 | |
| 11201 | Language changes |
| 11202 | ---------------- |
| 11203 | |
| 11204 | - Private variables with leading double underscore are now a permanent |
| 11205 | feature of the language. (These were experimental in release 1.4. I have |
| 11206 | favorable experience using them; I can't label them "experimental" |
| 11207 | forever.) |
| 11208 | |
| 11209 | - There's new string literal syntax for "raw strings". Prefixing a string |
| 11210 | literal with the letter r (or R) disables all escape processing in the |
| 11211 | string; for example, r'\n' is a two-character string consisting of a |
| 11212 | backslash followed by the letter n. This combines with all forms of string |
| 11213 | quotes; it is actually useful for triple quoted doc strings which might |
| 11214 | contain references to \n or \t. An embedded quote prefixed with a |
| 11215 | backslash does not terminate the string, but the backslash is still |
| 11216 | included in the string; for example, r'\'' is a two-character string |
| 11217 | consisting of a backslash and a quote. (Raw strings are also |
| 11218 | affectionately known as Robin strings, after their inventor, Robin |
| 11219 | Friedrich.) |
| 11220 | |
| 11221 | - There's a simple assert statement, and a new exception |
| 11222 | AssertionError. For example, ``assert foo > 0'' is equivalent to ``if |
| 11223 | not foo > 0: raise AssertionError''. Sorry, the text of the asserted |
| 11224 | condition is not available; it would be too complicated to generate |
| 11225 | code for this (since the code is generated from a parse tree). |
| 11226 | However, the text is displayed as part of the traceback! |
| 11227 | |
| 11228 | - The raise statement has a new feature: when using "raise SomeClass, |
| 11229 | somevalue" where somevalue is not an instance of SomeClass, it |
| 11230 | instantiates SomeClass(somevalue). In 1.5a4, if somevalue is an |
| 11231 | instance of a *derived* class of SomeClass, the exception class raised |
| 11232 | is set to somevalue.__class__, and SomeClass is ignored after that. |
| 11233 | |
| 11234 | - Duplicate keyword arguments are now detected at compile time; |
| 11235 | f(a=1,a=2) is now a syntax error. |
| 11236 | |
| 11237 | |
| 11238 | Changes to builtin features |
| 11239 | --------------------------- |
| 11240 | |
| 11241 | - There's a new exception FloatingPointError (used only by Lee Busby's |
| 11242 | patches to catch floating point exceptions, at the moment). |
| 11243 | |
| 11244 | - The obsolete exception ConflictError (presumably used by the long |
| 11245 | obsolete access statement) has been deleted. |
| 11246 | |
| 11247 | - There's a new function sys.exc_info() which returns the tuple |
| 11248 | (sys.exc_type, sys.exc_value, sys.exc_traceback) in a thread-safe way. |
| 11249 | |
| 11250 | - There's a new variable sys.executable, pointing to the executable file |
| 11251 | for the Python interpreter. |
| 11252 | |
| 11253 | - The sort() methods for lists no longer uses the C library qsort(); I |
| 11254 | wrote my own quicksort implementation, with lots of help (in the form |
| 11255 | of a kind of competition) from Tim Peters. This solves a bug in |
| 11256 | dictionary comparisons on some Solaris versions when Python is built |
| 11257 | with threads, and makes sorting lists even faster. |
| 11258 | |
| 11259 | - The semantics of comparing two dictionaries have changed, to make |
| 11260 | comparison of unequal dictionaries faster. A shorter dictionary is |
| 11261 | always considered smaller than a larger dictionary. For dictionaries |
| 11262 | of the same size, the smallest differing element determines the |
| 11263 | outcome (which yields the same results as before in this case, without |
| 11264 | explicit sorting). Thanks to Aaron Watters for suggesting something |
| 11265 | like this. |
| 11266 | |
| 11267 | - The semantics of try-except have changed subtly so that calling a |
| 11268 | function in an exception handler that itself raises and catches an |
| 11269 | exception no longer overwrites the sys.exc_* variables. This also |
| 11270 | alleviates the problem that objects referenced in a stack frame that |
| 11271 | caught an exception are kept alive until another exception is caught |
| 11272 | -- the sys.exc_* variables are restored to their previous value when |
| 11273 | returning from a function that caught an exception. |
| 11274 | |
| 11275 | - There's a new "buffer" interface. Certain objects (e.g. strings and |
| 11276 | arrays) now support the "buffer" protocol. Buffer objects are acceptable |
| 11277 | whenever formerly a string was required for a write operation; mutable |
| 11278 | buffer objects can be the target of a read operation using the call |
| 11279 | f.readinto(buffer). A cool feature is that regular expression matching now |
| 11280 | also work on array objects. Contribution by Jack Jansen. (Needs |
| 11281 | documentation.) |
| 11282 | |
| 11283 | - String interning: dictionary lookups are faster when the lookup |
| 11284 | string object is the same object as the key in the dictionary, not |
| 11285 | just a string with the same value. This is done by having a pool of |
| 11286 | "interned" strings. Most names generated by the interpreter are now |
| 11287 | automatically interned, and there's a new built-in function intern(s) |
| 11288 | that returns the interned version of a string. Interned strings are |
| 11289 | not a different object type, and interning is totally optional, but by |
| 11290 | interning most keys a speedup of about 15% was obtained for the |
| 11291 | pystone benchmark. |
| 11292 | |
| 11293 | - Dictionary objects have several new methods; clear() and copy() have |
| 11294 | the obvious semantics, while update(d) merges the contents of another |
| 11295 | dictionary d into this one, overriding existing keys. The dictionary |
| 11296 | implementation file is now called dictobject.c rather than the |
| 11297 | confusing mappingobject.c. |
| 11298 | |
| 11299 | - The intrinsic function dir() is much smarter; it looks in __dict__, |
| 11300 | __members__ and __methods__. |
| 11301 | |
| 11302 | - The intrinsic functions int(), long() and float() can now take a |
| 11303 | string argument and then do the same thing as string.atoi(), |
| 11304 | string.atol(), and string.atof(). No second 'base' argument is |
| 11305 | allowed, and complex() does not take a string (nobody cared enough). |
| 11306 | |
| 11307 | - When a module is deleted, its globals are now deleted in two phases. |
| 11308 | In the first phase, all variables whose name begins with exactly one |
| 11309 | underscore are replaced by None; in the second phase, all variables |
| 11310 | are deleted. This makes it possible to have global objects whose |
| 11311 | destructors depend on other globals. The deletion order within each |
| 11312 | phase is still random. |
| 11313 | |
| 11314 | - It is no longer an error for a function to be called without a |
| 11315 | global variable __builtins__ -- an empty directory will be provided |
| 11316 | by default. |
| 11317 | |
| 11318 | - Guido's corollary to the "Don Beaudry hook": it is now possible to |
| 11319 | do metaprogramming by using an instance as a base class. Not for the |
| 11320 | faint of heart; and undocumented as yet, but basically if a base class |
| 11321 | is an instance, its class will be instantiated to create the new |
| 11322 | class. Jim Fulton will love it -- it also works with instances of his |
| 11323 | "extension classes", since it is triggered by the presence of a |
| 11324 | __class__ attribute on the purported base class. See |
| 11325 | Demo/metaclasses/index.html for an explanation and see that directory |
| 11326 | for examples. |
| 11327 | |
| 11328 | - Another change is that the Don Beaudry hook is now invoked when |
| 11329 | *any* base class is special. (Up to 1.5a3, the *last* special base |
| 11330 | class is used; in 1.5a4, the more rational choice of the *first* |
| 11331 | special base class is used.) |
| 11332 | |
| 11333 | - New optional parameter to the readlines() method of file objects. |
| 11334 | This indicates the number of bytes to read (the actual number of bytes |
| 11335 | read will be somewhat larger due to buffering reading until the end of |
| 11336 | the line). Some optimizations have also been made to speed it up (but |
| 11337 | not as much as read()). |
| 11338 | |
| 11339 | - Complex numbers no longer have the ".conj" pseudo attribute; use |
| 11340 | z.conjugate() instead, or complex(z.real, -z.imag). Complex numbers |
| 11341 | now *do* support the __members__ and __methods__ special attributes. |
| 11342 | |
| 11343 | - The complex() function now looks for a __complex__() method on class |
| 11344 | instances before giving up. |
| 11345 | |
| 11346 | - Long integers now support arbitrary shift counts, so you can now |
| 11347 | write 1L<<1000000, memory permitting. (Python 1.4 reports "outrageous |
| 11348 | shift count for this.) |
| 11349 | |
| 11350 | - The hex() and oct() functions have been changed so that for regular |
| 11351 | integers, they never emit a minus sign. For example, on a 32-bit |
| 11352 | machine, oct(-1) now returns '037777777777' and hex(-1) returns |
| 11353 | '0xffffffff'. While this may seem inconsistent, it is much more |
| 11354 | useful. (For long integers, a minus sign is used as before, to fit |
| 11355 | the result in memory :-) |
| 11356 | |
| 11357 | - The hash() function computes better hashes for several data types, |
| 11358 | including strings, floating point numbers, and complex numbers. |
| 11359 | |
| 11360 | |
| 11361 | New extension modules |
| 11362 | --------------------- |
| 11363 | |
| 11364 | - New extension modules cStringIO.c and cPickle.c, written by Jim |
| 11365 | Fulton and other folks at Digital Creations. These are much more |
| 11366 | efficient than their Python counterparts StringIO.py and pickle.py, |
| 11367 | but don't support subclassing. cPickle.c clocks up to 1000 times |
| 11368 | faster than pickle.py; cStringIO.c's improvement is less dramatic but |
| 11369 | still significant. |
| 11370 | |
| 11371 | - New extension module zlibmodule.c, interfacing to the free zlib |
| 11372 | library (gzip compatible compression). There's also a module gzip.py |
| 11373 | which provides a higher level interface. Written by Andrew Kuchling |
| 11374 | and Jeremy Hylton. |
| 11375 | |
| 11376 | - New module readline; see the "miscellaneous" section above. |
| 11377 | |
| 11378 | - New Unix extension module resource.c, by Jeremy Hylton, provides |
| 11379 | access to getrlimit(), getrusage(), setrusage(), getpagesize(), and |
| 11380 | related symbolic constants. |
| 11381 | |
| 11382 | - New extension puremodule.c, by Barry Warsaw, which interfaces to the |
| 11383 | Purify(TM) C API. See also the file Misc/PURIFY.README. It is also |
| 11384 | possible to enable Purify by simply setting the PURIFY Makefile |
| 11385 | variable in the Modules/Setup file. |
| 11386 | |
| 11387 | |
| 11388 | Changes in extension modules |
| 11389 | ---------------------------- |
| 11390 | |
| 11391 | - The struct extension module has several new features to control byte |
| 11392 | order and word size. It supports reading and writing IEEE floats even |
| 11393 | on platforms where this is not the native format. It uses uppercase |
| 11394 | format codes for unsigned integers of various sizes (always using |
| 11395 | Python long ints for 'I' and 'L'), 's' with a size prefix for strings, |
| 11396 | and 'p' for "Pascal strings" (with a leading length byte, included in |
| 11397 | the size; blame Hannu Krosing; new in 1.5a4). A prefix '>' forces |
| 11398 | big-endian data and '<' forces little-endian data; these also select |
| 11399 | standard data sizes and disable automatic alignment (use pad bytes as |
| 11400 | needed). |
| 11401 | |
| 11402 | - The array module supports uppercase format codes for unsigned data |
| 11403 | formats (like the struct module). |
| 11404 | |
| 11405 | - The fcntl extension module now exports the needed symbolic |
| 11406 | constants. (Formerly these were in FCNTL.py which was not available |
| 11407 | or correct for all platforms.) |
| 11408 | |
| 11409 | - The extension modules dbm, gdbm and bsddb now check that the |
| 11410 | database is still open before making any new calls. |
| 11411 | |
| 11412 | - The dbhash module is no more. Use bsddb instead. (There's a third |
| 11413 | party interface for the BSD 2.x code somewhere on the web; support for |
| 11414 | bsddb will be deprecated.) |
| 11415 | |
| 11416 | - The gdbm module now supports a sync() method. |
| 11417 | |
| 11418 | - The socket module now has some new functions: getprotobyname(), and |
| 11419 | the set {ntoh,hton}{s,l}(). |
| 11420 | |
| 11421 | - Various modules now export their type object: socket.SocketType, |
| 11422 | array.ArrayType. |
| 11423 | |
| 11424 | - The socket module's accept() method now returns unknown addresses as |
| 11425 | a tuple rather than raising an exception. (This can happen in |
| 11426 | promiscuous mode.) Theres' also a new function getprotobyname(). |
| 11427 | |
| 11428 | - The pthread support for the thread module now works on most platforms. |
| 11429 | |
| 11430 | - STDWIN is now officially obsolete. Support for it will eventually |
| 11431 | be removed from the distribution. |
| 11432 | |
| 11433 | - The binascii extension module is now hopefully fully debugged. |
| 11434 | (XXX Oops -- Fredrik Lundh promised me a uuencode fix that I never |
| 11435 | received.) |
| 11436 | |
| 11437 | - audioop.c: added a ratecv() function; better handling of overflow in |
| 11438 | add(). |
| 11439 | |
| 11440 | - posixmodule.c: now exports the O_* flags (O_APPEND etc.). On |
| 11441 | Windows, also O_TEXT and O_BINARY. The 'error' variable (the |
| 11442 | exception is raises) is renamed -- its string value is now "os.error", |
| 11443 | so newbies don't believe they have to import posix (or nt) to catch |
| 11444 | it when they see os.error reported as posix.error. The execve() |
| 11445 | function now accepts any mapping object for the environment. |
| 11446 | |
| 11447 | - A new version of the al (audio library) module for SGI was |
| 11448 | contributed by Sjoerd Mullender. |
| 11449 | |
| 11450 | - The regex module has a new function get_syntax() which retrieves the |
| 11451 | syntax setting set by set_syntax(). The code was also sanitized, |
| 11452 | removing worries about unclean error handling. See also below for its |
| 11453 | successor, re.py. |
| 11454 | |
| 11455 | - The "new" module (which creates new objects of various types) once |
| 11456 | again has a fully functioning new.function() method. Dangerous as |
| 11457 | ever! Also, new.code() has several new arguments. |
| 11458 | |
| 11459 | - A problem has been fixed in the rotor module: on systems with signed |
| 11460 | characters, rotor-encoded data was not portable when the key contained |
| 11461 | 8-bit characters. Also, setkey() now requires its argument rather |
| 11462 | than having broken code to default it. |
| 11463 | |
| 11464 | - The sys.builtin_module_names variable is now a tuple. Another new |
| 11465 | variables in sys is sys.executable (the full path to the Python |
| 11466 | binary, if known). |
| 11467 | |
| 11468 | - The specs for time.strftime() have undergone some revisions. It |
| 11469 | appears that not all format characters are supported in the same way |
| 11470 | on all platforms. Rather than reimplement it, we note these |
| 11471 | differences in the documentation, and emphasize the shared set of |
| 11472 | features. There's also a thorough test set (that occasionally finds |
| 11473 | problems in the C library implementation, e.g. on some Linuxes), |
| 11474 | thanks to Skip Montanaro. |
| 11475 | |
| 11476 | - The nis module seems broken when used with NIS+; unfortunately |
| 11477 | nobody knows how to fix it. It should still work with old NIS. |
| 11478 | |
| 11479 | |
| 11480 | New library modules |
| 11481 | ------------------- |
| 11482 | |
| 11483 | - New (still experimental) Perl-style regular expression module, |
| 11484 | re.py, which uses a new interface for matching as well as a new |
| 11485 | syntax; the new interface avoids the thread-unsafety of the regex |
| 11486 | interface. This comes with a helper extension reopmodule.c and vastly |
| 11487 | rewritten regexpr.c. Most work on this was done by Jeffrey Ollie, Tim |
| 11488 | Peters, and Andrew Kuchling. See the documentation libre.tex. In |
| 11489 | 1.5, the old regex module is still fully supported; in the future, it |
| 11490 | will become obsolete. |
| 11491 | |
| 11492 | - New module gzip.py; see zlib above. |
| 11493 | |
| 11494 | - New module keyword.py exports knowledge about Python's built-in |
| 11495 | keywords. (New version by Ka-Ping Yee.) |
| 11496 | |
| 11497 | - New module pprint.py (with documentation) which supports |
| 11498 | pretty-printing of lists, tuples, & dictionaries recursively. By Fred |
| 11499 | Drake. |
| 11500 | |
| 11501 | - New module code.py. The function code.compile_command() can |
| 11502 | determine whether an interactively entered command is complete or not, |
| 11503 | distinguishing incomplete from invalid input. (XXX Unfortunately, |
| 11504 | this seems broken at this moment, and I don't have the time to fix |
| 11505 | it. It's probably better to add an explicit interface to the parser |
| 11506 | for this.) |
| 11507 | |
| 11508 | - There is now a library module xdrlib.py which can read and write the |
| 11509 | XDR data format as used by Sun RPC, for example. It uses the struct |
| 11510 | module. |
| 11511 | |
| 11512 | |
| 11513 | Changes in library modules |
| 11514 | -------------------------- |
| 11515 | |
| 11516 | - Module codehack.py is now completely obsolete. |
| 11517 | |
| 11518 | - The pickle.py module has been updated to make it compatible with the |
| 11519 | new binary format that cPickle.c produces. By default it produces the |
| 11520 | old all-ASCII format compatible with the old pickle.py, still much |
| 11521 | faster than pickle.py; it will read both formats automatically. A few |
| 11522 | other updates have been made. |
| 11523 | |
| 11524 | - A new helper module, copy_reg.py, is provided to register extensions |
| 11525 | to the pickling code. |
| 11526 | |
| 11527 | - Revamped module tokenize.py is much more accurate and has an |
| 11528 | interface that makes it a breeze to write code to colorize Python |
| 11529 | source code. Contributed by Ka-Ping Yee. |
| 11530 | |
| 11531 | - In ihooks.py, ModuleLoader.load_module() now closes the file under |
| 11532 | all circumstances. |
| 11533 | |
| 11534 | - The tempfile.py module has a new class, TemporaryFile, which creates |
| 11535 | an open temporary file that will be deleted automatically when |
| 11536 | closed. This works on Windows and MacOS as well as on Unix. (Jim |
| 11537 | Fulton.) |
| 11538 | |
| 11539 | - Changes to the cgi.py module: Most imports are now done at the |
| 11540 | top of the module, which provides a speedup when using ni (Jim |
| 11541 | Fulton). The problem with file upload to a Windows platform is solved |
| 11542 | by using the new tempfile.TemporaryFile class; temporary files are now |
| 11543 | always opened in binary mode (Jim Fulton). The cgi.escape() function |
| 11544 | now takes an optional flag argument that quotes '"' to '"'. It |
| 11545 | is now possible to invoke cgi.py from a command line script, to test |
| 11546 | cgi scripts more easily outside an http server. There's an optional |
| 11547 | limit to the size of uploads to POST (Skip Montanaro). Added a |
| 11548 | 'strict_parsing' option to all parsing functions (Jim Fulton). The |
| 11549 | function parse_qs() now uses urllib.unquote() on the name as well as |
| 11550 | the value of fields (Clarence Gardner). The FieldStorage class now |
| 11551 | has a __len__() method. |
| 11552 | |
| 11553 | - httplib.py: the socket object is no longer closed; all HTTP/1.* |
| 11554 | responses are now accepted; and it is now thread-safe (by not using |
| 11555 | the regex module). |
| 11556 | |
| 11557 | - BaseHTTPModule.py: treat all HTTP/1.* versions the same. |
| 11558 | |
| 11559 | - The popen2.py module is now rewritten using a class, which makes |
| 11560 | access to the standard error stream and the process id of the |
| 11561 | subprocess possible. |
| 11562 | |
| 11563 | - Added timezone support to the rfc822.py module, in the form of a |
| 11564 | getdate_tz() method and a parsedate_tz() function; also a mktime_tz(). |
| 11565 | Also added recognition of some non-standard date formats, by Lars |
| 11566 | Wirzenius, and RFC 850 dates (Chris Lawrence). |
| 11567 | |
| 11568 | - mhlib.py: various enhancements, including almost compatible parsing |
| 11569 | of message sequence specifiers without invoking a subprocess. Also |
| 11570 | added a createmessage() method by Lars Wirzenius. |
| 11571 | |
| 11572 | - The StringIO.StringIO class now supports readline(nbytes). (Lars |
| 11573 | Wirzenius.) (Of course, you should be using cStringIO for performance.) |
| 11574 | |
| 11575 | - UserDict.py supports the new dictionary methods as well. |
| 11576 | |
| 11577 | - Improvements for whrandom.py by Tim Peters: use 32-bit arithmetic to |
| 11578 | speed it up, and replace 0 seed values by 1 to avoid degeneration. |
| 11579 | A bug was fixed in the test for invalid arguments. |
| 11580 | |
| 11581 | - Module ftplib.py: added support for parsing a .netrc file (Fred |
| 11582 | Drake). Also added an ntransfercmd() method to the FTP class, which |
| 11583 | allows access to the expected size of a transfer when available, and a |
| 11584 | parse150() function to the module which parses the corresponding 150 |
| 11585 | response. |
| 11586 | |
| 11587 | - urllib.py: the ftp cache is now limited to 10 entries. Added |
| 11588 | quote_plus() and unquote_plus() functions which are like quote() and |
| 11589 | unquote() but also replace spaces with '+' or vice versa, for |
| 11590 | encoding/decoding CGI form arguments. Catch all errors from the ftp |
| 11591 | module. HTTP requests now add the Host: header line. The proxy |
| 11592 | variable names are now mapped to lower case, for Windows. The |
| 11593 | spliturl() function no longer erroneously throws away all data past |
| 11594 | the first newline. The basejoin() function now intereprets "../" |
| 11595 | correctly. I *believe* that the problems with "exception raised in |
| 11596 | __del__" under certain circumstances have been fixed (mostly by |
| 11597 | changes elsewher in the interpreter). |
| 11598 | |
| 11599 | - In urlparse.py, there is a cache for results in urlparse.urlparse(); |
| 11600 | its size limit is set to 20. Also, new URL schemes shttp, https, and |
| 11601 | snews are "supported". |
| 11602 | |
| 11603 | - shelve.py: use cPickle and cStringIO when available. Also added |
| 11604 | a sync() method, which calls the database's sync() method if there is |
| 11605 | one. |
| 11606 | |
| 11607 | - The mimetools.py module now uses the available Python modules for |
| 11608 | decoding quoted-printable, uuencode and base64 formats, rather than |
| 11609 | creating a subprocess. |
| 11610 | |
| 11611 | - The python debugger (pdb.py, and its base class bdb.py) now support |
| 11612 | conditional breakpoints. See the docs. |
| 11613 | |
| 11614 | - The modules base64.py, uu.py and quopri.py can now be used as simple |
| 11615 | command line utilities. |
| 11616 | |
| 11617 | - Various small fixes to the nntplib.py module that I can't bother to |
| 11618 | document in detail. |
| 11619 | |
| 11620 | - Sjoerd Mullender's mimify.py module now supports base64 encoding and |
| 11621 | includes functions to handle the funny encoding you sometimes see in mail |
| 11622 | headers. It is now documented. |
| 11623 | |
| 11624 | - mailbox.py: Added BabylMailbox. Improved the way the mailbox is |
| 11625 | gotten from the environment. |
| 11626 | |
| 11627 | - Many more modules now correctly open files in binary mode when this |
| 11628 | is necessary on non-Unix platforms. |
| 11629 | |
| 11630 | - The copying functions in the undocumented module shutil.py are |
| 11631 | smarter. |
| 11632 | |
| 11633 | - The Writer classes in the formatter.py module now have a flush() |
| 11634 | method. |
| 11635 | |
| 11636 | - The sgmllib.py module accepts hyphens and periods in the middle of |
| 11637 | attribute names. While this is against the SGML standard, there is |
| 11638 | some HTML out there that uses this... |
| 11639 | |
| 11640 | - The interface for the Python bytecode disassembler module, dis.py, |
| 11641 | has been enhanced quite a bit. There's now one main function, |
| 11642 | dis.dis(), which takes almost any kind of object (function, module, |
| 11643 | class, instance, method, code object) and disassembles it; without |
| 11644 | arguments it disassembles the last frame of the last traceback. The |
| 11645 | other functions have changed slightly, too. |
| 11646 | |
| 11647 | - The imghdr.py module recognizes new image types: BMP, PNG. |
| 11648 | |
| 11649 | - The string.py module has a new function replace(str, old, new, |
| 11650 | [maxsplit]) which does substring replacements. It is actually |
| 11651 | implemented in C in the strop module. The functions [r]find() an |
| 11652 | [r]index() have an optional 4th argument indicating the end of the |
| 11653 | substring to search, alsoo implemented by their strop counterparts. |
| 11654 | (Remember, never import strop -- import string uses strop when |
| 11655 | available with zero overhead.) |
| 11656 | |
| 11657 | - The string.join() function now accepts any sequence argument, not |
| 11658 | just lists and tuples. |
| 11659 | |
| 11660 | - The string.maketrans() requires its first two arguments to be |
| 11661 | present. The old version didn't require them, but there's not much |
| 11662 | point without them, and the documentation suggests that they are |
| 11663 | required, so we fixed the code to match the documentation. |
| 11664 | |
| 11665 | - The regsub.py module has a function clear_cache(), which clears its |
| 11666 | internal cache of compiled regular expressions. Also, the cache now |
| 11667 | takes the current syntax setting into account. (However, this module |
| 11668 | is now obsolete -- use the sub() or subn() functions or methods in the |
| 11669 | re module.) |
| 11670 | |
| 11671 | - The undocumented module Complex.py has been removed, now that Python |
| 11672 | has built-in complex numbers. A similar module remains as |
| 11673 | Demo/classes/Complex.py, as an example. |
| 11674 | |
| 11675 | |
| 11676 | Changes to the build process |
| 11677 | ---------------------------- |
| 11678 | |
| 11679 | - The way GNU readline is configured is totally different. The |
| 11680 | --with-readline configure option is gone. It is now an extension |
| 11681 | module, which may be loaded dynamically. You must enable it (and |
| 11682 | specify the correct linraries to link with) in the Modules/Setup file. |
| 11683 | Importing the module installs some hooks which enable command line |
| 11684 | editing. When the interpreter shell is invoked interactively, it |
| 11685 | attempts to import the readline module; when this fails, the default |
| 11686 | input mechanism is used. The hook variables are PyOS_InputHook and |
| 11687 | PyOS_ReadlineFunctionPointer. (Code contributed by Lee Busby, with |
| 11688 | ideas from William Magro.) |
| 11689 | |
| 11690 | - New build procedure: a single library, libpython1.5.a, is now built, |
| 11691 | which contains absolutely everything except for a one-line main() |
| 11692 | program (which calls Py_Main(argc, argv) to start the interpreter |
| 11693 | shell). This makes life much simpler for applications that need to |
| 11694 | embed Python. The serial number of the build is now included in the |
| 11695 | version string (sys.version). |
| 11696 | |
| 11697 | - As far as I can tell, neither gcc -Wall nor the Microsoft compiler |
| 11698 | emits a single warning any more when compiling Python. |
| 11699 | |
| 11700 | - A number of new Makefile variables have been added for special |
| 11701 | situations, e.g. LDLAST is appended to the link command. These are |
| 11702 | used by editing the Makefile or passing them on the make command |
| 11703 | line. |
| 11704 | |
| 11705 | - A set of patches from Lee Busby has been integrated that make it |
| 11706 | possible to catch floating point exceptions. Use the configure option |
| 11707 | --with-fpectl to enable the patches; the extension modules fpectl and |
| 11708 | fpetest provide control to enable/disable and test the feature, |
| 11709 | respectively. |
| 11710 | |
| 11711 | - The support for shared libraries under AIX is now simpler and more |
| 11712 | robust. Thanks to Vladimir Marangozov for revamping his own patches! |
| 11713 | |
| 11714 | - The Modules/makesetup script now reads a file Setup.local as well as |
| 11715 | a file Setup. Most changes to the Setup script can be done by editing |
| 11716 | Setup.local instead, which makes it easier to carry a particular setup |
| 11717 | over from one release to the next. |
| 11718 | |
| 11719 | - The Modules/makesetup script now copies any "include" lines it |
| 11720 | encounters verbatim into the output Makefile. It also recognizes .cxx |
| 11721 | and .cpp as C++ source files. |
| 11722 | |
| 11723 | - The configure script is smarter about C compiler options; e.g. with |
| 11724 | gcc it uses -O2 and -g when possible, and on some other platforms it |
| 11725 | uses -Olimit 1500 to avoid a warning from the optimizer about the main |
| 11726 | loop in ceval.c (which has more than 1000 basic blocks). |
| 11727 | |
| 11728 | - The configure script now detects whether malloc(0) returns a NULL |
| 11729 | pointer or a valid block (of length zero). This avoids the nonsense |
| 11730 | of always adding one byte to all malloc() arguments on most platforms. |
| 11731 | |
| 11732 | - The configure script has a new option, --with-dec-threads, to enable |
| 11733 | DEC threads on DEC Alpha platforms. Also, --with-threads is now an |
| 11734 | alias for --with-thread (this was the Most Common Typo in configure |
| 11735 | arguments). |
| 11736 | |
| 11737 | - Many changes in Doc/Makefile; amongst others, latex2html is now used |
| 11738 | to generate HTML from all latex documents. |
| 11739 | |
| 11740 | |
| 11741 | Change to the Python/C API |
| 11742 | -------------------------- |
| 11743 | |
| 11744 | - Because some interfaces have changed, the PYTHON_API macro has been |
| 11745 | bumped. Most extensions built for the old API version will still run, |
| 11746 | but I can't guarantee this. Python prints a warning message on |
| 11747 | version mismatches; it dumps core when the version mismatch causes a |
| 11748 | serious problem :-) |
| 11749 | |
| 11750 | - I've completed the Grand Renaming, with the help of Roger Masse and |
| 11751 | Barry Warsaw. This makes reading or debugging the code much easier. |
| 11752 | Many other unrelated code reorganizations have also been carried out. |
| 11753 | The allobjects.h header file is gone; instead, you would have to |
| 11754 | include Python.h followed by rename2.h. But you're better off running |
| 11755 | Tools/scripts/fixcid.py -s Misc/RENAME on your source, so you can omit |
| 11756 | the rename2.h; it will disappear in the next release. |
| 11757 | |
| 11758 | - Various and sundry small bugs in the "abstract" interfaces have been |
| 11759 | fixed. Thanks to all the (involuntary) testers of the Python 1.4 |
| 11760 | version! Some new functions have been added, e.g. PySequence_List(o), |
| 11761 | equivalent to list(o) in Python. |
| 11762 | |
| 11763 | - New API functions PyLong_FromUnsignedLong() and |
| 11764 | PyLong_AsUnsignedLong(). |
| 11765 | |
| 11766 | - The API functions in the file cgensupport.c are no longer |
| 11767 | supported. This file has been moved to Modules and is only ever |
| 11768 | compiled when the SGI specific 'gl' module is built. |
| 11769 | |
| 11770 | - PyObject_Compare() can now raise an exception. Check with |
| 11771 | PyErr_Occurred(). The comparison function in an object type may also |
| 11772 | raise an exception. |
| 11773 | |
| 11774 | - The slice interface uses an upper bound of INT_MAX when no explicit |
| 11775 | upper bound is given (e.x. for a[1:]). It used to ask the object for |
| 11776 | its length and do the calculations. |
| 11777 | |
| 11778 | - Support for multiple independent interpreters. See Doc/api.tex, |
| 11779 | functions Py_NewInterpreter() and Py_EndInterpreter(). Since the |
| 11780 | documentation is incomplete, also see the new Demo/pysvr example |
| 11781 | (which shows how to use these in a threaded application) and the |
| 11782 | source code. |
| 11783 | |
| 11784 | - There is now a Py_Finalize() function which "de-initializes" |
| 11785 | Python. It is possible to completely restart the interpreter |
| 11786 | repeatedly by calling Py_Finalize() followed by Py_Initialize(). A |
| 11787 | change of functionality in Py_Initialize() means that it is now a |
| 11788 | fatal error to call it while the interpreter is already initialized. |
| 11789 | The old, half-hearted Py_Cleanup() routine is gone. Use of Py_Exit() |
| 11790 | is deprecated (it is nothing more than Py_Finalize() followed by |
| 11791 | exit()). |
| 11792 | |
| 11793 | - There are no known memory leaks left. While Py_Finalize() doesn't |
| 11794 | free *all* allocated memory (some of it is hard to track down), |
| 11795 | repeated calls to Py_Finalize() and Py_Initialize() do not create |
| 11796 | unaccessible heap blocks. |
| 11797 | |
| 11798 | - There is now explicit per-thread state. (Inspired by, but not the |
| 11799 | same as, Greg Stein's free threading patches.) |
| 11800 | |
| 11801 | - There is now better support for threading C applications. There are |
| 11802 | now explicit APIs to manipulate the interpreter lock. Read the source |
| 11803 | or the Demo/pysvr example; the new functions are |
| 11804 | PyEval_{Acquire,Release}{Lock,Thread}(). |
| 11805 | |
| 11806 | - The test macro DEBUG has changed to Py_DEBUG, to avoid interference |
| 11807 | with other libraries' DEBUG macros. Likewise for any other test |
| 11808 | macros that didn't yet start with Py_. |
| 11809 | |
| 11810 | - New wrappers around malloc() and friends: Py_Malloc() etc. call |
| 11811 | malloc() and call PyErr_NoMemory() when it fails; PyMem_Malloc() call |
| 11812 | just malloc(). Use of these wrappers could be essential if multiple |
| 11813 | memory allocators exist (e.g. when using certain DLL setups under |
| 11814 | Windows). (Idea by Jim Fulton.) |
| 11815 | |
| 11816 | - New C API PyImport_Import() which uses whatever __import__() hook |
| 11817 | that is installed for the current execution environment. By Jim |
| 11818 | Fulton. |
| 11819 | |
| 11820 | - It is now possible for an extension module's init function to fail |
| 11821 | non-fatally, by calling one of the PyErr_* functions and returning. |
| 11822 | |
| 11823 | - The PyInt_AS_LONG() and PyFloat_AS_DOUBLE() macros now cast their |
| 11824 | argument to the proper type, like the similar PyString macros already |
| 11825 | did. (Suggestion by Marc-Andre Lemburg.) Similar for PyList_GET_SIZE |
| 11826 | and PyList_GET_ITEM. |
| 11827 | |
| 11828 | - Some of the Py_Get* function, like Py_GetVersion() (but not yet |
| 11829 | Py_GetPath()) are now declared as returning a const char *. (More |
| 11830 | should follow.) |
| 11831 | |
| 11832 | - Changed the run-time library to check for exceptions after object |
| 11833 | comparisons. PyObject_Compare() can now return an exception; use |
| 11834 | PyErr_Occurred() to check (there is *no* special return value). |
| 11835 | |
| 11836 | - PyFile_WriteString() and Py_Flushline() now return error indicators |
| 11837 | instead of clearing exceptions. This fixes an obscure bug where using |
| 11838 | these would clear a pending exception, discovered by Just van Rossum. |
| 11839 | |
| 11840 | - There's a new function, PyArg_ParseTupleAndKeywords(), which parses |
| 11841 | an argument list including keyword arguments. Contributed by Geoff |
| 11842 | Philbrick. |
| 11843 | |
| 11844 | - PyArg_GetInt() is gone. |
| 11845 | |
| 11846 | - It's no longer necessary to include graminit.h when calling one of |
| 11847 | the extended parser API functions. The three public grammar start |
| 11848 | symbols are now in Python.h as Py_single_input, Py_file_input, and |
| 11849 | Py_eval_input. |
| 11850 | |
| 11851 | - The CObject interface has a new function, |
| 11852 | PyCObject_Import(module, name). It calls PyCObject_AsVoidPtr() |
| 11853 | on the object referenced by "module.name". |
| 11854 | |
| 11855 | |
| 11856 | Tkinter |
| 11857 | ------- |
| 11858 | |
| 11859 | - On popular demand, _tkinter once again installs a hook for readline |
| 11860 | that processes certain Tk events while waiting for the user to type |
| 11861 | (using PyOS_InputHook). |
| 11862 | |
| 11863 | - A patch by Craig McPheeters plugs the most obnoxious memory leaks, |
| 11864 | caused by command definitions referencing widget objects beyond their |
| 11865 | lifetime. |
| 11866 | |
| 11867 | - New standard dialog modules: tkColorChooser.py, tkCommonDialog.py, |
| 11868 | tkMessageBox.py, tkFileDialog.py, tkSimpleDialog.py These interface |
| 11869 | with the new Tk dialog scripts, and provide more "native platform" |
| 11870 | style file selection dialog boxes on some platforms. Contributed by |
| 11871 | Fredrik Lundh. |
| 11872 | |
| 11873 | - Tkinter.py: when the first Tk object is destroyed, it sets the |
| 11874 | hiddel global _default_root to None, so that when another Tk object is |
| 11875 | created it becomes the new default root. Other miscellaneous |
| 11876 | changes and fixes. |
| 11877 | |
| 11878 | - The Image class now has a configure method. |
| 11879 | |
| 11880 | - Added a bunch of new winfo options to Tkinter.py; we should now be |
| 11881 | up to date with Tk 4.2. The new winfo options supported are: |
| 11882 | mananger, pointerx, pointerxy, pointery, server, viewable, visualid, |
| 11883 | visualsavailable. |
| 11884 | |
| 11885 | - The broken bind() method on Canvas objects defined in the Canvas.py |
| 11886 | module has been fixed. The CanvasItem and Group classes now also have |
| 11887 | an unbind() method. |
| 11888 | |
| 11889 | - The problem with Tkinter.py falling back to trying to import |
| 11890 | "tkinter" when "_tkinter" is not found has been fixed -- it no longer |
| 11891 | tries "tkinter", ever. This makes diagnosing the problem "_tkinter |
| 11892 | not configured" much easier and will hopefully reduce the newsgroup |
| 11893 | traffic on this topic. |
| 11894 | |
| 11895 | - The ScrolledText module once again supports the 'cnf' parameter, to |
| 11896 | be compatible with the examples in Mark Lutz' book (I know, I know, |
| 11897 | too late...) |
| 11898 | |
| 11899 | - The _tkinter.c extension module has been revamped. It now support |
| 11900 | Tk versions 4.1 through 8.0; support for 4.0 has been dropped. It |
| 11901 | works well under Windows and Mac (with the latest Tk ports to those |
| 11902 | platforms). It also supports threading -- it is safe for one |
| 11903 | (Python-created) thread to be blocked in _tkinter.mainloop() while |
| 11904 | other threads modify widgets. To make the changes visible, those |
| 11905 | threads must use update_idletasks()method. (The patch for threading |
| 11906 | in 1.5a3 was broken; in 1.5a4, it is back in a different version, |
| 11907 | which requires access to the Tcl sources to get it to work -- hence it |
| 11908 | is disabled by default.) |
| 11909 | |
| 11910 | - A bug in _tkinter.c has been fixed, where Split() with a string |
| 11911 | containing an unmatched '"' could cause an exception or core dump. |
| 11912 | |
| 11913 | - Unfortunately, on Windows and Mac, Tk 8.0 no longer supports |
| 11914 | CreateFileHandler, so _tkinter.createfilehandler is not available on |
| 11915 | those platforms when using Tk 8.0 or later. I will have to rethink |
| 11916 | how to interface with Tcl's lower-level event mechanism, or with its |
| 11917 | channels (which are like Python's file-like objects). Jack Jansen has |
| 11918 | provided a fix for the Mac, so createfilehandler *is* actually |
| 11919 | supported there; maybe I can adapt his fix for Windows. |
| 11920 | |
| 11921 | |
| 11922 | Tools and Demos |
| 11923 | --------------- |
| 11924 | |
| 11925 | - A new regression test suite is provided, which tests most of the |
| 11926 | standard and built-in modules. The regression test is run by invoking |
| 11927 | the script Lib/test/regrtest.py. Barry Warsaw wrote the test harnass; |
| 11928 | he and Roger Masse contributed most of the new tests. |
| 11929 | |
| 11930 | - New tool: faqwiz -- the CGI script that is used to maintain the |
| 11931 | Python FAQ (http://grail.cnri.reston.va.us/cgi-bin/faqw.py). In |
| 11932 | Tools/faqwiz. |
| 11933 | |
| 11934 | - New tool: webchecker -- a simple extensible web robot that, when |
| 11935 | aimed at a web server, checks that server for dead links. Available |
| 11936 | are a command line utility as well as a Tkinter based GUI version. In |
| 11937 | Tools/webchecker. A simplified version of this program is dissected |
| 11938 | in my article in O'Reilly's WWW Journal, the issue on Scripting |
| 11939 | Languages (Vol 2, No 2); Scripting the Web with Python (pp 97-120). |
| 11940 | Includes a parser for robots.txt files by Skip Montanaro. |
| 11941 | |
| 11942 | - New small tools: cvsfiles.py (prints a list of all files under CVS |
| 11943 | n a particular directory tree), treesync.py (a rather Guido-specific |
| 11944 | script to synchronize two source trees, one on Windows NT, the other |
| 11945 | one on Unix under CVS but accessible from the NT box), and logmerge.py |
| 11946 | (sort a collection of RCS or CVS logs by date). In Tools/scripts. |
| 11947 | |
| 11948 | - The freeze script now also works under Windows (NT). Another |
| 11949 | feature allows the -p option to be pointed at the Python source tree |
| 11950 | instead of the installation prefix. This was loosely based on part of |
| 11951 | xfreeze by Sam Rushing and Bill Tutt. |
| 11952 | |
| 11953 | - New examples (Demo/extend) that show how to use the generic |
| 11954 | extension makefile (Misc/Makefile.pre.in). |
| 11955 | |
| 11956 | - Tools/scripts/h2py.py now supports C++ comments. |
| 11957 | |
| 11958 | - Tools/scripts/pystone.py script is upgraded to version 1.1; there |
| 11959 | was a bug in version 1.0 (distributed with Python 1.4) that leaked |
| 11960 | memory. Also, in 1.1, the LOOPS variable is incremented to 10000. |
| 11961 | |
| 11962 | - Demo/classes/Rat.py completely rewritten by Sjoerd Mullender. |
| 11963 | |
| 11964 | |
| 11965 | Windows (NT and 95) |
| 11966 | ------------------- |
| 11967 | |
| 11968 | - New project files for Developer Studio (Visual C++) 5.0 for Windows |
| 11969 | NT (the old VC++ 4.2 Makefile is also still supported, but will |
| 11970 | eventually be withdrawn due to its bulkiness). |
| 11971 | |
| 11972 | - See the note on the new module search path in the "Miscellaneous" section |
| 11973 | above. |
| 11974 | |
| 11975 | - Support for Win32s (the 32-bit Windows API under Windows 3.1) is |
| 11976 | basically withdrawn. If it still works for you, you're lucky. |
| 11977 | |
| 11978 | - There's a new extension module, msvcrt.c, which provides various |
| 11979 | low-level operations defined in the Microsoft Visual C++ Runtime Library. |
| 11980 | These include locking(), setmode(), get_osfhandle(), set_osfhandle(), and |
| 11981 | console I/O functions like kbhit(), getch() and putch(). |
| 11982 | |
| 11983 | - The -u option not only sets the standard I/O streams to unbuffered |
| 11984 | status, but also sets them in binary mode. (This can also be done |
| 11985 | using msvcrt.setmode(), by the way.) |
| 11986 | |
| 11987 | - The, sys.prefix and sys.exec_prefix variables point to the directory |
| 11988 | where Python is installed, or to the top of the source tree, if it was run |
| 11989 | from there. |
| 11990 | |
| 11991 | - The various os.path modules (posixpath, ntpath, macpath) now support |
| 11992 | passing more than two arguments to the join() function, so |
| 11993 | os.path.join(a, b, c) is the same as os.path.join(a, os.path.join(b, |
| 11994 | c)). |
| 11995 | |
| 11996 | - The ntpath module (normally used as os.path) supports ~ to $HOME |
| 11997 | expansion in expanduser(). |
| 11998 | |
| 11999 | - The freeze tool now works on Windows. |
| 12000 | |
| 12001 | - See also the Tkinter category for a sad note on |
| 12002 | _tkinter.createfilehandler(). |
| 12003 | |
| 12004 | - The truncate() method for file objects now works on Windows. |
| 12005 | |
| 12006 | - Py_Initialize() is no longer called when the DLL is loaded. You |
| 12007 | must call it yourself. |
| 12008 | |
| 12009 | - The time module's clock() function now has good precision through |
| 12010 | the use of the Win32 API QueryPerformanceCounter(). |
| 12011 | |
| 12012 | - Mark Hammond will release Python 1.5 versions of PythonWin and his |
| 12013 | other Windows specific code: the win32api extensions, COM/ActiveX |
| 12014 | support, and the MFC interface. |
| 12015 | |
| 12016 | |
| 12017 | Mac |
| 12018 | --- |
| 12019 | |
| 12020 | - As always, the Macintosh port will be done by Jack Jansen. He will |
| 12021 | make a separate announcement for the Mac specific source code and the |
| 12022 | binary distribution(s) when these are ready. |
| 12023 | |
| 12024 | |
| 12025 | ====================================================================== |
Guido van Rossum | a7925f1 | 1994-01-26 10:20:16 +0000 | [diff] [blame] | 12026 | |
Guido van Rossum | aa25386 | 1994-10-06 17:18:57 +0000 | [diff] [blame] | 12027 | |
Guido van Rossum | c30e95f | 1996-07-30 18:53:51 +0000 | [diff] [blame] | 12028 | ===================================== |
Guido van Rossum | 821a558 | 1997-05-23 04:05:31 +0000 | [diff] [blame] | 12029 | ==> Release 1.4 (October 25 1996) <== |
| 12030 | ===================================== |
| 12031 | |
| 12032 | (Starting in reverse chronological order:) |
| 12033 | |
| 12034 | - Changed disclaimer notice. |
| 12035 | |
| 12036 | - Added SHELL=/bin/sh to Misc/Makefile.pre.in -- some Make versions |
| 12037 | default to the user's login shell. |
| 12038 | |
| 12039 | - In Lib/tkinter/Tkinter.py, removed bogus binding of <Delete> in Text |
| 12040 | widget, and bogus bspace() function. |
| 12041 | |
| 12042 | - In Lib/cgi.py, bumped __version__ to 2.0 and restored a truncated |
| 12043 | paragraph. |
| 12044 | |
| 12045 | - Fixed the NT Makefile (PC/vc40.mak) for VC 4.0 to set /MD for all |
| 12046 | subprojects, and to remove the (broken) experimental NumPy |
| 12047 | subprojects. |
| 12048 | |
| 12049 | - In Lib/py_compile.py, cast mtime to long() so it will work on Mac |
| 12050 | (where os.stat() returns mtimes as floats.) |
| 12051 | - Set self.rfile unbuffered (like self.wfile) in SocketServer.py, to |
| 12052 | fix POST in CGIHTTPServer.py. |
| 12053 | |
| 12054 | - Version 2.83 of Misc/python-mode.el for Emacs is included. |
| 12055 | |
| 12056 | - In Modules/regexmodule.c, fixed symcomp() to correctly handle a new |
| 12057 | group starting immediately after a group tag. |
| 12058 | |
| 12059 | - In Lib/SocketServer.py, changed the mode for rfile to unbuffered. |
| 12060 | |
| 12061 | - In Objects/stringobject.c, fixed the compare function to do the |
| 12062 | first char comparison in unsigned mode, for consistency with the way |
| 12063 | other characters are compared by memcmp(). |
| 12064 | |
| 12065 | - In Lib/tkinter/Tkinter.py, fixed Scale.get() to support floats. |
| 12066 | |
| 12067 | - In Lib/urllib.py, fix another case where openedurl wasn't set. |
| 12068 | |
| 12069 | (XXX Sorry, the rest is in totally random order. No time to fix it.) |
| 12070 | |
| 12071 | - SyntaxError exceptions detected during code generation |
| 12072 | (e.g. assignment to an expression) now include a line number. |
| 12073 | |
| 12074 | - Don't leave trailing / or \ in script directory inserted in front of |
| 12075 | sys.path. |
| 12076 | |
| 12077 | - Added a note to Tools/scripts/classfix.py abouts its historical |
| 12078 | importance. |
| 12079 | |
| 12080 | - Added Misc/Makefile.pre.in, a universal Makefile for extensions |
| 12081 | built outside the distribution. |
| 12082 | |
| 12083 | - Rewritten Misc/faq2html.py, by Ka-Ping Yee. |
| 12084 | |
| 12085 | - Install shared modules with mode 555 (needed for performance on some |
| 12086 | platforms). |
| 12087 | |
| 12088 | - Some changes to standard library modules to avoid calling append() |
| 12089 | with more than one argument -- while supported, this should be |
| 12090 | outlawed, and I don't want to set a bad example. |
| 12091 | |
| 12092 | - bdb.py (and hence pdb.py) supports calling run() with a code object |
| 12093 | instead of a code string. |
| 12094 | |
| 12095 | - Fixed an embarrassing bug cgi.py which prevented correct uploading |
| 12096 | of binary files from Netscape (which doesn't distinguish between |
| 12097 | binary and text files). Also added dormant logging support, which |
| 12098 | makes it easier to debug the cgi module itself. |
| 12099 | |
| 12100 | - Added default writer to constructor of NullFormatter class. |
| 12101 | |
| 12102 | - Use binary mode for socket.makefile() calls in ftplib.py. |
| 12103 | |
| 12104 | - The ihooks module no longer "installs" itself upon import -- this |
| 12105 | was an experimental feature that helped ironing out some bugs but that |
| 12106 | slowed down code that imported it without the need to install it |
| 12107 | (e.g. the rexec module). Also close the file in some cases and add |
| 12108 | the __file__ attribute to loaded modules. |
| 12109 | |
| 12110 | - The test program for mailbox.py is now more useful. |
| 12111 | |
| 12112 | - Added getparamnames() to Message class in mimetools.py -- it returns |
| 12113 | the names of parameters to the content-type header. |
| 12114 | |
| 12115 | - Fixed a typo in ni that broke the loop stripping "__." from names. |
| 12116 | |
| 12117 | - Fix sys.path[0] for scripts run via pdb.py's new main program. |
| 12118 | |
| 12119 | - profile.py can now also run a script, like pdb. |
| 12120 | |
| 12121 | - Fix a small bug in pyclbr -- don't add names starting with _ when |
| 12122 | emulating from ... import *. |
| 12123 | |
| 12124 | - Fixed a series of embarrassing typos in rexec's handling of standard |
| 12125 | I/O redirection. Added some more "safe" built-in modules: cmath, |
| 12126 | errno, operator. |
| 12127 | |
| 12128 | - Fixed embarrassing typo in shelve.py. |
| 12129 | |
| 12130 | - Added SliceType and EllipsisType to types.py. |
| 12131 | |
| 12132 | - In urllib.py, added handling for error 301 (same as 302); added |
| 12133 | geturl() method to get the URL after redirection. |
| 12134 | |
| 12135 | - Fixed embarrassing typo in xdrlib.py. Also fixed typo in Setup.in |
| 12136 | for _xdrmodule.c and removed redundant #include from _xdrmodule.c. |
| 12137 | |
| 12138 | - Fixed bsddbmodule.c to add binary mode indicator on platforms that |
| 12139 | have it. This should make it working on Windows NT. |
| 12140 | |
| 12141 | - Changed last uses of #ifdef NT to #ifdef MS_WINDOWS or MS_WIN32, |
| 12142 | whatever applies. Also rationalized some other tests for various MS |
| 12143 | platforms. |
| 12144 | |
| 12145 | - Added the sources for the NT installer script used for Python |
| 12146 | 1.4beta3. Not tested with this release, but better than nothing. |
| 12147 | |
| 12148 | - A compromise in pickle's defenses against Trojan horses: a |
| 12149 | user-defined function is now okay where a class is expected. A |
| 12150 | built-in function is not okay, to prevent pickling something that |
| 12151 | will execute os.system("rm -f *") when unpickling. |
| 12152 | |
| 12153 | - dis.py will print the name of local variables referenced by local |
| 12154 | load/store/delete instructions. |
| 12155 | |
| 12156 | - Improved portability of SimpleHTTPServer module to non-Unix |
| 12157 | platform. |
| 12158 | |
| 12159 | - The thread.h interface adds an extra argument to down_sema(). This |
| 12160 | only affects other C code that uses thread.c; the Python thread module |
| 12161 | doesn't use semaphores (which aren't provided on all platforms where |
| 12162 | Python threads are supported). Note: on NT, this change is not |
| 12163 | implemented. |
| 12164 | |
| 12165 | - Fixed some typos in abstract.h; corrected signature of |
| 12166 | PyNumber_Coerce, added PyMapping_DelItem. Also fixed a bug in |
| 12167 | abstract.c's PyObject_CallMethod(). |
| 12168 | |
| 12169 | - apply(classname, (), {}) now works even if the class has no |
| 12170 | __init__() method. |
| 12171 | |
| 12172 | - Implemented complex remainder and divmod() (these would dump core!). |
| 12173 | Conversion of complex numbers to int, long int or float now raises an |
| 12174 | exception, since there is no meaningful way to do it without losing |
| 12175 | information. |
| 12176 | |
| 12177 | - Fixed bug in built-in complex() function which gave the wrong result |
| 12178 | for two real arguments. |
| 12179 | |
| 12180 | - Change the hash algorithm for strings -- the multiplier is now |
| 12181 | 1000003 instead of 3, which gives better spread for short strings. |
| 12182 | |
| 12183 | - New default path for Windows NT, the registry structure now supports |
| 12184 | default paths for different install packages. (Mark Hammond -- the |
| 12185 | next PythonWin release will use this.) |
| 12186 | |
| 12187 | - Added more symbols to the python_nt.def file. |
| 12188 | |
| 12189 | - When using GNU readline, set rl_readline_name to "python". |
| 12190 | |
| 12191 | - The Ellipses built-in name has been renamed to Ellipsis -- this is |
| 12192 | the correct singular form. Thanks to Ka-Ping Yee, who saved us from |
| 12193 | eternal embarrassment. |
| 12194 | |
| 12195 | - Bumped the PYTHON_API_VERSION to 1006, due to the Ellipses -> |
| 12196 | Ellipsis name change. |
| 12197 | |
| 12198 | - Updated the library reference manual. Added documentation of |
| 12199 | restricted mode (rexec, Bastion) and the formatter module (for use |
| 12200 | with the htmllib module). Fixed the documentation of htmllib |
| 12201 | (finally). |
| 12202 | |
| 12203 | - The reference manual is now maintained in FrameMaker. |
| 12204 | |
| 12205 | - Upgraded scripts Doc/partparse.py and Doc/texi2html.py. |
| 12206 | |
| 12207 | - Slight improvements to Doc/Makefile. |
| 12208 | |
| 12209 | - Added fcntl.lockf(). This should be used for Unix file locking |
| 12210 | instead of the posixfile module; lockf() is more portable. |
| 12211 | |
| 12212 | - The getopt module now supports long option names, thanks to Lars |
| 12213 | Wizenius. |
| 12214 | |
| 12215 | - Plenty of changes to Tkinter and Canvas, mostly due to Fred Drake |
| 12216 | and Nils Fischbeck. |
| 12217 | |
| 12218 | - Use more bits of time.time() in whrandom's default seed(). |
| 12219 | |
| 12220 | - Performance hack for regex module's regs attribute. |
| 12221 | |
| 12222 | - Don't close already closed socket in socket module. |
| 12223 | |
| 12224 | - Correctly handle separators containing embedded nulls in |
| 12225 | strop.split, strop.find and strop.rfind. Also added more detail to |
| 12226 | error message for strop.atoi and friends. |
| 12227 | |
| 12228 | - Moved fallback definition for hypot() to Python/hypot.c. |
| 12229 | |
| 12230 | - Added fallback definition for strdup, in Python/strdup.c. |
| 12231 | |
| 12232 | - Fixed some bugs where a function would return 0 to indicate an error |
| 12233 | where it should return -1. |
| 12234 | |
| 12235 | - Test for error returned by time.localtime(), and rationalized its MS |
| 12236 | tests. |
| 12237 | |
| 12238 | - Added Modules/Setup.local file, which is processed after Setup. |
| 12239 | |
| 12240 | - Corrected bug in toplevel Makefile.in -- execution of regen script |
| 12241 | would not use the right PATH and PYTHONPATH. |
| 12242 | |
| 12243 | - Various and sundry NeXT configuration changes (sigh). |
| 12244 | |
| 12245 | - Support systems where libreadline needs neither termcap nor curses. |
| 12246 | |
| 12247 | - Improved ld_so_aix script and python.exp file (for AIX). |
| 12248 | |
| 12249 | - More stringent test for working <stdarg.h> in configure script. |
| 12250 | |
| 12251 | - Removed Demo/www subdirectory -- it was totally out of date. |
| 12252 | |
| 12253 | - Improved demos and docs for Fred Drake's parser module; fixed one |
| 12254 | typo in the module itself. |
| 12255 | |
| 12256 | |
| 12257 | ========================================= |
| 12258 | ==> Release 1.4beta3 (August 26 1996) <== |
| 12259 | ========================================= |
| 12260 | |
| 12261 | |
| 12262 | (XXX This is less readable that it should. I promise to restructure |
| 12263 | it for the final 1.4 release.) |
| 12264 | |
| 12265 | |
| 12266 | What's new in 1.4beta3 (since beta2)? |
| 12267 | ------------------------------------- |
| 12268 | |
| 12269 | - Name mangling to implement a simple form of class-private variables. |
| 12270 | A name of the form "__spam" can't easily be used outside the class. |
| 12271 | (This was added in 1.4beta3, but left out of the 1.4beta3 release |
| 12272 | message.) |
| 12273 | |
| 12274 | - In urllib.urlopen(): HTTP URLs containing user:passwd@host are now |
| 12275 | handled correctly when using a proxy server. |
| 12276 | |
| 12277 | - In ntpath.normpath(): don't truncate to 8+3 format. |
| 12278 | |
| 12279 | - In mimetools.choose_boundary(): don't die when getuid() or getpid() |
| 12280 | aren't defined. |
| 12281 | |
| 12282 | - Module urllib: some optimizations to (un)quoting. |
| 12283 | |
| 12284 | - New module MimeWriter for writing MIME documents. |
| 12285 | |
| 12286 | - More changes to formatter module. |
| 12287 | |
| 12288 | - The freeze script works once again and is much more robust (using |
| 12289 | sys.prefix etc.). It also supports a -o option to specify an |
| 12290 | output directory. |
| 12291 | |
| 12292 | - New module whichdb recognizes dbm, gdbm and bsddb/dbhash files. |
| 12293 | |
| 12294 | - The Doc/Makefile targets have been reorganized somewhat to remove the |
| 12295 | insistence on always generating PostScript. |
| 12296 | |
| 12297 | - The texinfo to html filter (Doc/texi2html.py) has been improved somewhat. |
| 12298 | |
| 12299 | - "errors.h" has been renamed to "pyerrors.h" to resolve a long-standing |
| 12300 | name conflict on the Mac. |
| 12301 | |
| 12302 | - Linking a module compiled with a different setting for Py_TRACE_REFS now |
| 12303 | generates a linker error rather than a core dump. |
| 12304 | |
| 12305 | - The cgi module has a new convenience function print_exception(), which |
| 12306 | formats a python exception using HTML. It also fixes a bug in the |
| 12307 | compatibility code and adds a dubious feature which makes it possible to |
| 12308 | have two query strings, one in the URL and one in the POST data. |
| 12309 | |
| 12310 | - A subtle change in the unpickling of class instances makes it possible |
| 12311 | to unpickle in restricted execution mode, where the __dict__ attribute is |
| 12312 | not available (but setattr() is). |
| 12313 | |
| 12314 | - Documentation for os.path.splitext() (== posixpath.splitext()) has been |
| 12315 | cleared up. It splits at the *last* dot. |
| 12316 | |
| 12317 | - posixfile locking is now also correctly supported on AIX. |
| 12318 | |
| 12319 | - The tempfile module once again honors an initial setting of tmpdir. It |
| 12320 | now works on Windows, too. |
| 12321 | |
| 12322 | - The traceback module has some new functions to extract, format and print |
| 12323 | the active stack. |
| 12324 | |
| 12325 | - Some translation functions in the urllib module have been made a little |
| 12326 | less sluggish. |
| 12327 | |
| 12328 | - The addtag_* methods for Canvas widgets in Tkinter as well as in the |
| 12329 | separate Canvas class have been fixed so they actually do something |
| 12330 | meaningful. |
| 12331 | |
| 12332 | - A tiny _test() function has been added to Tkinter.py. |
| 12333 | |
| 12334 | - A generic Makefile for dynamically loaded modules is provided in the Misc |
| 12335 | subdirectory (Misc/gMakefile). |
| 12336 | |
| 12337 | - A new version of python-mode.el for Emacs is provided. See |
| 12338 | http://www.python.org/ftp/emacs/pmdetails.html for details. The |
| 12339 | separate file pyimenu.el is no longer needed, imenu support is folded |
| 12340 | into python-mode.el. |
| 12341 | |
| 12342 | - The configure script can finally correctly find the readline library in a |
Walter Dörwald | f0dfc7a | 2003-10-20 14:01:56 +0000 | [diff] [blame] | 12343 | non-standard location. The LDFLAGS variable is passed on the Makefiles |
Guido van Rossum | 821a558 | 1997-05-23 04:05:31 +0000 | [diff] [blame] | 12344 | from the configure script. |
| 12345 | |
| 12346 | - Shared libraries are now installed as programs (i.e. with executable |
| 12347 | permission). This is required on HP-UX and won't hurt on other systems. |
| 12348 | |
| 12349 | - The objc.c module is no longer part of the distribution. Objective-C |
| 12350 | support may become available as contributed software on the ftp site. |
| 12351 | |
| 12352 | - The sybase module is no longer part of the distribution. A much |
| 12353 | improved sybase module is available as contributed software from the |
| 12354 | ftp site. |
| 12355 | |
| 12356 | - _tkinter is now compatible with Tcl 7.5 / Tk 4.1 patch1 on Windows and |
| 12357 | Mac (don't use unpatched Tcl/Tk!). The default line in the Setup.in file |
| 12358 | now links with Tcl 7.5 / Tk 4.1 rather than 7.4/4.0. |
| 12359 | |
| 12360 | - In Setup, you can now write "*shared*" instead of "*noconfig*", and you |
| 12361 | can use *.so and *.sl as shared libraries. |
| 12362 | |
| 12363 | - Some more fidgeting for AIX shared libraries. |
| 12364 | |
| 12365 | - The mpz module is now compatible with GMP 2.x. (Not tested by me.) |
| 12366 | (Note -- a complete replacement by Niels Mo"ller, called gpmodule, is |
| 12367 | available from the contrib directory on the ftp site.) |
| 12368 | |
| 12369 | - A warning is written to sys.stderr when a __del__ method raises an |
| 12370 | exception (formerly, such exceptions were completely ignored). |
| 12371 | |
| 12372 | - The configure script now defines HAVE_OLD_CPP if the C preprocessor is |
| 12373 | incapable of ANSI style token concatenation and stringification. |
| 12374 | |
| 12375 | - All source files (except a few platform specific modules) are once again |
| 12376 | compatible with K&R C compilers as well as ANSI compilers. In particular, |
| 12377 | ANSI-isms have been removed or made conditional in complexobject.c, |
| 12378 | getargs.c and operator.c. |
| 12379 | |
| 12380 | - The abstract object API has three new functions, PyObject_DelItem, |
| 12381 | PySequence_DelItem, and PySequence_DelSlice. |
| 12382 | |
| 12383 | - The operator module has new functions delitem and delslice, and the |
| 12384 | functions "or" and "and" are renamed to "or_" and "and_" (since "or" and |
| 12385 | "and" are reserved words). ("__or__" and "__and__" are unchanged.) |
| 12386 | |
| 12387 | - The environment module is no longer supported; putenv() is now a function |
| 12388 | in posixmodule (also under NT). |
| 12389 | |
| 12390 | - Error in filter(<function>, "") has been fixed. |
| 12391 | |
| 12392 | - Unrecognized keyword arguments raise TypeError, not KeyError. |
| 12393 | |
| 12394 | - Better portability, fewer bugs and memory leaks, fewer compiler warnings, |
| 12395 | some more documentation. |
| 12396 | |
| 12397 | - Bug in float power boundary case (0.0 to the negative integer power) |
| 12398 | fixed. |
| 12399 | |
| 12400 | - The test of negative number to the float power has been moved from the |
| 12401 | built-in pow() functin to floatobject.c (so complex numbers can yield the |
| 12402 | correct result). |
| 12403 | |
| 12404 | - The bug introduced in beta2 where shared libraries loaded (using |
| 12405 | dlopen()) from the current directory would fail, has been fixed. |
| 12406 | |
| 12407 | - Modules imported as shared libraries now also have a __file__ attribute, |
| 12408 | giving the filename from which they were loaded. The only modules without |
| 12409 | a __file__ attribute now are built-in modules. |
| 12410 | |
| 12411 | - On the Mac, dynamically loaded modules can end in either ".slb" or |
| 12412 | ".<platform>.slb" where <platform> is either "CFM68K" or "ppc". The ".slb" |
| 12413 | extension should only be used for "fat" binaries. |
| 12414 | |
| 12415 | - C API addition: marshal.c now supports |
| 12416 | PyMarshal_WriteObjectToString(object). |
| 12417 | |
| 12418 | - C API addition: getargs.c now supports |
| 12419 | PyArg_ParseTupleAndKeywords(args, kwdict, format, kwnames, ...) |
| 12420 | to parse keyword arguments. |
| 12421 | |
| 12422 | - The PC versioning scheme (sys.winver) has changed once again. the |
| 12423 | version number is now "<digit>.<digit>.<digit>.<apiversion>", where the |
| 12424 | first three <digit>s are the Python version (e.g. "1.4.0" for Python 1.4, |
| 12425 | "1.4.1" for Python 1.4.1 -- the beta level is not included) and |
| 12426 | <apiversion> is the four-digit PYTHON_API_VERSION (currently 1005). |
| 12427 | |
| 12428 | - h2py.py accepts whitespace before the # in CPP directives |
| 12429 | |
| 12430 | - On Solaris 2.5, it should now be possible to use either Posix threads or |
| 12431 | Solaris threads (XXX: how do you select which is used???). (Note: the |
| 12432 | Python pthreads interface doesn't fully support semaphores yet -- anyone |
| 12433 | care to fix this?) |
| 12434 | |
| 12435 | - Thread support should now work on AIX, using either DCE threads or |
| 12436 | pthreads. |
| 12437 | |
| 12438 | - New file Demo/sockets/unicast.py |
| 12439 | |
| 12440 | - Working Mac port, with CFM68K support, with Tk 4.1 support (though not |
| 12441 | both) (XXX) |
| 12442 | |
| 12443 | - New project setup for PC port, now compatible with PythonWin, with |
| 12444 | _tkinter and NumPy support (XXX) |
| 12445 | |
| 12446 | - New module site.py (XXX) |
| 12447 | |
| 12448 | - New module xdrlib.py and optional support module _xdrmodule.c (XXX) |
| 12449 | |
| 12450 | - parser module adapted to new grammar, complete w/ Doc & Demo (XXX) |
| 12451 | |
| 12452 | - regen script fixed (XXX) |
| 12453 | |
| 12454 | - new machdep subdirectories Lib/{aix3,aix4,next3_3,freebsd2,linux2} (XXX) |
| 12455 | |
| 12456 | - testall now also tests math module (XXX) |
| 12457 | |
| 12458 | - string.atoi c.s. now raise an exception for an empty input string. |
| 12459 | |
| 12460 | - At last, it is no longer necessary to define HAVE_CONFIG_H in order to |
| 12461 | have config.h included at various places. |
| 12462 | |
| 12463 | - Unrecognized keyword arguments now raise TypeError rather than KeyError. |
| 12464 | |
| 12465 | - The makesetup script recognizes files with extension .so or .sl as |
| 12466 | (shared) libraries. |
| 12467 | |
| 12468 | - 'access' is no longer a reserved word, and all code related to its |
| 12469 | implementation is gone (or at least #ifdef'ed out). This should make |
| 12470 | Python a little speedier too! |
| 12471 | |
| 12472 | - Performance enhancements suggested by Sjoerd Mullender. This includes |
| 12473 | the introduction of two new optional function pointers in type object, |
| 12474 | getattro and setattro, which are like getattr and setattr but take a |
| 12475 | string object instead of a C string pointer. |
| 12476 | |
| 12477 | - New operations in string module: lstrip(s) and rstrip(s) strip whitespace |
| 12478 | only on the left or only on the right, A new optional third argument to |
| 12479 | split() specifies the maximum number of separators honored (so |
| 12480 | splitfields(s, sep, n) returns a list of at most n+1 elements). (Since |
| 12481 | 1.3, splitfields(s, None) is totally equivalent to split(s).) |
| 12482 | string.capwords() has an optional second argument specifying the |
| 12483 | separator (which is passed to split()). |
| 12484 | |
| 12485 | - regsub.split() has the same addition as string.split(). regsub.splitx(s, |
| 12486 | sep, maxsep) implements the functionality that was regsub.split(s, 1) in |
| 12487 | 1.4beta2 (return a list containing the delimiters as well as the words). |
| 12488 | |
| 12489 | - Final touch for AIX loading, rewritten Misc/AIX-NOTES. |
| 12490 | |
| 12491 | - In Modules/_tkinter.c, when using Tk 4.1 or higher, use className |
| 12492 | argument to _tkinter.create() to set Tcl's argv0 variable, so X |
| 12493 | resources use the right resource class again. |
| 12494 | |
| 12495 | - Add #undef fabs to Modules/mathmodule.c for macintosh. |
| 12496 | |
| 12497 | - Added some macro renames for AIX in Modules/operator.c. |
| 12498 | |
| 12499 | - Removed spurious 'E' from Doc/liberrno.tex. |
| 12500 | |
| 12501 | - Got rid of some cruft in Misc/ (dlMakefile, pyimenu.el); added new |
| 12502 | Misc/gMakefile and new version of Misc/python-mode.el. |
| 12503 | |
| 12504 | - Fixed typo in Lib/ntpath.py (islink has "return false" which gives a |
| 12505 | NameError). |
| 12506 | |
| 12507 | - Added missing "from types import *" to Lib/tkinter/Canvas.py. |
| 12508 | |
| 12509 | - Added hint about using default args for __init__ to pickle docs. |
| 12510 | |
| 12511 | - Corrected typo in Inclide/abstract.h: PySequence_Lenth -> |
| 12512 | PySequence_Length. |
| 12513 | |
| 12514 | - Some improvements to Doc/texi2html.py. |
| 12515 | |
| 12516 | - In Python/import.c, Cast unsigned char * in struct _frozen to char * |
| 12517 | in calls to rds_object(). |
| 12518 | |
| 12519 | - In doc/ref4.tex, added note about scope of lambda bodies. |
| 12520 | |
| 12521 | What's new in 1.4beta2 (since beta1)? |
| 12522 | ------------------------------------- |
| 12523 | |
| 12524 | - Portability bug in the md5.h header solved. |
| 12525 | |
| 12526 | - The PC build procedure now really works, and sets sys.platform to a |
| 12527 | meaningful value (a few things were botched in beta 1). Lib/dos_8x3 |
| 12528 | is now a standard part of the distribution (alas). |
| 12529 | |
| 12530 | - More improvements to the installation procedure. Typing "make install" |
| 12531 | now inserts the version number in the pathnames of almost everything |
| 12532 | installed, and creates the machine dependent modules (FCNTL.py etc.) if not |
| 12533 | supplied by the distribution. (XXX There's still a problem with the latter |
| 12534 | because the "regen" script requires that Python is installed. Some manual |
| 12535 | intervention may still be required.) (This has been fixed in 1.4beta3.) |
| 12536 | |
| 12537 | - New modules: errno, operator (XXX). |
| 12538 | |
| 12539 | - Changes for use with Numerical Python: builtin function slice() and |
| 12540 | Ellipses object, and corresponding syntax: |
| 12541 | |
| 12542 | x[lo:hi:stride] == x[slice(lo, hi, stride)] |
| 12543 | x[a, ..., z] == x[(a, Ellipses, z)] |
| 12544 | |
Raymond Hettinger | 565ea5a | 2004-10-02 11:02:59 +0000 | [diff] [blame] | 12545 | - New documentation for errno and cgi modules. |
Guido van Rossum | 821a558 | 1997-05-23 04:05:31 +0000 | [diff] [blame] | 12546 | |
| 12547 | - The directory containing the script passed to the interpreter is |
| 12548 | inserted in from of sys.path; "." is no longer a default path |
| 12549 | component. |
| 12550 | |
| 12551 | - Optional third string argument to string.translate() specifies |
| 12552 | characters to delete. New function string.maketrans() creates a |
| 12553 | translation table for translate() or for regex.compile(). |
| 12554 | |
| 12555 | - Module posix (and hence module os under Unix) now supports putenv(). |
| 12556 | Moreover, module os is enhanced so that if putenv() is supported, |
| 12557 | assignments to os.environ entries make the appropriate putenv() call. |
| 12558 | (XXX the putenv() implementation can leak a small amount of memory per |
| 12559 | call.) |
| 12560 | |
| 12561 | - pdb.py can now be invoked from the command line to debug a script: |
| 12562 | python pdb.py <script> <arg> ... |
| 12563 | |
| 12564 | - Much improved parseaddr() in rfc822. |
| 12565 | |
| 12566 | - In cgi.py, you can now pass an alternative value for environ to |
| 12567 | nearly all functions. |
| 12568 | |
| 12569 | - You can now assign to instance variables whose name begins and ends |
| 12570 | with '__'. |
| 12571 | |
| 12572 | - New version of Fred Drake's parser module and associates (token, |
| 12573 | symbol, AST). |
| 12574 | |
| 12575 | - New PYTHON_API_VERSION value and .pyc file magic number (again!). |
| 12576 | |
| 12577 | - The "complex" internal structure type is now called "Py_complex" to |
| 12578 | avoid name conflicts. |
| 12579 | |
| 12580 | - Numerous small bugs fixed. |
| 12581 | |
| 12582 | - Slight pickle speedups. |
| 12583 | |
| 12584 | - Some slight speedups suggested by Sjoerd (more coming in 1.4 final). |
| 12585 | |
| 12586 | - NeXT portability mods by Bill Bumgarner integrated. |
| 12587 | |
| 12588 | - Modules regexmodule.c, bsddbmodule.c and xxmodule.c have been |
| 12589 | converted to new naming style. |
| 12590 | |
| 12591 | |
| 12592 | What's new in 1.4beta1 (since 1.3)? |
| 12593 | ----------------------------------- |
| 12594 | |
| 12595 | - Added sys.platform and sys.exec_platform for Bill Janssen. |
| 12596 | |
| 12597 | - Installation has been completely overhauled. "make install" now installs |
| 12598 | everything, not just the python binary. Installation uses the install-sh |
| 12599 | script (borrowed from X11) to install each file. |
| 12600 | |
| 12601 | - New functions in the posix module: mkfifo, plock, remove (== unlink), |
| 12602 | and ftruncate. More functions are also available under NT. |
| 12603 | |
| 12604 | - New function in the fcntl module: flock. |
| 12605 | |
| 12606 | - Shared library support for FreeBSD. |
| 12607 | |
| 12608 | - The --with-readline option can now be used without a DIRECTORY argument, |
| 12609 | for systems where libreadline.* is in one of the standard places. It is |
| 12610 | also possible for it to be a shared library. |
| 12611 | |
| 12612 | - The extension tkinter has been renamed to _tkinter, to avoid confusion |
| 12613 | with Tkinter.py oncase insensitive file systems. It now supports Tk 4.1 as |
| 12614 | well as 4.0. |
| 12615 | |
| 12616 | - Author's change of address from CWI in Amsterdam, The Netherlands, to |
| 12617 | CNRI in Reston, VA, USA. |
| 12618 | |
| 12619 | - The math.hypot() function is now always available (if it isn't found in |
| 12620 | the C math library, Python provides its own implementation). |
| 12621 | |
| 12622 | - The latex documentation is now compatible with latex2e, thanks to David |
| 12623 | Ascher. |
| 12624 | |
| 12625 | - The expression x**y is now equivalent to pow(x, y). |
| 12626 | |
| 12627 | - The indexing expression x[a, b, c] is now equivalent to x[(a, b, c)]. |
| 12628 | |
| 12629 | - Complex numbers are now supported. Imaginary constants are written with |
| 12630 | a 'j' or 'J' prefix, general complex numbers can be formed by adding a real |
| 12631 | part to an imaginary part, like 3+4j. Complex numbers are always stored in |
| 12632 | floating point form, so this is equivalent to 3.0+4.0j. It is also |
| 12633 | possible to create complex numbers with the new built-in function |
| 12634 | complex(re, [im]). For the footprint-conscious, complex number support can |
| 12635 | be disabled by defining the symbol WITHOUT_COMPLEX. |
| 12636 | |
| 12637 | - New built-in function list() is the long-awaited counterpart of tuple(). |
| 12638 | |
| 12639 | - There's a new "cmath" module which provides the same functions as the |
| 12640 | "math" library but with complex arguments and results. (There are very |
| 12641 | good reasons why math.sqrt(-1) still raises an exception -- you have to use |
| 12642 | cmath.sqrt(-1) to get 1j for an answer.) |
| 12643 | |
| 12644 | - The Python.h header file (which is really the same as allobjects.h except |
| 12645 | it disables support for old style names) now includes several more files, |
| 12646 | so you have to have fewer #include statements in the average extension. |
| 12647 | |
| 12648 | - The NDEBUG symbol is no longer used. Code that used to be dependent on |
| 12649 | the presence of NDEBUG is now present on the absence of DEBUG. TRACE_REFS |
| 12650 | and REF_DEBUG have been renamed to Py_TRACE_REFS and Py_REF_DEBUG, |
| 12651 | respectively. At long last, the source actually compiles and links without |
| 12652 | errors when this symbol is defined. |
| 12653 | |
| 12654 | - Several symbols that didn't follow the new naming scheme have been |
| 12655 | renamed (usually by adding to rename2.h) to use a Py or _Py prefix. There |
| 12656 | are no external symbols left without a Py or _Py prefix, not even those |
| 12657 | defined by sources that were incorporated from elsewhere (regexpr.c, |
| 12658 | md5c.c). (Macros are a different story...) |
| 12659 | |
| 12660 | - There are now typedefs for the structures defined in config.c and |
| 12661 | frozen.c. |
| 12662 | |
| 12663 | - New PYTHON_API_VERSION value and .pyc file magic number. |
| 12664 | |
| 12665 | - New module Bastion. (XXX) |
| 12666 | |
| 12667 | - Improved performance of StringIO module. |
| 12668 | |
| 12669 | - UserList module now supports + and * operators. |
| 12670 | |
| 12671 | - The binhex and binascii modules now actually work. |
| 12672 | |
| 12673 | - The cgi module has been almost totally rewritten and documented. |
| 12674 | It now supports file upload and a new data type to handle forms more |
| 12675 | flexibly. |
| 12676 | |
| 12677 | - The formatter module (for use with htmllib) has been overhauled (again). |
| 12678 | |
| 12679 | - The ftplib module now supports passive mode and has doc strings. |
| 12680 | |
| 12681 | - In (ideally) all places where binary files are read or written, the file |
| 12682 | is now correctly opened in binary mode ('rb' or 'wb') so the code will work |
| 12683 | on Mac or PC. |
| 12684 | |
| 12685 | - Dummy versions of os.path.expandvars() and expanduser() are now provided |
| 12686 | on non-Unix platforms. |
| 12687 | |
| 12688 | - Module urllib now has two new functions url2pathname and pathname2url |
| 12689 | which turn local filenames into "file:..." URLs using the same rules as |
| 12690 | Netscape (why be different). it also supports urlretrieve() with a |
| 12691 | pathname parameter, and honors the proxy environment variables (http_proxy |
| 12692 | etc.). The URL parsing has been improved somewhat, too. |
| 12693 | |
| 12694 | - Micro improvements to urlparse. Added urlparse.urldefrag() which |
| 12695 | removes a trailing ``#fragment'' if any. |
| 12696 | |
| 12697 | - The mailbox module now supports MH style message delimiters as well. |
| 12698 | |
| 12699 | - The mhlib module contains some new functionality: setcontext() to set the |
| 12700 | current folder and parsesequence() to parse a sequence as commonly passed |
| 12701 | to MH commands (e.g. 1-10 or last:5). |
| 12702 | |
| 12703 | - New module mimify for conversion to and from MIME format of email |
| 12704 | messages. |
| 12705 | |
| 12706 | - Module ni now automatically installs itself when first imported -- this |
| 12707 | is against the normal rule that modules should define classes and functions |
| 12708 | but not invoke them, but appears more useful in the case that two |
| 12709 | different, independent modules want to use ni's features. |
| 12710 | |
| 12711 | - Some small performance enhancements in module pickle. |
| 12712 | |
| 12713 | - Small interface change to the profile.run*() family of functions -- more |
| 12714 | sensible handling of return values. |
| 12715 | |
| 12716 | - The officially registered Mac creator for Python files is 'Pyth'. This |
| 12717 | replaces 'PYTH' which was used before but never registered. |
| 12718 | |
| 12719 | - Added regsub.capwords(). (XXX) |
| 12720 | |
| 12721 | - Added string.capwords(), string.capitalize() and string.translate(). |
| 12722 | (XXX) |
| 12723 | |
| 12724 | - Fixed an interface bug in the rexec module: it was impossible to pass a |
| 12725 | hooks instance to the RExec class. rexec now also supports the dynamic |
| 12726 | loading of modules from shared libraries. Some other interfaces have been |
| 12727 | added too. |
| 12728 | |
| 12729 | - Module rfc822 now caches the headers in a dictionary for more efficient |
| 12730 | lookup. |
| 12731 | |
| 12732 | - The sgmllib module now understands a limited number of SGML "shorthands" |
| 12733 | like <A/.../ for <A>...</A>. (It's not clear that this was a good idea...) |
| 12734 | |
| 12735 | - The tempfile module actually tries a number of different places to find a |
| 12736 | usable temporary directory. (This was prompted by certain Linux |
| 12737 | installations that appear to be missing a /usr/tmp directory.) [A bug in |
| 12738 | the implementation that would ignore a pre-existing tmpdir global has been |
| 12739 | fixed in beta3.] |
| 12740 | |
| 12741 | - Much improved and enhanved FileDialog module for Tkinter. |
| 12742 | |
| 12743 | - Many small changes to Tkinter, to bring it more in line with Tk 4.0 (as |
| 12744 | well as Tk 4.1). |
| 12745 | |
| 12746 | - New socket interfaces include ntohs(), ntohl(), htons(), htonl(), and |
| 12747 | s.dup(). Sockets now work correctly on Windows. On Windows, the built-in |
| 12748 | extension is called _socket and a wrapper module win/socket.py provides |
| 12749 | "makefile()" and "dup()" functionality. On Windows, the select module |
| 12750 | works only with socket objects. |
| 12751 | |
| 12752 | - Bugs in bsddb module fixed (e.g. missing default argument values). |
| 12753 | |
| 12754 | - The curses extension now includes <ncurses.h> when available. |
| 12755 | |
| 12756 | - The gdbm module now supports opening databases in "fast" mode by |
| 12757 | specifying 'f' as the second character or the mode string. |
| 12758 | |
| 12759 | - new variables sys.prefix and sys.exec_prefix pass corresponding |
| 12760 | configuration options / Makefile variables to the Python programmer. |
| 12761 | |
| 12762 | - The ``new'' module now supports creating new user-defined classes as well |
| 12763 | as instances thereof. |
| 12764 | |
| 12765 | - The soundex module now sports get_soundex() to get the soundex value for an |
| 12766 | arbitrary string (formerly it would only do soundex-based string |
| 12767 | comparison) as well as doc strings. |
| 12768 | |
| 12769 | - New object type "cobject" to safely wrap void pointers for passing them |
| 12770 | between various extension modules. |
| 12771 | |
| 12772 | - More efficient computation of float**smallint. |
| 12773 | |
| 12774 | - The mysterious bug whereby "x.x" (two occurrences of the same |
| 12775 | one-character name) typed from the commandline would sometimes fail |
| 12776 | mysteriously. |
| 12777 | |
| 12778 | - The initialization of the readline function can now be invoked by a C |
| 12779 | extension through PyOS_ReadlineInit(). |
| 12780 | |
| 12781 | - There's now an externally visible pointer PyImport_FrozenModules which |
| 12782 | can be changed by an embedding application. |
| 12783 | |
| 12784 | - The argument parsing functions now support a new format character 'D' to |
| 12785 | specify complex numbers. |
| 12786 | |
| 12787 | - Various memory leaks plugged and bugs fixed. |
| 12788 | |
| 12789 | - Improved support for posix threads (now that real implementations are |
| 12790 | beginning to apepar). Still no fully functioning semaphores. |
| 12791 | |
| 12792 | - Some various and sundry improvements and new entries in the Tools |
| 12793 | directory. |
| 12794 | |
| 12795 | |
| 12796 | ===================================== |
Guido van Rossum | c30e95f | 1996-07-30 18:53:51 +0000 | [diff] [blame] | 12797 | ==> Release 1.3 (13 October 1995) <== |
| 12798 | ===================================== |
| 12799 | |
| 12800 | Major change |
| 12801 | ============ |
| 12802 | |
| 12803 | Two words: Keyword Arguments. See the first section of Chapter 12 of |
| 12804 | the Tutorial. |
| 12805 | |
| 12806 | (The rest of this file is textually the same as the remaining sections |
| 12807 | of that chapter.) |
| 12808 | |
| 12809 | |
| 12810 | Changes to the WWW and Internet tools |
| 12811 | ===================================== |
| 12812 | |
| 12813 | The "htmllib" module has been rewritten in an incompatible fashion. |
| 12814 | The new version is considerably more complete (HTML 2.0 except forms, |
| 12815 | but including all ISO-8859-1 entity definitions), and easy to use. |
| 12816 | Small changes to "sgmllib" have also been made, to better match the |
| 12817 | tokenization of HTML as recognized by other web tools. |
| 12818 | |
| 12819 | A new module "formatter" has been added, for use with the new |
| 12820 | "htmllib" module. |
| 12821 | |
| 12822 | The "urllib"and "httplib" modules have been changed somewhat to allow |
| 12823 | overriding unknown URL types and to support authentication. They now |
| 12824 | use "mimetools.Message" instead of "rfc822.Message" to parse headers. |
| 12825 | The "endrequest()" method has been removed from the HTTP class since |
| 12826 | it breaks the interaction with some servers. |
| 12827 | |
| 12828 | The "rfc822.Message" class has been changed to allow a flag to be |
| 12829 | passed in that says that the file is unseekable. |
| 12830 | |
| 12831 | The "ftplib" module has been fixed to be (hopefully) more robust on |
| 12832 | Linux. |
| 12833 | |
| 12834 | Several new operations that are optionally supported by servers have |
| 12835 | been added to "nntplib": "xover", "xgtitle", "xpath" and "date". |
| 12836 | |
| 12837 | Other Language Changes |
| 12838 | ====================== |
| 12839 | |
| 12840 | The "raise" statement now takes an optional argument which specifies |
| 12841 | the traceback to be used when printing the exception's stack trace. |
| 12842 | This must be a traceback object, such as found in "sys.exc_traceback". |
| 12843 | When omitted or given as "None", the old behavior (to generate a stack |
| 12844 | trace entry for the current stack frame) is used. |
| 12845 | |
| 12846 | The tokenizer is now more tolerant of alien whitespace. Control-L in |
| 12847 | the leading whitespace of a line resets the column number to zero, |
| 12848 | while Control-R just before the end of the line is ignored. |
| 12849 | |
| 12850 | Changes to Built-in Operations |
| 12851 | ============================== |
| 12852 | |
| 12853 | For file objects, "f.read(0)" and "f.readline(0)" now return an empty |
| 12854 | string rather than reading an unlimited number of bytes. For the |
| 12855 | latter, omit the argument altogether or pass a negative value. |
| 12856 | |
| 12857 | A new system variable, "sys.platform", has been added. It specifies |
| 12858 | the current platform, e.g. "sunos5" or "linux1". |
| 12859 | |
| 12860 | The built-in functions "input()" and "raw_input()" now use the GNU |
| 12861 | readline library when it has been configured (formerly, only |
| 12862 | interactive input to the interpreter itself was read using GNU |
| 12863 | readline). The GNU readline library provides elaborate line editing |
| 12864 | and history. The Python debugger ("pdb") is the first beneficiary of |
| 12865 | this change. |
| 12866 | |
| 12867 | Two new built-in functions, "globals()" and "locals()", provide access |
| 12868 | to dictionaries containming current global and local variables, |
| 12869 | respectively. (These augment rather than replace "vars()", which |
| 12870 | returns the current local variables when called without an argument, |
| 12871 | and a module's global variables when called with an argument of type |
| 12872 | module.) |
| 12873 | |
| 12874 | The built-in function "compile()" now takes a third possible value for |
| 12875 | the kind of code to be compiled: specifying "'single'" generates code |
| 12876 | for a single interactive statement, which prints the output of |
| 12877 | expression statements that evaluate to something else than "None". |
| 12878 | |
| 12879 | Library Changes |
| 12880 | =============== |
| 12881 | |
| 12882 | There are new module "ni" and "ihooks" that support importing modules |
| 12883 | with hierarchical names such as "A.B.C". This is enabled by writing |
| 12884 | "import ni; ni.ni()" at the very top of the main program. These |
| 12885 | modules are amply documented in the Python source. |
| 12886 | |
| 12887 | The module "rexec" has been rewritten (incompatibly) to define a class |
| 12888 | and to use "ihooks". |
| 12889 | |
| 12890 | The "string.split()" and "string.splitfields()" functions are now the |
| 12891 | same function (the presence or absence of the second argument |
| 12892 | determines which operation is invoked); similar for "string.join()" |
| 12893 | and "string.joinfields()". |
| 12894 | |
| 12895 | The "Tkinter" module and its helper "Dialog" have been revamped to use |
| 12896 | keyword arguments. Tk 4.0 is now the standard. A new module |
| 12897 | "FileDialog" has been added which implements standard file selection |
| 12898 | dialogs. |
| 12899 | |
| 12900 | The optional built-in modules "dbm" and "gdbm" are more coordinated |
| 12901 | --- their "open()" functions now take the same values for their "flag" |
| 12902 | argument, and the "flag" and "mode" argument have default values (to |
| 12903 | open the database for reading only, and to create the database with |
| 12904 | mode "0666" minuse the umask, respectively). The memory leaks have |
| 12905 | finally been fixed. |
| 12906 | |
| 12907 | A new dbm-like module, "bsddb", has been added, which uses the BSD DB |
| 12908 | package's hash method. |
| 12909 | |
| 12910 | A portable (though slow) dbm-clone, implemented in Python, has been |
| 12911 | added for systems where none of the above is provided. It is aptly |
| 12912 | dubbed "dumbdbm". |
| 12913 | |
| 12914 | The module "anydbm" provides a unified interface to "bsddb", "gdbm", |
| 12915 | "dbm", and "dumbdbm", choosing the first one available. |
| 12916 | |
| 12917 | A new extension module, "binascii", provides a variety of operations |
| 12918 | for conversion of text-encoded binary data. |
| 12919 | |
| 12920 | There are three new or rewritten companion modules implemented in |
| 12921 | Python that can encode and decode the most common such formats: "uu" |
| 12922 | (uuencode), "base64" and "binhex". |
| 12923 | |
| 12924 | A module to handle the MIME encoding quoted-printable has also been |
| 12925 | added: "quopri". |
| 12926 | |
| 12927 | The parser module (which provides an interface to the Python parser's |
| 12928 | abstract syntax trees) has been rewritten (incompatibly) by Fred |
| 12929 | Drake. It now lets you change the parse tree and compile the result! |
| 12930 | |
| 12931 | The \code{syslog} module has been upgraded and documented. |
| 12932 | |
| 12933 | Other Changes |
| 12934 | ============= |
| 12935 | |
| 12936 | The dynamic module loader recognizes the fact that different filenames |
| 12937 | point to the same shared library and loads the library only once, so |
| 12938 | you can have a single shared library that defines multiple modules. |
| 12939 | (SunOS / SVR4 style shared libraries only.) |
| 12940 | |
| 12941 | Jim Fulton's ``abstract object interface'' has been incorporated into |
| 12942 | the run-time API. For more detailes, read the files |
| 12943 | "Include/abstract.h" and "Objects/abstract.c". |
| 12944 | |
| 12945 | The Macintosh version is much more robust now. |
| 12946 | |
| 12947 | Numerous things I have forgotten or that are so obscure no-one will |
| 12948 | notice them anyway :-) |
| 12949 | |
| 12950 | |
Guido van Rossum | f456b6d | 1995-01-04 19:20:37 +0000 | [diff] [blame] | 12951 | =================================== |
Guido van Rossum | d462f3d | 1995-10-09 21:30:37 +0000 | [diff] [blame] | 12952 | ==> Release 1.2 (13 April 1995) <== |
| 12953 | =================================== |
| 12954 | |
| 12955 | - Changes to Misc/python-mode.el: |
| 12956 | - Wrapping and indentation within triple quote strings should work |
| 12957 | properly now. |
| 12958 | - `Standard' bug reporting mechanism (use C-c C-b) |
| 12959 | - py-mark-block was moved to C-c C-m |
| 12960 | - C-c C-v shows you the python-mode version |
| 12961 | - a basic python-font-lock-keywords has been added for Emacs 19 |
| 12962 | font-lock colorizations. |
| 12963 | - proper interaction with pending-del and del-sel modes. |
| 12964 | - New py-electric-colon (:) command for improved outdenting. Also |
| 12965 | py-indent-line (TAB) should handle outdented lines better. |
| 12966 | - New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r) |
| 12967 | |
| 12968 | - The Library Reference has been restructured, and many new and |
| 12969 | existing modules are now documented, in particular the debugger and |
| 12970 | the profiler, as well as the persistency and the WWW/Internet support |
| 12971 | modules. |
| 12972 | |
| 12973 | - All known bugs have been fixed. For example the pow(2,2,3L) bug on |
| 12974 | Linux has been fixed. Also the re-entrancy problems with __del__ have |
| 12975 | been fixed. |
| 12976 | |
| 12977 | - All known memory leaks have been fixed. |
| 12978 | |
| 12979 | - Phase 2 of the Great Renaming has been executed. The header files |
| 12980 | now use the new names (PyObject instead of object, etc.). The linker |
| 12981 | also sees the new names. Most source files still use the old names, |
| 12982 | by virtue of the rename2.h header file. If you include Python.h, you |
| 12983 | only see the new names. Dynamically linked modules have to be |
| 12984 | recompiled. (Phase 3, fixing the rest of the sources, will be |
| 12985 | executed gradually with the release later versions.) |
| 12986 | |
| 12987 | - The hooks for implementing "safe-python" (better called "restricted |
| 12988 | execution") are in place. Specifically, the import statement is |
| 12989 | implemented by calling the built-in function __import__, and the |
| 12990 | built-in names used in a particular scope are taken from the |
| 12991 | dictionary __builtins__ in that scope's global dictionary. See also |
| 12992 | the new (unsupported, undocumented) module rexec.py. |
| 12993 | |
| 12994 | - The import statement now supports the syntax "import a.b.c" and |
| 12995 | "from a.b.c import name". No officially supported implementation |
| 12996 | exists, but one can be prototyped by replacing the built-in __import__ |
| 12997 | function. A proposal by Ken Manheimer is provided as newimp.py. |
| 12998 | |
| 12999 | - All machinery used by the import statement (or the built-in |
| 13000 | __import__ function) is now exposed through the new built-in module |
| 13001 | "imp" (see the library reference manual). All dynamic loading |
| 13002 | machinery is moved to the new file importdl.c. |
| 13003 | |
| 13004 | - Persistent storage is supported through the use of the modules |
| 13005 | "pickle" and "shelve" (implemented in Python). There's also a "copy" |
| 13006 | module implementing deepcopy and normal (shallow) copy operations. |
| 13007 | See the library reference manual. |
| 13008 | |
| 13009 | - Documentation strings for many objects types are accessible through |
| 13010 | the __doc__ attribute. Modules, classes and functions support special |
| 13011 | syntax to initialize the __doc__ attribute: if the first statement |
| 13012 | consists of just a string literal, that string literal becomes the |
| 13013 | value of the __doc__ attribute. The default __doc__ attribute is |
| 13014 | None. Documentation strings are also supported for built-in |
| 13015 | functions, types and modules; however this feature hasn't been widely |
| 13016 | used yet. See the 'new' module for an example. (Basically, the type |
| 13017 | object's tp_doc field contains the doc string for the type, and the |
| 13018 | 4th member of the methodlist structure contains the doc string for the |
| 13019 | method.) |
| 13020 | |
| 13021 | - The __coerce__ and __cmp__ methods for user-defined classes once |
| 13022 | again work as expected. As an example, there's a new standard class |
| 13023 | Complex in the library. |
| 13024 | |
| 13025 | - The functions posix.popen() and posix.fdopen() now have an optional |
| 13026 | third argument to specify the buffer size, and default their second |
| 13027 | (mode) argument to 'r' -- in analogy to the builtin open() function. |
| 13028 | The same applies to posixfile.open() and the socket method makefile(). |
| 13029 | |
| 13030 | - The thread.exit_thread() function now raises SystemExit so that |
| 13031 | 'finally' clauses are honored and a memory leak is plugged. |
| 13032 | |
| 13033 | - Improved X11 and Motif support, by Sjoerd Mullender. This extension |
| 13034 | is being maintained and distributed separately. |
| 13035 | |
| 13036 | - Improved support for the Apple Macintosh, in part by Jack Jansen, |
| 13037 | e.g. interfaces to (a few) resource mananger functions, get/set file |
| 13038 | type and creator, gestalt, sound manager, speech manager, MacTCP, comm |
| 13039 | toolbox, and the think C console library. This is being maintained |
| 13040 | and distributed separately. |
| 13041 | |
| 13042 | - Improved version for Windows NT, by Mark Hammond. This is being |
| 13043 | maintained and distributed separately. |
| 13044 | |
| 13045 | - Used autoconf 2.0 to generate the configure script. Adapted |
| 13046 | configure.in to use the new features in autoconf 2.0. |
| 13047 | |
| 13048 | - It now builds on the NeXT without intervention, even on the 3.3 |
| 13049 | Sparc pre-release. |
| 13050 | |
| 13051 | - Characters passed to isspace() and friends are masked to nonnegative |
| 13052 | values. |
| 13053 | |
| 13054 | - Correctly compute pow(-3.0, 3). |
| 13055 | |
| 13056 | - Fix portability problems with getopt (configure now checks for a |
| 13057 | non-GNU getopt). |
| 13058 | |
| 13059 | - Don't add frozenmain.o to libPython.a. |
| 13060 | |
| 13061 | - Exceptions can now be classes. ALl built-in exceptions are still |
| 13062 | string objects, but this will change in the future. |
| 13063 | |
| 13064 | - The socket module exports a long list of socket related symbols. |
| 13065 | (More built-in modules will export their symbolic constants instead of |
| 13066 | relying on a separately generated Python module.) |
| 13067 | |
| 13068 | - When a module object is deleted, it clears out its own dictionary. |
| 13069 | This fixes a circularity in the references between functions and |
| 13070 | their global dictionary. |
| 13071 | |
| 13072 | - Changed the error handling by [new]getargs() e.g. for "O&". |
| 13073 | |
| 13074 | - Dynamic loading of modules using shared libraries is supported for |
| 13075 | several new platforms. |
| 13076 | |
| 13077 | - Support "O&", "[...]" and "{...}" in mkvalue(). |
| 13078 | |
| 13079 | - Extension to findmethod(): findmethodinchain() (where a chain is a |
| 13080 | linked list of methodlist arrays). The calling interface for |
| 13081 | findmethod() has changed: it now gets a pointer to the (static!) |
| 13082 | methodlist structure rather than just to the function name -- this |
| 13083 | saves copying flags etc. into the (short-lived) method object. |
| 13084 | |
| 13085 | - The callable() function is now public. |
| 13086 | |
| 13087 | - Object types can define a few new operations by setting function |
| 13088 | pointers in the type object structure: tp_call defines how an object |
| 13089 | is called, and tp_str defines how an object's str() is computed. |
| 13090 | |
| 13091 | |
| 13092 | =================================== |
Guido van Rossum | f456b6d | 1995-01-04 19:20:37 +0000 | [diff] [blame] | 13093 | ==> Release 1.1.1 (10 Nov 1994) <== |
| 13094 | =================================== |
| 13095 | |
| 13096 | This is a pure bugfix release again. See the ChangeLog file for details. |
| 13097 | |
| 13098 | One exception: a few new features were added to tkinter. |
| 13099 | |
| 13100 | |
| 13101 | ================================= |
| 13102 | ==> Release 1.1 (11 Oct 1994) <== |
| 13103 | ================================= |
| 13104 | |
| 13105 | This release adds several new features, improved configuration and |
| 13106 | portability, and fixes more bugs than I can list here (including some |
| 13107 | memory leaks). |
| 13108 | |
| 13109 | The source compiles and runs out of the box on more platforms than |
| 13110 | ever -- including Windows NT. Makefiles or projects for a variety of |
| 13111 | non-UNIX platforms are provided. |
| 13112 | |
| 13113 | APOLOGY: some new features are badly documented or not at all. I had |
| 13114 | the choice -- postpone the new release indefinitely, or release it |
| 13115 | now, with working code but some undocumented areas. The problem with |
| 13116 | postponing the release is that people continue to suffer from existing |
| 13117 | bugs, and send me patches based on the previous release -- which I |
| 13118 | can't apply directly because my own source has changed. Also, some |
| 13119 | new modules (like signal) have been ready for release for quite some |
| 13120 | time, and people are anxiously waiting for them. In the case of |
| 13121 | signal, the interface is simple enough to figure out without |
| 13122 | documentation (if you're anxious enough :-). In this case it was not |
| 13123 | simple to release the module on its own, since it relies on many small |
| 13124 | patches elsewhere in the source. |
| 13125 | |
| 13126 | For most new Python modules, the source code contains comments that |
| 13127 | explain how to use them. Documentation for the Tk interface, written |
| 13128 | by Matt Conway, is available as tkinter-doc.tar.gz from the Python |
| 13129 | home and mirror ftp sites (see Misc/FAQ for ftp addresses). For the |
| 13130 | new operator overloading facilities, have a look at Demo/classes: |
| 13131 | Complex.py and Rat.py show how to implement a numeric type without and |
| 13132 | with __coerce__ method. Also have a look at the end of the Tutorial |
| 13133 | document (Doc/tut.tex). If you're still confused: use the newsgroup |
| 13134 | or mailing list. |
| 13135 | |
| 13136 | |
| 13137 | New language features: |
| 13138 | |
| 13139 | - More flexible operator overloading for user-defined classes |
| 13140 | (INCOMPATIBLE WITH PREVIOUS VERSIONS!) See end of tutorial. |
| 13141 | |
| 13142 | - Classes can define methods named __getattr__, __setattr__ and |
| 13143 | __delattr__ to trap attribute accesses. See end of tutorial. |
| 13144 | |
| 13145 | - Classes can define method __call__ so instances can be called |
| 13146 | directly. See end of tutorial. |
| 13147 | |
| 13148 | |
| 13149 | New support facilities: |
| 13150 | |
| 13151 | - The Makefiles (for the base interpreter as well as for extensions) |
| 13152 | now support creating dynamically loadable modules if the platform |
| 13153 | supports shared libraries. |
| 13154 | |
| 13155 | - Passing the interpreter a .pyc file as script argument will execute |
| 13156 | the code in that file. (On the Mac such files can be double-clicked!) |
| 13157 | |
| 13158 | - New Freeze script, to create independently distributable "binaries" |
| 13159 | of Python programs -- look in Demo/freeze |
| 13160 | |
| 13161 | - Improved h2py script (in Demo/scripts) follows #includes and |
| 13162 | supports macros with one argument |
| 13163 | |
| 13164 | - New module compileall generates .pyc files for all modules in a |
| 13165 | directory (tree) without also executing them |
| 13166 | |
| 13167 | - Threads should work on more platforms |
| 13168 | |
| 13169 | |
| 13170 | New built-in modules: |
| 13171 | |
| 13172 | - tkinter (support for Tcl's Tk widget set) is now part of the base |
| 13173 | distribution |
| 13174 | |
| 13175 | - signal allows catching or ignoring UNIX signals (unfortunately still |
| 13176 | undocumented -- any taker?) |
| 13177 | |
| 13178 | - termios provides portable access to POSIX tty settings |
| 13179 | |
| 13180 | - curses provides an interface to the System V curses library |
| 13181 | |
| 13182 | - syslog provides an interface to the (BSD?) syslog daemon |
| 13183 | |
| 13184 | - 'new' provides interfaces to create new built-in object types |
| 13185 | (e.g. modules and functions) |
| 13186 | |
| 13187 | - sybase provides an interface to SYBASE database |
| 13188 | |
| 13189 | |
| 13190 | New/obsolete built-in methods: |
| 13191 | |
| 13192 | - callable(x) tests whether x can be called |
| 13193 | |
| 13194 | - sockets now have a setblocking() method |
| 13195 | |
| 13196 | - sockets no longer have an allowbroadcast() method |
| 13197 | |
| 13198 | - socket methods send() and sendto() return byte count |
| 13199 | |
| 13200 | |
| 13201 | New standard library modules: |
| 13202 | |
| 13203 | - types.py defines standard names for built-in types, e.g. StringType |
| 13204 | |
| 13205 | - urlparse.py parses URLs according to the latest Internet draft |
| 13206 | |
| 13207 | - uu.py does uuencode/uudecode (not the fastest in the world, but |
| 13208 | quicker than installing uuencode on a non-UNIX machine :-) |
| 13209 | |
| 13210 | - New, faster and more powerful profile module.py |
| 13211 | |
| 13212 | - mhlib.py provides interface to MH folders and messages |
| 13213 | |
| 13214 | |
| 13215 | New facilities for extension writers (unfortunately still |
| 13216 | undocumented): |
| 13217 | |
| 13218 | - newgetargs() supports optional arguments and improved error messages |
| 13219 | |
| 13220 | - O!, O& O? formats for getargs allow more versatile type checking of |
| 13221 | non-standard types |
| 13222 | |
| 13223 | - can register pending asynchronous callback, to be called the next |
| 13224 | time the Python VM begins a new instruction (Py_AddPendingCall) |
| 13225 | |
| 13226 | - can register cleanup routines to be called when Python exits |
| 13227 | (Py_AtExit) |
| 13228 | |
| 13229 | - makesetup script understands C++ files in Setup file (use file.C |
| 13230 | or file.cc) |
| 13231 | |
| 13232 | - Make variable OPT is passed on to sub-Makefiles |
| 13233 | |
| 13234 | - An init<module>() routine may signal an error by not entering |
| 13235 | the module in the module table and raising an exception instead |
| 13236 | |
| 13237 | - For long module names, instead of foobarbletchmodule.c you can |
| 13238 | use foobarbletch.c |
| 13239 | |
| 13240 | - getintvalue() and getfloatvalue() try to convert any object |
| 13241 | instead of requiring an "intobject" or "floatobject" |
| 13242 | |
| 13243 | - All the [new]getargs() formats that retrieve an integer value |
| 13244 | will now also work if a float is passed |
| 13245 | |
| 13246 | - C function listtuple() converts list to tuple, fast |
| 13247 | |
| 13248 | - You should now call sigcheck() instead of intrcheck(); |
| 13249 | sigcheck() also sets an exception when it returns nonzero |
| 13250 | |
| 13251 | |
Guido van Rossum | aa25386 | 1994-10-06 17:18:57 +0000 | [diff] [blame] | 13252 | ==================================== |
| 13253 | ==> Release 1.0.3 (14 July 1994) <== |
| 13254 | ==================================== |
| 13255 | |
| 13256 | This release consists entirely of bug fixes to the C sources; see the |
| 13257 | head of ../ChangeLog for a complete list. Most important bugs fixed: |
| 13258 | |
| 13259 | - Sometimes the format operator (string%expr) would drop the last |
| 13260 | character of the format string |
| 13261 | |
| 13262 | - Tokenizer looped when last line did not end in \n |
| 13263 | |
| 13264 | - Bug when triple-quoted string ended in quote plus newline |
| 13265 | |
| 13266 | - Typo in socketmodule (listen) (== instead of =) |
| 13267 | |
| 13268 | - typing vars() at the >>> prompt would cause recursive output |
| 13269 | |
| 13270 | |
| 13271 | ================================== |
| 13272 | ==> Release 1.0.2 (4 May 1994) <== |
| 13273 | ================================== |
| 13274 | |
| 13275 | Overview of the most visible changes. Bug fixes are not listed. See |
| 13276 | also ChangeLog. |
| 13277 | |
| 13278 | Tokens |
| 13279 | ------ |
| 13280 | |
| 13281 | * String literals follow Standard C rules: they may be continued on |
| 13282 | the next line using a backslash; adjacent literals are concatenated |
| 13283 | at compile time. |
| 13284 | |
| 13285 | * A new kind of string literals, surrounded by triple quotes (""" or |
| 13286 | '''), can be continued on the next line without a backslash. |
| 13287 | |
| 13288 | Syntax |
| 13289 | ------ |
| 13290 | |
| 13291 | * Function arguments may have a default value, e.g. def f(a, b=1); |
| 13292 | defaults are evaluated at function definition time. This also applies |
| 13293 | to lambda. |
| 13294 | |
| 13295 | * The try-except statement has an optional else clause, which is |
| 13296 | executed when no exception occurs in the try clause. |
| 13297 | |
| 13298 | Interpreter |
| 13299 | ----------- |
| 13300 | |
| 13301 | * The result of a statement-level expression is no longer printed, |
| 13302 | except_ for expressions entered interactively. Consequently, the -k |
| 13303 | command line option is gone. |
| 13304 | |
| 13305 | * The result of the last printed interactive expression is assigned to |
| 13306 | the variable '_'. |
| 13307 | |
| 13308 | * Access to implicit global variables has been speeded up by removing |
| 13309 | an always-failing dictionary lookup in the dictionary of local |
| 13310 | variables (mod suggested by Steve Makewski and Tim Peters). |
| 13311 | |
| 13312 | * There is a new command line option, -u, to force stdout and stderr |
| 13313 | to be unbuffered. |
| 13314 | |
| 13315 | * Incorporated Steve Majewski's mods to import.c for dynamic loading |
| 13316 | under AIX. |
| 13317 | |
| 13318 | * Fewer chances of dumping core when trying to reload or re-import |
| 13319 | static built-in, dynamically loaded built-in, or frozen modules. |
| 13320 | |
| 13321 | * Loops over sequences now don't ask for the sequence's length when |
| 13322 | they start, but try to access items 0, 1, 2, and so on until they hit |
| 13323 | an IndexError. This makes it possible to create classes that generate |
| 13324 | infinite or indefinite sequences a la Steve Majewski. This affects |
| 13325 | for loops, the (not) in operator, and the built-in functions filter(), |
| 13326 | map(), max(), min(), reduce(). |
| 13327 | |
| 13328 | Changed Built-in operations |
| 13329 | --------------------------- |
| 13330 | |
| 13331 | * The '%' operator on strings (printf-style formatting) supports a new |
| 13332 | feature (adapted from a patch by Donald Beaudry) to allow |
| 13333 | '%(<key>)<format>' % {...} to take values from a dictionary by name |
| 13334 | instead of from a tuple by position (see also the new function |
| 13335 | vars()). |
| 13336 | |
| 13337 | * The '%s' formatting operator is changed to accept any type and |
| 13338 | convert it to a string using str(). |
| 13339 | |
| 13340 | * Dictionaries with more than 20,000 entries can now be created |
| 13341 | (thanks to Steve Kirsch). |
| 13342 | |
| 13343 | New Built-in Functions |
| 13344 | ---------------------- |
| 13345 | |
| 13346 | * vars() returns a dictionary containing the local variables; vars(m) |
| 13347 | returns a dictionary containing the variables of module m. Note: |
| 13348 | dir(x) is now equivalent to vars(x).keys(). |
| 13349 | |
| 13350 | Changed Built-in Functions |
| 13351 | -------------------------- |
| 13352 | |
| 13353 | * open() has an optional third argument to specify the buffer size: 0 |
| 13354 | for unbuffered, 1 for line buffered, >1 for explicit buffer size, <0 |
| 13355 | for default. |
| 13356 | |
| 13357 | * open()'s second argument is now optional; it defaults to "r". |
| 13358 | |
| 13359 | * apply() now checks that its second argument is indeed a tuple. |
| 13360 | |
| 13361 | New Built-in Modules |
| 13362 | -------------------- |
| 13363 | |
| 13364 | Changed Built-in Modules |
| 13365 | ------------------------ |
| 13366 | |
| 13367 | The thread module no longer supports exit_prog(). |
| 13368 | |
| 13369 | New Python Modules |
| 13370 | ------------------ |
| 13371 | |
| 13372 | * Module addpack contains a standard interface to modify sys.path to |
| 13373 | find optional packages (groups of related modules). |
| 13374 | |
| 13375 | * Module urllib contains a number of functions to access |
| 13376 | World-Wide-Web files specified by their URL. |
| 13377 | |
| 13378 | * Module httplib implements the client side of the HTTP protocol used |
| 13379 | by World-Wide-Web servers. |
| 13380 | |
| 13381 | * Module gopherlib implements the client side of the Gopher protocol. |
| 13382 | |
| 13383 | * Module mailbox (by Jack Jansen) contains a parser for UNIX and MMDF |
| 13384 | style mailbox files. |
| 13385 | |
| 13386 | * Module random contains various random distributions, e.g. gauss(). |
| 13387 | |
| 13388 | * Module lockfile locks and unlocks open files using fcntl (inspired |
| 13389 | by a similar module by Andy Bensky). |
| 13390 | |
| 13391 | * Module ntpath (by Jaap Vermeulen) implements path operations for |
| 13392 | Windows/NT. |
| 13393 | |
| 13394 | * Module test_thread (in Lib/test) contains a small test set for the |
| 13395 | thread module. |
| 13396 | |
| 13397 | Changed Python Modules |
| 13398 | ---------------------- |
| 13399 | |
| 13400 | * The string module's expandvars() function is now documented and is |
| 13401 | implemented in Python (using regular expressions) instead of forking |
| 13402 | off a shell process. |
| 13403 | |
| 13404 | * Module rfc822 now supports accessing the header fields using the |
| 13405 | mapping/dictionary interface, e.g. h['subject']. |
| 13406 | |
| 13407 | * Module pdb now makes it possible to set a break on a function |
| 13408 | (syntax: break <expression>, where <expression> yields a function |
| 13409 | object). |
| 13410 | |
| 13411 | Changed Demos |
| 13412 | ------------- |
| 13413 | |
| 13414 | * The Demo/scripts/freeze.py script is working again (thanks to Jaap |
| 13415 | Vermeulen). |
| 13416 | |
| 13417 | New Demos |
| 13418 | --------- |
| 13419 | |
| 13420 | * Demo/threads/Generator.py is a proposed interface for restartable |
| 13421 | functions a la Tim Peters. |
| 13422 | |
| 13423 | * Demo/scripts/newslist.py, by Quentin Stafford-Fraser, generates a |
| 13424 | directory full of HTML pages which between them contain links to all |
| 13425 | the newsgroups available on your server. |
| 13426 | |
| 13427 | * Demo/dns contains a DNS (Domain Name Server) client. |
| 13428 | |
| 13429 | * Demo/lutz contains miscellaneous demos by Mark Lutz (e.g. psh.py, a |
| 13430 | nice enhanced Python shell!!!). |
| 13431 | |
| 13432 | * Demo/turing contains a Turing machine by Amrit Prem. |
| 13433 | |
| 13434 | Documentation |
| 13435 | ------------- |
| 13436 | |
| 13437 | * Documented new language features mentioned above (but not all new |
| 13438 | modules). |
| 13439 | |
| 13440 | * Added a chapter to the Tutorial describing recent additions to |
| 13441 | Python. |
| 13442 | |
| 13443 | * Clarified some sentences in the reference manual, |
| 13444 | e.g. break/continue, local/global scope, slice assignment. |
| 13445 | |
| 13446 | Source Structure |
| 13447 | ---------------- |
| 13448 | |
| 13449 | * Moved Include/tokenizer.h to Parser/tokenizer.h. |
| 13450 | |
| 13451 | * Added Python/getopt.c for systems that don't have it. |
| 13452 | |
| 13453 | Emacs mode |
| 13454 | ---------- |
| 13455 | |
| 13456 | * Indentation of continuated lines is done more intelligently; |
| 13457 | consequently the variable py-continuation-offset is gone. |
| 13458 | |
Guido van Rossum | f2eac99 | 2000-09-04 17:24:24 +0000 | [diff] [blame] | 13459 | |
Guido van Rossum | aa25386 | 1994-10-06 17:18:57 +0000 | [diff] [blame] | 13460 | ======================================== |
| 13461 | ==> Release 1.0.1 (15 February 1994) <== |
| 13462 | ======================================== |
| 13463 | |
| 13464 | * Many portability fixes should make it painless to build Python on |
| 13465 | several new platforms, e.g. NeXT, SEQUENT, WATCOM, DOS, and Windows. |
| 13466 | |
| 13467 | * Fixed test for <stdarg.h> -- this broke on some platforms. |
| 13468 | |
| 13469 | * Fixed test for shared library dynalic loading -- this broke on SunOS |
| 13470 | 4.x using the GNU loader. |
| 13471 | |
| 13472 | * Changed order and number of SVR4 networking libraries (it is now |
| 13473 | -lsocket -linet -lnsl, if these libraries exist). |
| 13474 | |
| 13475 | * Installing the build intermediate stages with "make libainstall" now |
| 13476 | also installs config.c.in, Setup and makesetup, which are used by the |
| 13477 | new Extensions mechanism. |
| 13478 | |
| 13479 | * Improved README file contains more hints and new troubleshooting |
| 13480 | section. |
| 13481 | |
| 13482 | * The built-in module strop now defines fast versions of three more |
| 13483 | functions of the standard string module: atoi(), atol() and atof(). |
| 13484 | The strop versions of atoi() and atol() support an optional second |
| 13485 | argument to specify the base (default 10). NOTE: you don't have to |
| 13486 | explicitly import strop to use the faster versions -- the string |
| 13487 | module contains code to let versions from stop override the default |
| 13488 | versions. |
| 13489 | |
| 13490 | * There is now a working Lib/dospath.py for those who use Python under |
| 13491 | DOS (or Windows). Thanks, Jaap! |
| 13492 | |
| 13493 | * There is now a working Modules/dosmodule.c for DOS (or Windows) |
| 13494 | system calls. |
| 13495 | |
| 13496 | * Lib.os.py has been reorganized (making it ready for more operating |
| 13497 | systems). |
| 13498 | |
| 13499 | * Lib/ospath.py is now obsolete (use os.path instead). |
| 13500 | |
| 13501 | * Many fixes to the tutorial to make it match Python 1.0. Thanks, |
| 13502 | Tim! |
| 13503 | |
| 13504 | * Fixed Doc/Makefile, Doc/README and various scripts there. |
| 13505 | |
| 13506 | * Added missing description of fdopen to Doc/libposix.tex. |
| 13507 | |
| 13508 | * Made cleanup() global, for the benefit of embedded applications. |
| 13509 | |
| 13510 | * Added parsing of addresses and dates to Lib/rfc822.py. |
| 13511 | |
| 13512 | * Small fixes to Lib/aifc.py, Lib/sunau.py, Lib/tzparse.py to make |
| 13513 | them usable at all. |
| 13514 | |
| 13515 | * New module Lib/wave.py reads RIFF (*.wav) audio files. |
| 13516 | |
| 13517 | * Module Lib/filewin.py moved to Lib/stdwin/filewin.py where it |
| 13518 | belongs. |
| 13519 | |
| 13520 | * New options and comments for Modules/makesetup (used by new |
| 13521 | Extension mechanism). |
| 13522 | |
| 13523 | * Misc/HYPE contains text of announcement of 1.0.0 in comp.lang.misc |
| 13524 | and elsewhere. |
| 13525 | |
| 13526 | * Fixed coredump in filter(None, 'abcdefg'). |
| 13527 | |
| 13528 | |
| 13529 | ======================================= |
| 13530 | ==> Release 1.0.0 (26 January 1994) <== |
| 13531 | ======================================= |
| 13532 | |
| 13533 | As is traditional, so many things have changed that I can't pretend to |
| 13534 | be complete in these release notes, but I'll try anyway :-) |
| 13535 | |
| 13536 | Note that the very last section is labeled "remaining bugs". |
| 13537 | |
| 13538 | |
| 13539 | Source organization and build process |
| 13540 | ------------------------------------- |
| 13541 | |
| 13542 | * The sources have finally been split: instead of a single src |
| 13543 | subdirectory there are now separate directories Include, Parser, |
| 13544 | Grammar, Objects, Python and Modules. Other directories also start |
| 13545 | with a capital letter: Misc, Doc, Lib, Demo. |
| 13546 | |
| 13547 | * A few extensions (notably Amoeba and X support) have been moved to a |
| 13548 | separate subtree Extensions, which is no longer in the core |
| 13549 | distribution, but separately ftp'able as extensions.tar.Z. (The |
| 13550 | distribution contains a placeholder Ext-dummy with a description of |
| 13551 | the Extensions subtree as well as the most recent versions of the |
| 13552 | scripts used there.) |
| 13553 | |
| 13554 | * A few large specialized demos (SGI video and www) have been |
| 13555 | moved to a separate subdirectory Demo2, which is no longer in the core |
| 13556 | distribution, but separately ftp'able as demo2.tar.Z. |
| 13557 | |
| 13558 | * Parts of the standard library have been moved to subdirectories: |
| 13559 | there are now standard subdirectories stdwin, test, sgi and sun4. |
| 13560 | |
| 13561 | * The configuration process has radically changed: I now use GNU |
| 13562 | autoconf. This makes it much easier to build on new Unix flavors, as |
| 13563 | well as fully supporting VPATH (if your Make has it). The scripts |
| 13564 | Configure.py and Addmodule.sh are no longer needed. Many source files |
| 13565 | have been adapted in order to work with the symbols that the configure |
| 13566 | script generated by autoconf defines (or not); the resulting source is |
| 13567 | much more portable to different C compilers and operating systems, |
| 13568 | even non Unix systems (a Mac port was done in an afternoon). See the |
| 13569 | toplevel README file for a description of the new build process. |
| 13570 | |
| 13571 | * GNU readline (a slightly newer version) is now a subdirectory of the |
| 13572 | Python toplevel. It is still not automatically configured (being |
| 13573 | totally autoconf-unaware :-). One problem has been solved: typing |
| 13574 | Control-C to a readline prompt will now work. The distribution no |
| 13575 | longer contains a "super-level" directory (above the python toplevel |
| 13576 | directory), and dl, dl-dld and GNU dld are no longer part of the |
| 13577 | Python distribution (you can still ftp them from |
| 13578 | ftp.cwi.nl:/pub/dynload). |
| 13579 | |
| 13580 | * The DOS functions have been taken out of posixmodule.c and moved |
| 13581 | into a separate file dosmodule.c. |
| 13582 | |
| 13583 | * There's now a separate file version.c which contains nothing but |
| 13584 | the version number. |
| 13585 | |
| 13586 | * The actual main program is now contained in config.c (unless NO_MAIN |
| 13587 | is defined); pythonmain.c now contains a function realmain() which is |
| 13588 | called from config.c's main(). |
| 13589 | |
| 13590 | * All files needed to use the built-in module md5 are now contained in |
| 13591 | the distribution. The module has been cleaned up considerably. |
| 13592 | |
| 13593 | |
| 13594 | Documentation |
| 13595 | ------------- |
| 13596 | |
| 13597 | * The library manual has been split into many more small latex files, |
| 13598 | so it is easier to edit Doc/lib.tex file to create a custom library |
| 13599 | manual, describing only those modules supported on your system. (This |
| 13600 | is not automated though.) |
| 13601 | |
| 13602 | * A fourth manual has been added, titled "Extending and Embedding the |
| 13603 | Python Interpreter" (Doc/ext.tex), which collects information about |
| 13604 | the interpreter which was previously spread over several files in the |
| 13605 | misc subdirectory. |
| 13606 | |
| 13607 | * The entire documentation is now also available on-line for those who |
| 13608 | have a WWW browser (e.g. NCSA Mosaic). Point your browser to the URL |
| 13609 | "http://www.cwi.nl/~guido/Python.html". |
| 13610 | |
| 13611 | |
| 13612 | Syntax |
| 13613 | ------ |
| 13614 | |
| 13615 | * Strings may now be enclosed in double quotes as well as in single |
| 13616 | quotes. There is no difference in interpretation. The repr() of |
| 13617 | string objects will use double quotes if the string contains a single |
| 13618 | quote and no double quotes. Thanks to Amrit Prem for these changes! |
| 13619 | |
| 13620 | * There is a new keyword 'exec'. This replaces the exec() built-in |
| 13621 | function. If a function contains an exec statement, local variable |
| 13622 | optimization is not performed for that particular function, thus |
| 13623 | making assignment to local variables in exec statements less |
| 13624 | confusing. (As a consequence, os.exec and python.exec have been |
| 13625 | renamed to execv.) |
| 13626 | |
| 13627 | * There is a new keyword 'lambda'. An expression of the form |
| 13628 | |
| 13629 | lambda <parameters> : <expression> |
| 13630 | |
| 13631 | yields an anonymous function. This is really only syntactic sugar; |
| 13632 | you can just as well define a local function using |
| 13633 | |
| 13634 | def some_temporary_name(<parameters>): return <expression> |
| 13635 | |
| 13636 | Lambda expressions are particularly useful in combination with map(), |
| 13637 | filter() and reduce(), described below. Thanks to Amrit Prem for |
| 13638 | submitting this code (as well as map(), filter(), reduce() and |
| 13639 | xrange())! |
| 13640 | |
| 13641 | |
| 13642 | Built-in functions |
| 13643 | ------------------ |
| 13644 | |
| 13645 | * The built-in module containing the built-in functions is called |
| 13646 | __builtin__ instead of builtin. |
| 13647 | |
| 13648 | * New built-in functions map(), filter() and reduce() perform standard |
| 13649 | functional programming operations (though not lazily): |
| 13650 | |
| 13651 | - map(f, seq) returns a new sequence whose items are the items from |
| 13652 | seq with f() applied to them. |
| 13653 | |
| 13654 | - filter(f, seq) returns a subsequence of seq consisting of those |
| 13655 | items for which f() is true. |
| 13656 | |
| 13657 | - reduce(f, seq, initial) returns a value computed as follows: |
| 13658 | acc = initial |
| 13659 | for item in seq: acc = f(acc, item) |
| 13660 | return acc |
| 13661 | |
| 13662 | * New function xrange() creates a "range object". Its arguments are |
| 13663 | the same as those of range(), and when used in a for loop a range |
| 13664 | objects also behaves identical. The advantage of xrange() over |
| 13665 | range() is that its representation (if the range contains many |
| 13666 | elements) is much more compact than that of range(). The disadvantage |
| 13667 | is that the result cannot be used to initialize a list object or for |
| 13668 | the "Python idiom" [RED, GREEN, BLUE] = range(3). On some modern |
| 13669 | architectures, benchmarks have shown that "for i in range(...): ..." |
| 13670 | actually executes *faster* than "for i in xrange(...): ...", but on |
| 13671 | memory starved machines like PCs running DOS range(100000) may be just |
| 13672 | too big to be represented at all... |
| 13673 | |
| 13674 | * Built-in function exec() has been replaced by the exec statement -- |
| 13675 | see above. |
| 13676 | |
| 13677 | |
| 13678 | The interpreter |
| 13679 | --------------- |
| 13680 | |
| 13681 | * Syntax errors are now not printed to stderr by the parser, but |
| 13682 | rather the offending line and other relevant information are packed up |
| 13683 | in the SyntaxError exception argument. When the main loop catches a |
| 13684 | SyntaxError exception it will print the error in the same format as |
| 13685 | previously, but at the proper position in the stack traceback. |
| 13686 | |
| 13687 | * You can now set a maximum to the number of traceback entries |
| 13688 | printed by assigning to sys.tracebacklimit. The default is 1000. |
| 13689 | |
| 13690 | * The version number in .pyc files has changed yet again. |
| 13691 | |
| 13692 | * It is now possible to have a .pyc file without a corresponding .py |
| 13693 | file. (Warning: this may break existing installations if you have an |
| 13694 | old .pyc file lingering around somewhere on your module search path |
| 13695 | without a corresponding .py file, when there is a .py file for a |
| 13696 | module of the same name further down the path -- the new interpreter |
| 13697 | will find the first .pyc file and complain about it, while the old |
| 13698 | interpreter would ignore it and use the .py file further down.) |
| 13699 | |
| 13700 | * The list sys.builtin_module_names is now sorted and also contains |
| 13701 | the names of a few hardwired built-in modules (sys, __main__ and |
| 13702 | __builtin__). |
| 13703 | |
| 13704 | * A module can now find its own name by accessing the global variable |
| 13705 | __name__. Assigning to this variable essentially renames the module |
| 13706 | (it should also be stored under a different key in sys.modules). |
| 13707 | A neat hack follows from this: a module that wants to execute a main |
| 13708 | program when called as a script no longer needs to compare |
| 13709 | sys.argv[0]; it can simply do "if __name__ == '__main__': main()". |
| 13710 | |
| 13711 | * When an object is printed by the print statement, its implementation |
| 13712 | of str() is used. This means that classes can define __str__(self) to |
| 13713 | direct how their instances are printed. This is different from |
| 13714 | __repr__(self), which should define an unambigous string |
| 13715 | representation of the instance. (If __str__() is not defined, it |
| 13716 | defaults to __repr__().) |
| 13717 | |
| 13718 | * Functions and code objects can now be compared meaningfully. |
| 13719 | |
| 13720 | * On systems supporting SunOS or SVR4 style shared libraries, dynamic |
| 13721 | loading of modules using shared libraries is automatically configured. |
| 13722 | Thanks to Bill Jansen and Denis Severson for contributing this change! |
| 13723 | |
| 13724 | |
| 13725 | Built-in objects |
| 13726 | ---------------- |
| 13727 | |
| 13728 | * File objects have acquired a new method writelines() which is the |
| 13729 | reverse of readlines(). (It does not actually write lines, just a |
| 13730 | list of strings, but the symmetry makes the choice of name OK.) |
| 13731 | |
| 13732 | |
| 13733 | Built-in modules |
| 13734 | ---------------- |
| 13735 | |
| 13736 | * Socket objects no longer support the avail() method. Use the select |
| 13737 | module instead, or use this function to replace it: |
| 13738 | |
| 13739 | def avail(f): |
| 13740 | import select |
| 13741 | return f in select.select([f], [], [], 0)[0] |
| 13742 | |
| 13743 | * Initialization of stdwin is done differently. It actually modifies |
| 13744 | sys.argv (taking out the options the X version of stdwin recognizes) |
| 13745 | the first time it is imported. |
| 13746 | |
| 13747 | * A new built-in module parser provides a rudimentary interface to the |
| 13748 | python parser. Corresponding standard library modules token and symbol |
| 13749 | defines the numeric values of tokens and non-terminal symbols. |
| 13750 | |
| 13751 | * The posix module has aquired new functions setuid(), setgid(), |
| 13752 | execve(), and exec() has been renamed to execv(). |
| 13753 | |
| 13754 | * The array module is extended with 8-byte object swaps, the 'i' |
| 13755 | format character, and a reverse() method. The read() and write() |
| 13756 | methods are renamed to fromfile() and tofile(). |
| 13757 | |
| 13758 | * The rotor module has freed of portability bugs. This introduces a |
| 13759 | backward compatibility problem: strings encoded with the old rotor |
| 13760 | module can't be decoded by the new version. |
| 13761 | |
| 13762 | * For select.select(), a timeout (4th) argument of None means the same |
| 13763 | as leaving the timeout argument out. |
| 13764 | |
| 13765 | * Module strop (and hence standard library module string) has aquired |
| 13766 | a new function: rindex(). Thanks to Amrit Prem! |
| 13767 | |
| 13768 | * Module regex defines a new function symcomp() which uses an extended |
| 13769 | regular expression syntax: parenthesized subexpressions may be labeled |
| 13770 | using the form "\(<labelname>...\)", and the group() method can return |
| 13771 | sub-expressions by name. Thanks to Tracy Tims for these changes! |
| 13772 | |
| 13773 | * Multiple threads are now supported on Solaris 2. Thanks to Sjoerd |
| 13774 | Mullender! |
| 13775 | |
| 13776 | |
| 13777 | Standard library modules |
| 13778 | ------------------------ |
| 13779 | |
| 13780 | * The library is now split in several subdirectories: all stuff using |
| 13781 | stdwin is in Lib/stdwin, all SGI specific (or SGI Indigo or GL) stuff |
| 13782 | is in Lib/sgi, all Sun Sparc specific stuff is in Lib/sun4, and all |
| 13783 | test modules are in Lib/test. The default module search path will |
| 13784 | include all relevant subdirectories by default. |
| 13785 | |
| 13786 | * Module os now knows about trying to import dos. It defines |
| 13787 | functions execl(), execle(), execlp() and execvp(). |
| 13788 | |
| 13789 | * New module dospath (should be attacked by a DOS hacker though). |
| 13790 | |
| 13791 | * All modules defining classes now define __init__() constructors |
| 13792 | instead of init() methods. THIS IS AN INCOMPATIBLE CHANGE! |
| 13793 | |
| 13794 | * Some minor changes and bugfixes module ftplib (mostly Steve |
| 13795 | Majewski's suggestions); the debug() method is renamed to |
| 13796 | set_debuglevel(). |
| 13797 | |
| 13798 | * Some new test modules (not run automatically by testall though): |
| 13799 | test_audioop, test_md5, test_rgbimg, test_select. |
| 13800 | |
| 13801 | * Module string now defines rindex() and rfind() in analogy of index() |
| 13802 | and find(). It also defines atof() and atol() (and corresponding |
| 13803 | exceptions) in analogy to atoi(). |
| 13804 | |
| 13805 | * Added help() functions to modules profile and pdb. |
| 13806 | |
| 13807 | * The wdb debugger (now in Lib/stdwin) now shows class or instance |
| 13808 | variables on a double click. Thanks to Sjoerd Mullender! |
| 13809 | |
| 13810 | * The (undocumented) module lambda has gone -- you couldn't import it |
| 13811 | any more, and it was basically more a demo than a library module... |
| 13812 | |
| 13813 | |
| 13814 | Multimedia extensions |
| 13815 | --------------------- |
| 13816 | |
| 13817 | * The optional built-in modules audioop and imageop are now standard |
| 13818 | parts of the interpreter. Thanks to Sjoerd Mullender and Jack Jansen |
| 13819 | for contributing this code! |
| 13820 | |
| 13821 | * There's a new operation in audioop: minmax(). |
| 13822 | |
| 13823 | * There's a new built-in module called rgbimg which supports portable |
| 13824 | efficient reading of SGI RCG image files. Thanks also to Paul |
| 13825 | Haeberli for the original code! (Who will contribute a GIF reader?) |
| 13826 | |
| 13827 | * The module aifc is gone -- you should now always use aifc, which has |
| 13828 | received a facelift. |
| 13829 | |
| 13830 | * There's a new module sunau., for reading Sun (and NeXT) audio files. |
| 13831 | |
| 13832 | * There's a new module audiodev which provides a uniform interface to |
| 13833 | (SGI Indigo and Sun Sparc) audio hardware. |
| 13834 | |
| 13835 | * There's a new module sndhdr which recognizes various sound files by |
| 13836 | looking in their header and checking for various magic words. |
| 13837 | |
| 13838 | |
| 13839 | Optimizations |
| 13840 | ------------- |
| 13841 | |
| 13842 | * Most optimizations below can be configured by compile-time flags. |
| 13843 | Thanks to Sjoerd Mullender for submitting these optimizations! |
| 13844 | |
| 13845 | * Small integers (default -1..99) are shared -- i.e. if two different |
| 13846 | functions compute the same value it is possible (but not |
| 13847 | guaranteed!!!) that they return the same *object*. Python programs |
| 13848 | can detect this but should *never* rely on it. |
| 13849 | |
| 13850 | * Empty tuples (which all compare equal) are shared in the same |
| 13851 | manner. |
| 13852 | |
| 13853 | * Tuples of size up to 20 (default) are put in separate free lists |
| 13854 | when deallocated. |
| 13855 | |
| 13856 | * There is a compile-time option to cache a string's hash function, |
| 13857 | but this appeared to have a negligeable effect, and as it costs 4 |
| 13858 | bytes per string it is disabled by default. |
| 13859 | |
| 13860 | |
| 13861 | Embedding Python |
| 13862 | ---------------- |
| 13863 | |
| 13864 | * The initialization interface has been simplified somewhat. You now |
| 13865 | only call "initall()" to initialize the interpreter. |
| 13866 | |
| 13867 | * The previously announced renaming of externally visible identifiers |
| 13868 | has not been carried out. It will happen in a later release. Sorry. |
| 13869 | |
| 13870 | |
| 13871 | Miscellaneous bugs that have been fixed |
| 13872 | --------------------------------------- |
| 13873 | |
| 13874 | * All known portability bugs. |
| 13875 | |
| 13876 | * Version 0.9.9 dumped core in <listobject>.sort() which has been |
| 13877 | fixed. Thanks to Jaap Vermeulen for fixing this and posting the fix |
| 13878 | on the mailing list while I was away! |
| 13879 | |
| 13880 | * Core dump on a format string ending in '%', e.g. in the expression |
| 13881 | '%' % None. |
| 13882 | |
| 13883 | * The array module yielded a bogus result for concatenation (a+b would |
| 13884 | yield a+a). |
| 13885 | |
| 13886 | * Some serious memory leaks in strop.split() and strop.splitfields(). |
| 13887 | |
| 13888 | * Several problems with the nis module. |
| 13889 | |
| 13890 | * Subtle problem when copying a class method from another class |
| 13891 | through assignment (the method could not be called). |
| 13892 | |
| 13893 | |
| 13894 | Remaining bugs |
| 13895 | -------------- |
| 13896 | |
| 13897 | * One problem with 64-bit machines remains -- since .pyc files are |
| 13898 | portable and use only 4 bytes to represent an integer object, 64-bit |
| 13899 | integer literals are silently truncated when written into a .pyc file. |
| 13900 | Work-around: use eval('123456789101112'). |
| 13901 | |
| 13902 | * The freeze script doesn't work any more. A new and more portable |
| 13903 | one can probably be cooked up using tricks from Extensions/mkext.py. |
| 13904 | |
| 13905 | * The dos support hasn't been tested yet. (Really Soon Now we should |
| 13906 | have a PC with a working C compiler!) |
| 13907 | |
| 13908 | |
Guido van Rossum | a7925f1 | 1994-01-26 10:20:16 +0000 | [diff] [blame] | 13909 | =================================== |
| 13910 | ==> Release 0.9.9 (29 Jul 1993) <== |
| 13911 | =================================== |
| 13912 | |
| 13913 | I *believe* these are the main user-visible changes in this release, |
| 13914 | but there may be others. SGI users may scan the {src,lib}/ChangeLog |
| 13915 | files for improvements of some SGI specific modules, e.g. aifc and |
| 13916 | cl. Developers of extension modules should also read src/ChangeLog. |
| 13917 | |
| 13918 | |
| 13919 | Naming of C symbols used by the Python interpreter |
| 13920 | -------------------------------------------------- |
| 13921 | |
| 13922 | * This is the last release using the current naming conventions. New |
| 13923 | naming conventions are explained in the file misc/NAMING. |
| 13924 | Summarizing, all externally visible symbols get (at least) a "Py" |
| 13925 | prefix, and most functions are renamed to the standard form |
| 13926 | PyModule_FunctionName. |
| 13927 | |
| 13928 | * Writers of extensions are urged to start using the new naming |
| 13929 | conventions. The next release will use the new naming conventions |
| 13930 | throughout (it will also have a different source directory |
| 13931 | structure). |
| 13932 | |
| 13933 | * As a result of the preliminary work for the great renaming, many |
| 13934 | functions that were accidentally global have been made static. |
| 13935 | |
| 13936 | |
| 13937 | BETA X11 support |
| 13938 | ---------------- |
| 13939 | |
| 13940 | * There are now modules interfacing to the X11 Toolkit Intrinsics, the |
| 13941 | Athena widgets, and the Motif 1.1 widget set. These are not yet |
| 13942 | documented except through the examples and README file in the demo/x11 |
| 13943 | directory. It is expected that this interface will be replaced by a |
| 13944 | more powerful and correct one in the future, which may or may not be |
| 13945 | backward compatible. In other words, this part of the code is at most |
| 13946 | BETA level software! (Note: the rest of Python is rock solid as ever!) |
| 13947 | |
| 13948 | * I understand that the above may be a bit of a disappointment, |
| 13949 | however my current schedule does not allow me to change this situation |
| 13950 | before putting the release out of the door. By releasing it |
| 13951 | undocumented and buggy, at least some of the (working!) demo programs, |
| 13952 | like itr (my Internet Talk Radio browser) become available to a larger |
| 13953 | audience. |
| 13954 | |
| 13955 | * There are also modules interfacing to SGI's "Glx" widget (a GL |
| 13956 | window wrapped in a widget) and to NCSA's "HTML" widget (which can |
| 13957 | format HyperText Markup Language, the document format used by the |
| 13958 | World Wide Web). |
| 13959 | |
| 13960 | * I've experienced some problems when building the X11 support. In |
| 13961 | particular, the Xm and Xaw widget sets don't go together, and it |
| 13962 | appears that using X11R5 is better than using X11R4. Also the threads |
| 13963 | module and its link time options may spoil things. My own strategy is |
| 13964 | to build two Python binaries: one for use with X11 and one without |
| 13965 | it, which can contain a richer set of built-in modules. Don't even |
| 13966 | *think* of loading the X11 modules dynamically... |
| 13967 | |
| 13968 | |
| 13969 | Environmental changes |
| 13970 | --------------------- |
| 13971 | |
| 13972 | * Compiled files (*.pyc files) created by this Python version are |
| 13973 | incompatible with those created by the previous version. Both |
| 13974 | versions detect this and silently create a correct version, but it |
| 13975 | means that it is not a good idea to use the same library directory for |
| 13976 | an old and a new interpreter, since they will start to "fight" over |
| 13977 | the *.pyc files... |
| 13978 | |
| 13979 | * When a stack trace is printed, the exception is printed last instead |
| 13980 | of first. This means that if the beginning of the stack trace |
| 13981 | scrolled out of your window you can still see what exception caused |
| 13982 | it. |
| 13983 | |
| 13984 | * Sometimes interrupting a Python operation does not work because it |
| 13985 | hangs in a blocking system call. You can now kill the interpreter by |
| 13986 | interrupting it three times. The second time you interrupt it, a |
| 13987 | message will be printed telling you that the third interrupt will kill |
| 13988 | the interpreter. The "sys.exitfunc" feature still makes limited |
| 13989 | clean-up possible in this case. |
| 13990 | |
| 13991 | |
| 13992 | Changes to the command line interface |
| 13993 | ------------------------------------- |
| 13994 | |
| 13995 | * The python usage message is now much more informative. |
| 13996 | |
| 13997 | * New option -i enters interactive mode after executing a script -- |
| 13998 | useful for debugging. |
| 13999 | |
| 14000 | * New option -k raises an exception when an expression statement |
| 14001 | yields a value other than None. |
| 14002 | |
| 14003 | * For each option there is now also a corresponding environment |
| 14004 | variable. |
| 14005 | |
| 14006 | |
| 14007 | Using Python as an embedded language |
| 14008 | ------------------------------------ |
| 14009 | |
| 14010 | * The distribution now contains (some) documentation on the use of |
| 14011 | Python as an "embedded language" in other applications, as well as a |
| 14012 | simple example. See the file misc/EMBEDDING and the directory embed/. |
| 14013 | |
| 14014 | |
| 14015 | Speed improvements |
| 14016 | ------------------ |
| 14017 | |
| 14018 | * Function local variables are now generally stored in an array and |
| 14019 | accessed using an integer indexing operation, instead of through a |
| 14020 | dictionary lookup. (This compensates the somewhat slower dictionary |
| 14021 | lookup caused by the generalization of the dictionary module.) |
| 14022 | |
| 14023 | |
| 14024 | Changes to the syntax |
| 14025 | --------------------- |
| 14026 | |
| 14027 | * Continuation lines can now *sometimes* be written without a |
| 14028 | backslash: if the continuation is contained within nesting (), [] or |
| 14029 | {} brackets the \ may be omitted. There's a much improved |
| 14030 | python-mode.el in the misc directory which knows about this as well. |
| 14031 | |
| 14032 | * You can no longer use an empty set of parentheses to define a class |
| 14033 | without base classes. That is, you no longer write this: |
| 14034 | |
| 14035 | class Foo(): # syntax error |
| 14036 | ... |
| 14037 | |
| 14038 | You must write this instead: |
| 14039 | |
| 14040 | class Foo: |
| 14041 | ... |
| 14042 | |
| 14043 | This was already the preferred syntax in release 0.9.8 but many |
| 14044 | people seemed not to have picked it up. There's a Python script that |
| 14045 | fixes old code: demo/scripts/classfix.py. |
| 14046 | |
| 14047 | * There's a new reserved word: "access". The syntax and semantics are |
| 14048 | still subject of of research and debate (as well as undocumented), but |
| 14049 | the parser knows about the keyword so you must not use it as a |
| 14050 | variable, function, or attribute name. |
| 14051 | |
| 14052 | |
| 14053 | Changes to the semantics of the language proper |
| 14054 | ----------------------------------------------- |
| 14055 | |
| 14056 | * The following compatibility hack is removed: if a function was |
| 14057 | defined with two or more arguments, and called with a single argument |
| 14058 | that was a tuple with just as many arguments, the items of this tuple |
| 14059 | would be used as the arguments. This is no longer supported. |
| 14060 | |
| 14061 | |
| 14062 | Changes to the semantics of classes and instances |
| 14063 | ------------------------------------------------- |
| 14064 | |
| 14065 | * Class variables are now also accessible as instance variables for |
| 14066 | reading (assignment creates an instance variable which overrides the |
| 14067 | class variable of the same name though). |
| 14068 | |
| 14069 | * If a class attribute is a user-defined function, a new kind of |
| 14070 | object is returned: an "unbound method". This contains a pointer to |
| 14071 | the class and can only be called with a first argument which is a |
| 14072 | member of that class (or a derived class). |
| 14073 | |
| 14074 | * If a class defines a method __init__(self, arg1, ...) then this |
| 14075 | method is called when a class instance is created by the classname() |
| 14076 | construct. Arguments passed to classname() are passed to the |
| 14077 | __init__() method. The __init__() methods of base classes are not |
| 14078 | automatically called; the derived __init__() method must call these if |
| 14079 | necessary (this was done so the derived __init__() method can choose |
| 14080 | the call order and arguments for the base __init__() methods). |
| 14081 | |
| 14082 | * If a class defines a method __del__(self) then this method is called |
| 14083 | when an instance of the class is about to be destroyed. This makes it |
| 14084 | possible to implement clean-up of external resources attached to the |
| 14085 | instance. As with __init__(), the __del__() methods of base classes |
| 14086 | are not automatically called. If __del__ manages to store a reference |
| 14087 | to the object somewhere, its destruction is postponed; when the object |
| 14088 | is again about to be destroyed its __del__() method will be called |
| 14089 | again. |
| 14090 | |
| 14091 | * Classes may define a method __hash__(self) to allow their instances |
| 14092 | to be used as dictionary keys. This must return a 32-bit integer. |
| 14093 | |
| 14094 | |
| 14095 | Minor improvements |
| 14096 | ------------------ |
| 14097 | |
| 14098 | * Function and class objects now know their name (the name given in |
| 14099 | the 'def' or 'class' statement that created them). |
| 14100 | |
| 14101 | * Class instances now know their class name. |
| 14102 | |
| 14103 | |
| 14104 | Additions to built-in operations |
| 14105 | -------------------------------- |
| 14106 | |
| 14107 | * The % operator with a string left argument implements formatting |
| 14108 | similar to sprintf() in C. The right argument is either a single |
| 14109 | value or a tuple of values. All features of Standard C sprintf() are |
| 14110 | supported except %p. |
| 14111 | |
| 14112 | * Dictionaries now support almost any key type, instead of just |
| 14113 | strings. (The key type must be an immutable type or must be a class |
| 14114 | instance where the class defines a method __hash__(), in order to |
| 14115 | avoid losing track of keys whose value may change.) |
| 14116 | |
| 14117 | * Built-in methods are now compared properly: when comparing x.meth1 |
| 14118 | and y.meth2, if x is equal to y and the methods are defined by the |
| 14119 | same function, x.meth1 compares equal to y.meth2. |
| 14120 | |
| 14121 | |
| 14122 | Additions to built-in functions |
| 14123 | ------------------------------- |
| 14124 | |
| 14125 | * str(x) returns a string version of its argument. If the argument is |
| 14126 | a string it is returned unchanged, otherwise it returns `x`. |
| 14127 | |
| 14128 | * repr(x) returns the same as `x`. (Some users found it easier to |
| 14129 | have this as a function.) |
| 14130 | |
| 14131 | * round(x) returns the floating point number x rounded to an whole |
| 14132 | number, represented as a floating point number. round(x, n) returns x |
| 14133 | rounded to n digits. |
| 14134 | |
| 14135 | * hasattr(x, name) returns true when x has an attribute with the given |
| 14136 | name. |
| 14137 | |
| 14138 | * hash(x) returns a hash code (32-bit integer) of an arbitrary |
| 14139 | immutable object's value. |
| 14140 | |
| 14141 | * id(x) returns a unique identifier (32-bit integer) of an arbitrary |
| 14142 | object. |
| 14143 | |
| 14144 | * compile() compiles a string to a Python code object. |
| 14145 | |
| 14146 | * exec() and eval() now support execution of code objects. |
| 14147 | |
| 14148 | |
| 14149 | Changes to the documented part of the library (standard modules) |
| 14150 | ---------------------------------------------------------------- |
| 14151 | |
| 14152 | * os.path.normpath() (a.k.a. posixpath.normpath()) has been fixed so |
| 14153 | the border case '/foo/..' returns '/' instead of ''. |
| 14154 | |
| 14155 | * A new function string.find() is added with similar semantics to |
| 14156 | string.index(); however when it does not find the given substring it |
| 14157 | returns -1 instead of raising string.index_error. |
| 14158 | |
| 14159 | |
| 14160 | Changes to built-in modules |
| 14161 | --------------------------- |
| 14162 | |
| 14163 | * New optional module 'array' implements operations on sequences of |
| 14164 | integers or floating point numbers of a particular size. This is |
| 14165 | useful to manipulate large numerical arrays or to read and write |
| 14166 | binary files consisting of numerical data. |
| 14167 | |
| 14168 | * Regular expression objects created by module regex now support a new |
| 14169 | method named group(), which returns one or more \(...\) groups by number. |
| 14170 | The number of groups is increased from 10 to 100. |
| 14171 | |
| 14172 | * Function compile() in module regex now supports an optional mapping |
| 14173 | argument; a variable casefold is added to the module which can be used |
| 14174 | as a standard uppercase to lowercase mapping. |
| 14175 | |
| 14176 | * Module time now supports many routines that are defined in the |
| 14177 | Standard C time interface (<time.h>): gmtime(), localtime(), |
| 14178 | asctime(), ctime(), mktime(), as well as these variables (taken from |
| 14179 | System V): timezone, altzone, daylight and tzname. (The corresponding |
| 14180 | functions in the undocumented module calendar have been removed; the |
| 14181 | undocumented and unfinished module tzparse is now obsolete and will |
| 14182 | disappear in a future release.) |
| 14183 | |
| 14184 | * Module strop (the fast built-in version of standard module string) |
| 14185 | now uses C's definition of whitespace instead of fixing it to space, |
| 14186 | tab and newline; in practice this usually means that vertical tab, |
| 14187 | form feed and return are now also considered whitespace. It exports |
| 14188 | the string of characters that are considered whitespace as well as the |
| 14189 | characters that are considered lowercase or uppercase. |
| 14190 | |
| 14191 | * Module sys now defines the variable builtin_module_names, a list of |
| 14192 | names of modules built into the current interpreter (including not |
| 14193 | yet imported, but excluding two special modules that always have to be |
| 14194 | defined -- sys and builtin). |
| 14195 | |
| 14196 | * Objects created by module sunaudiodev now also support flush() and |
| 14197 | close() methods. |
| 14198 | |
| 14199 | * Socket objects created by module socket now support an optional |
| 14200 | flags argument for their methods sendto() and recvfrom(). |
| 14201 | |
| 14202 | * Module marshal now supports dumping to and loading from strings, |
| 14203 | through the functions dumps() and loads(). |
| 14204 | |
| 14205 | * Module stdwin now supports some new functionality. You may have to |
| 14206 | ftp the latest version: ftp.cwi.nl:/pub/stdwin/stdwinforviews.tar.Z.) |
| 14207 | |
| 14208 | |
| 14209 | Bugs fixed |
| 14210 | ---------- |
| 14211 | |
| 14212 | * Fixed comparison of negative long integers. |
| 14213 | |
| 14214 | * The tokenizer no longer botches input lines longer than BUFSIZ. |
| 14215 | |
| 14216 | * Fixed several severe memory leaks in module select. |
| 14217 | |
| 14218 | * Fixed memory leaks in modules socket and sv. |
| 14219 | |
| 14220 | * Fixed memory leak in divmod() for long integers. |
| 14221 | |
| 14222 | * Problems with definition of floatsleep() on Suns fixed. |
| 14223 | |
| 14224 | * Many portability bugs fixed (and undoubtedly new ones added :-). |
| 14225 | |
| 14226 | |
| 14227 | Changes to the build procedure |
| 14228 | ------------------------------ |
| 14229 | |
| 14230 | * The Makefile supports some new targets: "make default" and "make |
| 14231 | all". Both are by normally equivalent to "make python". |
| 14232 | |
| 14233 | * The Makefile no longer uses $> since it's not supported by all |
| 14234 | versions of Make. |
| 14235 | |
| 14236 | * The header files now all contain #ifdef constructs designed to make |
| 14237 | it safe to include the same header file twice, as well as support for |
| 14238 | inclusion from C++ programs (automatic extern "C" { ... } added). |
| 14239 | |
| 14240 | |
| 14241 | Freezing Python scripts |
| 14242 | ----------------------- |
| 14243 | |
| 14244 | * There is now some support for "freezing" a Python script as a |
| 14245 | stand-alone executable binary file. See the script |
| 14246 | demo/scripts/freeze.py. It will require some site-specific tailoring |
| 14247 | of the script to get this working, but is quite worthwhile if you write |
| 14248 | Python code for other who may not have built and installed Python. |
| 14249 | |
| 14250 | |
| 14251 | MS-DOS |
| 14252 | ------ |
| 14253 | |
| 14254 | * A new MS-DOS port has been done, using MSC 6.0 (I believe). Thanks, |
| 14255 | Marcel van der Peijl! This requires fewer compatibility hacks in |
| 14256 | posixmodule.c. The executable is not yet available but will be soon |
| 14257 | (check the mailing list). |
| 14258 | |
| 14259 | * The default PYTHONPATH has changed. |
| 14260 | |
| 14261 | |
| 14262 | Changes for developers of extension modules |
| 14263 | ------------------------------------------- |
| 14264 | |
| 14265 | * Read src/ChangeLog for full details. |
| 14266 | |
| 14267 | |
| 14268 | SGI specific changes |
| 14269 | -------------------- |
| 14270 | |
| 14271 | * Read src/ChangeLog for full details. |
| 14272 | |
Guido van Rossum | aa25386 | 1994-10-06 17:18:57 +0000 | [diff] [blame] | 14273 | |
Guido van Rossum | a7925f1 | 1994-01-26 10:20:16 +0000 | [diff] [blame] | 14274 | ================================== |
| 14275 | ==> Release 0.9.8 (9 Jan 1993) <== |
| 14276 | ================================== |
| 14277 | |
| 14278 | I claim no completeness here, but I've tried my best to scan the log |
| 14279 | files throughout my source tree for interesting bits of news. A more |
| 14280 | complete account of the changes is to be found in the various |
| 14281 | ChangeLog files. See also "News for release 0.9.7beta" below if you're |
| 14282 | still using release 0.9.6, and the file HISTORY if you have an even |
| 14283 | older release. |
| 14284 | |
| 14285 | --Guido |
| 14286 | |
| 14287 | |
| 14288 | Changes to the language proper |
| 14289 | ------------------------------ |
| 14290 | |
| 14291 | There's only one big change: the conformance checking for function |
| 14292 | argument lists (of user-defined functions only) is stricter. Earlier, |
| 14293 | you could get away with the following: |
| 14294 | |
| 14295 | (a) define a function of one argument and call it with any |
| 14296 | number of arguments; if the actual argument count wasn't |
| 14297 | one, the function would receive a tuple containing the |
| 14298 | arguments arguments (an empty tuple if there were none). |
| 14299 | |
| 14300 | (b) define a function of two arguments, and call it with more |
| 14301 | than two arguments; if there were more than two arguments, |
| 14302 | the second argument would be passed as a tuple containing |
| 14303 | the second and further actual arguments. |
| 14304 | |
| 14305 | (Note that an argument (formal or actual) that is a tuple is counted as |
| 14306 | one; these rules don't apply inside such tuples, only at the top level |
| 14307 | of the argument list.) |
| 14308 | |
| 14309 | Case (a) was needed to accommodate variable-length argument lists; |
| 14310 | there is now an explicit "varargs" feature (precede the last argument |
| 14311 | with a '*'). Case (b) was needed for compatibility with old class |
| 14312 | definitions: up to release 0.9.4 a method with more than one argument |
| 14313 | had to be declared as "def meth(self, (arg1, arg2, ...)): ...". |
| 14314 | Version 0.9.6 provide better ways to handle both casees, bot provided |
| 14315 | backward compatibility; version 0.9.8 retracts the compatibility hacks |
| 14316 | since they also cause confusing behavior if a function is called with |
| 14317 | the wrong number of arguments. |
| 14318 | |
| 14319 | There's a script that helps converting classes that still rely on (b), |
| 14320 | provided their methods' first argument is called "self": |
| 14321 | demo/scripts/methfix.py. |
| 14322 | |
| 14323 | If this change breaks lots of code you have developed locally, try |
| 14324 | #defining COMPAT_HACKS in ceval.c. |
| 14325 | |
| 14326 | (There's a third compatibility hack, which is the reverse of (a): if a |
| 14327 | function is defined with two or more arguments, and called with a |
| 14328 | single argument that is a tuple with just as many arguments, the items |
| 14329 | of this tuple will be used as the arguments. Although this can (and |
| 14330 | should!) be done using the built-in function apply() instead, it isn't |
| 14331 | withdrawn yet.) |
| 14332 | |
| 14333 | |
| 14334 | One minor change: comparing instance methods works like expected, so |
| 14335 | that if x is an instance of a user-defined class and has a method m, |
| 14336 | then (x.m==x.m) yields 1. |
| 14337 | |
| 14338 | |
| 14339 | The following was already present in 0.9.7beta, but not explicitly |
| 14340 | mentioned in the NEWS file: user-defined classes can now define types |
| 14341 | that behave in almost allrespects like numbers. See |
| 14342 | demo/classes/Rat.py for a simple example. |
| 14343 | |
| 14344 | |
| 14345 | Changes to the build process |
| 14346 | ---------------------------- |
| 14347 | |
| 14348 | The Configure.py script and the Makefile has been made somewhat more |
| 14349 | bullet-proof, after reports of (minor) trouble on certain platforms. |
| 14350 | |
| 14351 | There is now a script to patch Makefile and config.c to add a new |
| 14352 | optional built-in module: Addmodule.sh. Read the script before using! |
| 14353 | |
| 14354 | Useing Addmodule.sh, all optional modules can now be configured at |
| 14355 | compile time using Configure.py, so there are no modules left that |
| 14356 | require dynamic loading. |
| 14357 | |
| 14358 | The Makefile has been fixed to make it easier to use with the VPATH |
| 14359 | feature of some Make versions (e.g. SunOS). |
| 14360 | |
| 14361 | |
| 14362 | Changes affecting portability |
| 14363 | ----------------------------- |
| 14364 | |
| 14365 | Several minor portability problems have been solved, e.g. "malloc.h" |
| 14366 | has been renamed to "mymalloc.h", "strdup.c" is no longer used, and |
| 14367 | the system now tolerates malloc(0) returning 0. |
| 14368 | |
| 14369 | For dynamic loading on the SGI, Jack Jansen's dl 1.6 is now |
| 14370 | distributed with Python. This solves several minor problems, in |
| 14371 | particular scripts invoked using #! can now use dynamic loading. |
| 14372 | |
| 14373 | |
| 14374 | Changes to the interpreter interface |
| 14375 | ------------------------------------ |
| 14376 | |
| 14377 | On popular demand, there's finally a "profile" feature for interactive |
| 14378 | use of the interpreter. If the environment variable $PYTHONSTARTUP is |
| 14379 | set to the name of an existing file, Python statements in this file |
| 14380 | are executed when the interpreter is started in interactive mode. |
| 14381 | |
| 14382 | There is a new clean-up mechanism, complementing try...finally: if you |
| 14383 | assign a function object to sys.exitfunc, it will be called when |
| 14384 | Python exits or receives a SIGTERM or SIGHUP signal. |
| 14385 | |
| 14386 | The interpreter is now generally assumed to live in |
| 14387 | /usr/local/bin/python (as opposed to /usr/local/python). The script |
| 14388 | demo/scripts/fixps.py will update old scripts in place (you can easily |
| 14389 | modify it to do other similar changes). |
| 14390 | |
| 14391 | Most I/O that uses sys.stdin/stdout/stderr will now use any object |
| 14392 | assigned to those names as long as the object supports readline() or |
| 14393 | write() methods. |
| 14394 | |
| 14395 | The parser stack has been increased to 500 to accommodate more |
| 14396 | complicated expressions (7 levels used to be the practical maximum, |
| 14397 | it's now about 38). |
| 14398 | |
| 14399 | The limit on the size of the *run-time* stack has completely been |
| 14400 | removed -- this means that tuple or list displays can contain any |
| 14401 | number of elements (formerly more than 50 would crash the |
| 14402 | interpreter). |
| 14403 | |
| 14404 | |
| 14405 | Changes to existing built-in functions and methods |
| 14406 | -------------------------------------------------- |
| 14407 | |
| 14408 | The built-in functions int(), long(), float(), oct() and hex() now |
| 14409 | also apply to class instalces that define corresponding methods |
| 14410 | (__int__ etc.). |
| 14411 | |
| 14412 | |
| 14413 | New built-in functions |
| 14414 | ---------------------- |
| 14415 | |
| 14416 | The new functions str() and repr() convert any object to a string. |
| 14417 | The function repr(x) is in all respects equivalent to `x` -- some |
| 14418 | people prefer a function for this. The function str(x) does the same |
| 14419 | except if x is already a string -- then it returns x unchanged |
| 14420 | (repr(x) adds quotes and escapes "funny" characters as octal escapes). |
| 14421 | |
| 14422 | The new function cmp(x, y) returns -1 if x<y, 0 if x==y, 1 if x>y. |
| 14423 | |
| 14424 | |
| 14425 | Changes to general built-in modules |
| 14426 | ----------------------------------- |
| 14427 | |
| 14428 | The time module's functions are more general: time() returns a |
| 14429 | floating point number and sleep() accepts one. Their accuracies |
| 14430 | depends on the precision of the system clock. Millisleep is no longer |
| 14431 | needed (although it still exists for now), but millitimer is still |
| 14432 | needed since on some systems wall clock time is only available with |
| 14433 | seconds precision, while a source of more precise time exists that |
| 14434 | isn't synchronized with the wall clock. (On UNIX systems that support |
| 14435 | the BSD gettimeofday() function, time.time() is as time.millitimer().) |
| 14436 | |
| 14437 | The string representation of a file object now includes an address: |
| 14438 | '<file 'filename', mode 'r' at #######>' where ###### is a hex number |
| 14439 | (the object's address) to make it unique. |
| 14440 | |
| 14441 | New functions added to posix: nice(), setpgrp(), and if your system |
| 14442 | supports them: setsid(), setpgid(), tcgetpgrp(), tcsetpgrp(). |
| 14443 | |
| 14444 | Improvements to the socket module: socket objects have new methods |
| 14445 | getpeername() and getsockname(), and the {get,set}sockopt methods can |
| 14446 | now get/set any kind of option using strings built with the new struct |
| 14447 | module. And there's a new function fromfd() which creates a socket |
| 14448 | object given a file descriptor (useful for servers started by inetd, |
| 14449 | which have a socket connected to stdin and stdout). |
| 14450 | |
| 14451 | |
| 14452 | Changes to SGI-specific built-in modules |
| 14453 | ---------------------------------------- |
| 14454 | |
| 14455 | The FORMS library interface (fl) now requires FORMS 2.1a. Some new |
| 14456 | functions have been added and some bugs have been fixed. |
| 14457 | |
| 14458 | Additions to al (audio library interface): added getname(), |
| 14459 | getdefault() and getminmax(). |
| 14460 | |
| 14461 | The gl modules doesn't call "foreground()" when initialized (this |
| 14462 | caused some problems) like it dit in 0.9.7beta (but not before). |
| 14463 | There's a new gl function 'gversion() which returns a version string. |
| 14464 | |
| 14465 | The interface to sv (Indigo video interface) has totally changed. |
| 14466 | (Sorry, still no documentation, but see the examples in |
| 14467 | demo/sgi/{sv,video}.) |
| 14468 | |
| 14469 | |
| 14470 | Changes to standard library modules |
| 14471 | ----------------------------------- |
| 14472 | |
| 14473 | Most functions in module string are now much faster: they're actually |
| 14474 | implemented in C. The module containing the C versions is called |
| 14475 | "strop" but you should still import "string" since strop doesn't |
| 14476 | provide all the interfaces defined in string (and strop may be renamed |
| 14477 | to string when it is complete in a future release). |
| 14478 | |
| 14479 | string.index() now accepts an optional third argument giving an index |
| 14480 | where to start searching in the first argument, so you can find second |
| 14481 | and further occurrences (this is similar to the regular expression |
| 14482 | functions in regex). |
| 14483 | |
| 14484 | The definition of what string.splitfields(anything, '') should return |
| 14485 | is changed for the last time: it returns a singleton list containing |
| 14486 | its whole first argument unchanged. This is compatible with |
| 14487 | regsub.split() which also ignores empty delimiter matches. |
| 14488 | |
| 14489 | posixpath, macpath: added dirname() and normpath() (and basename() to |
| 14490 | macpath). |
| 14491 | |
| 14492 | The mainloop module (for use with stdwin) can now demultiplex input |
| 14493 | from other sources, as long as they can be polled with select(). |
| 14494 | |
| 14495 | |
| 14496 | New built-in modules |
| 14497 | -------------------- |
| 14498 | |
| 14499 | Module struct defines functions to pack/unpack values to/from strings |
| 14500 | representing binary values in native byte order. |
| 14501 | |
| 14502 | Module strop implements C versions of many functions from string (see |
| 14503 | above). |
| 14504 | |
| 14505 | Optional module fcntl defines interfaces to fcntl() and ioctl() -- |
| 14506 | UNIX only. (Not yet properly documented -- see however src/fcntl.doc.) |
| 14507 | |
| 14508 | Optional module mpz defines an interface to an altaernative long |
| 14509 | integer implementation, the GNU MPZ library. |
| 14510 | |
| 14511 | Optional module md5 uses the GNU MPZ library to calculate MD5 |
| 14512 | signatures of strings. |
| 14513 | |
| 14514 | There are also optional new modules specific to SGI machines: imageop |
| 14515 | defines some simple operations to images represented as strings; sv |
| 14516 | interfaces to the Indigo video board; cl interfaces to the (yet |
| 14517 | unreleased) compression library. |
| 14518 | |
| 14519 | |
| 14520 | New standard library modules |
| 14521 | ---------------------------- |
| 14522 | |
| 14523 | (Unfortunately the following modules are not all documented; read the |
| 14524 | sources to find out more about them!) |
| 14525 | |
| 14526 | autotest: run testall without showing any output unless it differs |
| 14527 | from the expected output |
| 14528 | |
| 14529 | bisect: use bisection to insert or find an item in a sorted list |
| 14530 | |
| 14531 | colorsys: defines conversions between various color systems (e.g. RGB |
| 14532 | <-> YUV) |
| 14533 | |
| 14534 | nntplib: a client interface to NNTP servers |
| 14535 | |
| 14536 | pipes: utility to construct pipeline from templates, e.g. for |
| 14537 | conversion from one file format to another using several utilities. |
| 14538 | |
| 14539 | regsub: contains three functions that are more or less compatible with |
| 14540 | awk functions of the same name: sub() and gsub() do string |
| 14541 | substitution, split() splits a string using a regular expression to |
| 14542 | define how separators are define. |
| 14543 | |
| 14544 | test_types: test operations on the built-in types of Python |
| 14545 | |
| 14546 | toaiff: convert various audio file formats to AIFF format |
| 14547 | |
| 14548 | tzparse: parse the TZ environment parameter (this may be less general |
| 14549 | than it could be, let me know if you fix it). |
| 14550 | |
| 14551 | (Note that the obsolete module "path" no longer exists.) |
| 14552 | |
| 14553 | |
| 14554 | New SGI-specific library modules |
| 14555 | -------------------------------- |
| 14556 | |
| 14557 | CL: constants for use with the built-in compression library interface (cl) |
| 14558 | |
| 14559 | Queue: a multi-producer, multi-consumer queue class implemented for |
| 14560 | use with the built-in thread module |
| 14561 | |
| 14562 | SOCKET: constants for use with built-in module socket, e.g. to set/get |
| 14563 | socket options. This is SGI-specific because the constants to be |
| 14564 | passed are system-dependent. You can generate a version for your own |
| 14565 | system by running the script demo/scripts/h2py.py with |
| 14566 | /usr/include/sys/socket.h as input. |
| 14567 | |
Walter Dörwald | f0dfc7a | 2003-10-20 14:01:56 +0000 | [diff] [blame] | 14568 | cddb: interface to the database used by the CD player |
Guido van Rossum | a7925f1 | 1994-01-26 10:20:16 +0000 | [diff] [blame] | 14569 | |
| 14570 | torgb: convert various image file types to rgb format (requires pbmplus) |
| 14571 | |
| 14572 | |
| 14573 | New demos |
| 14574 | --------- |
| 14575 | |
| 14576 | There's an experimental interface to define Sun RPC clients and |
| 14577 | servers in demo/rpc. |
| 14578 | |
| 14579 | There's a collection of interfaces to WWW, WAIS and Gopher (both |
| 14580 | Python classes and program providing a user interface) in demo/www. |
| 14581 | This includes a program texi2html.py which converts texinfo files to |
| 14582 | HTML files (the format used hy WWW). |
| 14583 | |
| 14584 | The ibrowse demo has moved from demo/stdwin/ibrowse to demo/ibrowse. |
| 14585 | |
| 14586 | For SGI systems, there's a whole collection of programs and classes |
| 14587 | that make use of the Indigo video board in demo/sgi/{sv,video}. This |
| 14588 | represents a significant amount of work that we're giving away! |
| 14589 | |
| 14590 | There are demos "rsa" and "md5test" that exercise the mpz and md5 |
| 14591 | modules, respectively. The rsa demo is a complete implementation of |
| 14592 | the RSA public-key cryptosystem! |
| 14593 | |
| 14594 | A bunch of games and examples submitted by Stoffel Erasmus have been |
| 14595 | included in demo/stoffel. |
| 14596 | |
| 14597 | There are miscellaneous new files in some existing demo |
| 14598 | subdirectories: classes/bitvec.py, scripts/{fixps,methfix}.py, |
| 14599 | sgi/al/cmpaf.py, sockets/{mcast,gopher}.py. |
| 14600 | |
| 14601 | There are also many minor changes to existing files, but I'm too lazy |
| 14602 | to run a diff and note the differences -- you can do this yourself if |
| 14603 | you save the old distribution's demos. One highlight: the |
| 14604 | stdwin/python.py demo is much improved! |
| 14605 | |
| 14606 | |
| 14607 | Changes to the documentation |
| 14608 | ---------------------------- |
| 14609 | |
| 14610 | The LaTeX source for the library uses different macros to enable it to |
| 14611 | be converted to texinfo, and from there to INFO or HTML format so it |
| 14612 | can be browsed as a hypertext. The net result is that you can now |
| 14613 | read the Python library documentation in Emacs info mode! |
| 14614 | |
| 14615 | |
| 14616 | Changes to the source code that affect C extension writers |
| 14617 | ---------------------------------------------------------- |
| 14618 | |
| 14619 | The function strdup() no longer exists (it was used only in one places |
| 14620 | and is somewhat of a a portability problem sice some systems have the |
| 14621 | same function in their C library. |
| 14622 | |
| 14623 | The functions NEW() and RENEW() allocate one spare byte to guard |
| 14624 | against a NULL return from malloc(0) being taken for an error, but |
| 14625 | this should not be relied upon. |
| 14626 | |
| 14627 | |
| 14628 | ========================= |
| 14629 | ==> Release 0.9.7beta <== |
| 14630 | ========================= |
| 14631 | |
| 14632 | |
| 14633 | Changes to the language proper |
| 14634 | ------------------------------ |
| 14635 | |
| 14636 | User-defined classes can now implement operations invoked through |
| 14637 | special syntax, such as x[i] or `x` by defining methods named |
| 14638 | __getitem__(self, i) or __repr__(self), etc. |
| 14639 | |
| 14640 | |
| 14641 | Changes to the build process |
| 14642 | ---------------------------- |
| 14643 | |
| 14644 | Instead of extensive manual editing of the Makefile to select |
| 14645 | compile-time options, you can now run a Configure.py script. |
| 14646 | The Makefile as distributed builds a minimal interpreter sufficient to |
| 14647 | run Configure.py. See also misc/BUILD |
| 14648 | |
| 14649 | The Makefile now includes more "utility" targets, e.g. install and |
| 14650 | tags/TAGS |
| 14651 | |
| 14652 | Using the provided strtod.c and strtol.c are now separate options, as |
| 14653 | on the Sun the provided strtod.c dumps core :-( |
| 14654 | |
| 14655 | The regex module is now an option chosen by the Makefile, since some |
| 14656 | (old) C compilers choke on regexpr.c |
| 14657 | |
| 14658 | |
| 14659 | Changes affecting portability |
| 14660 | ----------------------------- |
| 14661 | |
| 14662 | You need STDWIN version 0.9.7 (released 30 June 1992) for the stdwin |
| 14663 | interface |
| 14664 | |
| 14665 | Dynamic loading is now supported for Sun (and other non-COFF systems) |
| 14666 | throug dld-3.2.3, as well as for SGI (a new version of Jack Jansen's |
| 14667 | DL is out, 1.4) |
| 14668 | |
| 14669 | The system-dependent code for the use of the select() system call is |
| 14670 | moved to one file: myselect.h |
| 14671 | |
| 14672 | Thanks to Jaap Vermeulen, the code should now port cleanly to the |
| 14673 | SEQUENT |
| 14674 | |
| 14675 | |
| 14676 | Changes to the interpreter interface |
| 14677 | ------------------------------------ |
| 14678 | |
| 14679 | The interpretation of $PYTHONPATH in the environment is different: it |
| 14680 | is inserted in front of the default path instead of overriding it |
| 14681 | |
| 14682 | |
| 14683 | Changes to existing built-in functions and methods |
| 14684 | -------------------------------------------------- |
| 14685 | |
| 14686 | List objects now support an optional argument to their sort() method, |
| 14687 | which is a comparison function similar to qsort(3) in C |
| 14688 | |
| 14689 | File objects now have a method fileno(), used by the new select module |
| 14690 | (see below) |
| 14691 | |
| 14692 | |
| 14693 | New built-in function |
| 14694 | --------------------- |
| 14695 | |
| 14696 | coerce(x, y): take two numbers and return a tuple containing them |
| 14697 | both converted to a common type |
| 14698 | |
| 14699 | |
| 14700 | Changes to built-in modules |
| 14701 | --------------------------- |
| 14702 | |
| 14703 | sys: fixed core dumps in settrace() and setprofile() |
| 14704 | |
| 14705 | socket: added socket methods setsockopt() and getsockopt(); and |
| 14706 | fileno(), used by the new select module (see below) |
| 14707 | |
| 14708 | stdwin: added fileno() == connectionnumber(), in support of new module |
| 14709 | select (see below) |
| 14710 | |
| 14711 | posix: added get{eg,eu,g,u}id(); waitpid() is now a separate function. |
| 14712 | |
| 14713 | gl: added qgetfd() |
| 14714 | |
| 14715 | fl: added several new functions, fixed several obscure bugs, adapted |
| 14716 | to FORMS 2.1 |
| 14717 | |
| 14718 | |
| 14719 | Changes to standard modules |
| 14720 | --------------------------- |
| 14721 | |
| 14722 | posixpath: changed implementation of ismount() |
| 14723 | |
| 14724 | string: atoi() no longer mistakes leading zero for octal number |
| 14725 | |
| 14726 | ... |
| 14727 | |
| 14728 | |
| 14729 | New built-in modules |
| 14730 | -------------------- |
| 14731 | |
| 14732 | Modules marked "dynamic only" are not configured at compile time but |
| 14733 | can be loaded dynamically. You need to turn on the DL or DLD option in |
| 14734 | the Makefile for support dynamic loading of modules (this requires |
| 14735 | external code). |
| 14736 | |
| 14737 | select: interfaces to the BSD select() system call |
| 14738 | |
| 14739 | dbm: interfaces to the (new) dbm library (dynamic only) |
| 14740 | |
| 14741 | nis: interfaces to some NIS functions (aka yellow pages) |
| 14742 | |
| 14743 | thread: limited form of multiple threads (sgi only) |
| 14744 | |
| 14745 | audioop: operations useful for audio programs, e.g. u-LAW and ADPCM |
| 14746 | coding (dynamic only) |
| 14747 | |
| 14748 | cd: interface to Indigo SCSI CDROM player audio library (sgi only) |
| 14749 | |
| 14750 | jpeg: read files in JPEG format (dynamic only, sgi only; needs |
| 14751 | external code) |
| 14752 | |
| 14753 | imgfile: read SGI image files (dynamic only, sgi only) |
| 14754 | |
| 14755 | sunaudiodev: interface to sun's /dev/audio (dynamic only, sun only) |
| 14756 | |
| 14757 | sv: interface to Indigo video library (sgi only) |
| 14758 | |
| 14759 | pc: a minimal set of MS-DOS interfaces (MS-DOS only) |
| 14760 | |
| 14761 | rotor: encryption, by Lance Ellinghouse (dynamic only) |
| 14762 | |
| 14763 | |
| 14764 | New standard modules |
| 14765 | -------------------- |
| 14766 | |
| 14767 | Not all these modules are documented. Read the source: |
| 14768 | lib/<modulename>.py. Sometimes a file lib/<modulename>.doc contains |
| 14769 | additional documentation. |
| 14770 | |
| 14771 | imghdr: recognizes image file headers |
| 14772 | |
| 14773 | sndhdr: recognizes sound file headers |
| 14774 | |
| 14775 | profile: print run-time statistics of Python code |
| 14776 | |
| 14777 | readcd, cdplayer: companion modules for built-in module cd (sgi only) |
| 14778 | |
| 14779 | emacs: interface to Emacs using py-connect.el (see below). |
| 14780 | |
| 14781 | SOCKET: symbolic constant definitions for socket options |
| 14782 | |
| 14783 | SUNAUDIODEV: symbolic constant definitions for sunaudiodef (sun only) |
| 14784 | |
| 14785 | SV: symbolic constat definitions for sv (sgi only) |
| 14786 | |
| 14787 | CD: symbolic constat definitions for cd (sgi only) |
| 14788 | |
| 14789 | |
| 14790 | New demos |
| 14791 | --------- |
| 14792 | |
| 14793 | scripts/pp.py: execute Python as a filter with a Perl-like command |
| 14794 | line interface |
| 14795 | |
| 14796 | classes/: examples using the new class features |
| 14797 | |
| 14798 | threads/: examples using the new thread module |
| 14799 | |
| 14800 | sgi/cd/: examples using the new cd module |
| 14801 | |
| 14802 | |
| 14803 | Changes to the documentation |
| 14804 | ---------------------------- |
| 14805 | |
| 14806 | The last-minute syntax changes of release 0.9.6 are now reflected |
| 14807 | everywhere in the manuals |
| 14808 | |
| 14809 | The reference manual has a new section (3.2) on implementing new kinds |
| 14810 | of numbers, sequences or mappings with user classes |
| 14811 | |
| 14812 | Classes are now treated extensively in the tutorial (chapter 9) |
| 14813 | |
| 14814 | Slightly restructured the system-dependent chapters of the library |
| 14815 | manual |
| 14816 | |
| 14817 | The file misc/EXTENDING incorporates documentation for mkvalue() and |
| 14818 | a new section on error handling |
| 14819 | |
| 14820 | The files misc/CLASSES and misc/ERRORS are no longer necessary |
| 14821 | |
| 14822 | The doc/Makefile now creates PostScript files automatically |
| 14823 | |
| 14824 | |
| 14825 | Miscellaneous changes |
| 14826 | --------------------- |
| 14827 | |
| 14828 | Incorporated Tim Peters' changes to python-mode.el, it's now version |
| 14829 | 1.06 |
| 14830 | |
| 14831 | A python/Emacs bridge (provided by Terrence M. Brannon) lets a Python |
| 14832 | program running in an Emacs buffer execute Emacs lisp code. The |
| 14833 | necessary Python code is in lib/emacs.py. The Emacs code is |
| 14834 | misc/py-connect.el (it needs some external Emacs lisp code) |
| 14835 | |
| 14836 | |
| 14837 | Changes to the source code that affect C extension writers |
| 14838 | ---------------------------------------------------------- |
| 14839 | |
| 14840 | New service function mkvalue() to construct a Python object from C |
| 14841 | values according to a "format" string a la getargs() |
| 14842 | |
| 14843 | Most functions from pythonmain.c moved to new pythonrun.c which is |
| 14844 | in libpython.a. This should make embedded versions of Python easier |
| 14845 | |
| 14846 | ceval.h is split in eval.h (which needs compile.h and only declares |
| 14847 | eval_code) and ceval.h (which doesn't need compile.hand declares the |
| 14848 | rest) |
| 14849 | |
| 14850 | ceval.h defines macros BGN_SAVE / END_SAVE for use with threads (to |
| 14851 | improve the parallellism of multi-threaded programs by letting other |
| 14852 | Python code run when a blocking system call or something similar is |
| 14853 | made) |
| 14854 | |
| 14855 | In structmember.[ch], new member types BYTE, CHAR and unsigned |
| 14856 | variants have been added |
| 14857 | |
| 14858 | New file xxmodule.c is a template for new extension modules. |
| 14859 | |
Guido van Rossum | aa25386 | 1994-10-06 17:18:57 +0000 | [diff] [blame] | 14860 | |
Guido van Rossum | a7925f1 | 1994-01-26 10:20:16 +0000 | [diff] [blame] | 14861 | ================================== |
Guido van Rossum | f2eac99 | 2000-09-04 17:24:24 +0000 | [diff] [blame] | 14862 | ==> Release 0.9.6 (6 Apr 1992) <== |
Guido van Rossum | a7925f1 | 1994-01-26 10:20:16 +0000 | [diff] [blame] | 14863 | ================================== |
| 14864 | |
| 14865 | Misc news in 0.9.6: |
| 14866 | - Restructured the misc subdirectory |
| 14867 | - Reference manual completed, library manual much extended (with indexes!) |
| 14868 | - the GNU Readline library is now distributed standard with Python |
| 14869 | - the script "../demo/scripts/classfix.py" fixes Python modules using old |
| 14870 | class syntax |
| 14871 | - Emacs python-mode.el (was python.el) vastly improved (thanks, Tim!) |
| 14872 | - Because of the GNU copyleft business I am not using the GNU regular |
| 14873 | expression implementation but a free re-implementation by Tatu Ylonen |
| 14874 | that recently appeared in comp.sources.misc (Bravo, Tatu!) |
| 14875 | |
| 14876 | New features in 0.9.6: |
| 14877 | - stricter try stmt syntax: cannot mix except and finally clauses on 1 try |
| 14878 | - New module 'os' supplants modules 'mac' and 'posix' for most cases; |
| 14879 | module 'path' is replaced by 'os.path' |
| 14880 | - os.path.split() return value differs from that of old path.split() |
| 14881 | - sys.exc_type, sys.exc_value, sys.exc_traceback are set to the exception |
| 14882 | currently being handled |
| 14883 | - sys.last_type, sys.last_value, sys.last_traceback remember last unhandled |
| 14884 | exception |
| 14885 | - New function string.expandtabs() expands tabs in a string |
| 14886 | - Added times() interface to posix (user & sys time of process & children) |
| 14887 | - Added uname() interface to posix (returns OS type, hostname, etc.) |
| 14888 | - New built-in function execfile() is like exec() but from a file |
| 14889 | - Functions exec() and eval() are less picky about whitespace/newlines |
| 14890 | - New built-in functions getattr() and setattr() access arbitrary attributes |
| 14891 | - More generic argument handling in built-in functions (see "./EXTENDING") |
| 14892 | - Dynamic loading of modules written in C or C++ (see "./DYNLOAD") |
| 14893 | - Division and modulo for long and plain integers with negative operands |
| 14894 | have changed; a/b is now floor(float(a)/float(b)) and a%b is defined |
| 14895 | as a-(a/b)*b. So now the outcome of divmod(a,b) is the same as |
| 14896 | (a/b, a%b) for integers. For floats, % is also changed, but of course |
| 14897 | / is unchanged, and divmod(x,y) does not yield (x/y, x%y)... |
| 14898 | - A function with explicit variable-length argument list can be declared |
| 14899 | like this: def f(*args): ...; or even like this: def f(a, b, *rest): ... |
| 14900 | - Code tracing and profiling features have been added, and two source |
| 14901 | code debuggers are provided in the library (pdb.py, tty-oriented, |
| 14902 | and wdb, window-oriented); you can now step through Python programs! |
| 14903 | See sys.settrace() and sys.setprofile(), and "../lib/pdb.doc" |
| 14904 | - '==' is now the only equality operator; "../demo/scripts/eqfix.py" is |
| 14905 | a script that fixes old Python modules |
| 14906 | - Plain integer right shift now uses sign extension |
| 14907 | - Long integer shift/mask operations now simulate 2's complement |
| 14908 | to give more useful results for negative operands |
| 14909 | - Changed/added range checks for long/plain integer shifts |
| 14910 | - Options found after "-c command" are now passed to the command in sys.argv |
| 14911 | (note subtle incompatiblity with "python -c command -- -options"!) |
| 14912 | - Module stdwin is better protected against touching objects after they've |
| 14913 | been closed; menus can now also be closed explicitly |
| 14914 | - Stdwin now uses its own exception (stdwin.error) |
| 14915 | |
| 14916 | New features in 0.9.5 (released as Macintosh application only, 2 Jan 1992): |
| 14917 | - dictionary objects can now be compared properly; e.g., {}=={} is true |
| 14918 | - new exception SystemExit causes termination if not caught; |
| 14919 | it is raised by sys.exit() so that 'finally' clauses can clean up, |
| 14920 | and it may even be caught. It does work interactively! |
| 14921 | - new module "regex" implements GNU Emacs style regular expressions; |
| 14922 | module "regexp" is rewritten in Python for backward compatibility |
| 14923 | - formal parameter lists may contain trailing commas |
| 14924 | |
| 14925 | Bugs fixed in 0.9.6: |
| 14926 | - assigning to or deleting a list item with a negative index dumped core |
| 14927 | - divmod(-10L,5L) returned (-3L, 5L) instead of (-2L, 0L) |
| 14928 | |
| 14929 | Bugs fixed in 0.9.5: |
| 14930 | - masking operations involving negative long integers gave wrong results |
| 14931 | |
| 14932 | |
| 14933 | =================================== |
Guido van Rossum | f2eac99 | 2000-09-04 17:24:24 +0000 | [diff] [blame] | 14934 | ==> Release 0.9.4 (24 Dec 1991) <== |
Guido van Rossum | a7925f1 | 1994-01-26 10:20:16 +0000 | [diff] [blame] | 14935 | =================================== |
| 14936 | |
| 14937 | - new function argument handling (see below) |
| 14938 | - built-in apply(func, args) means func(args[0], args[1], ...) |
| 14939 | - new, more refined exceptions |
| 14940 | - new exception string values (NameError = 'NameError' etc.) |
| 14941 | - better checking for math exceptions |
| 14942 | - for sequences (string/tuple/list), x[-i] is now equivalent to x[len(x)-i] |
| 14943 | - fixed list assignment bug: "a[1:1] = a" now works correctly |
| 14944 | - new class syntax, without extraneous parentheses |
| 14945 | - new 'global' statement to assign global variables from within a function |
| 14946 | |
| 14947 | |
| 14948 | New class syntax |
| 14949 | ---------------- |
| 14950 | |
| 14951 | You can now declare a base class as follows: |
| 14952 | |
| 14953 | class B: # Was: class B(): |
| 14954 | def some_method(self): ... |
| 14955 | ... |
| 14956 | |
| 14957 | and a derived class thusly: |
| 14958 | |
| 14959 | class D(B): # Was: class D() = B(): |
| 14960 | def another_method(self, arg): ... |
| 14961 | |
| 14962 | Multiple inheritance looks like this: |
| 14963 | |
| 14964 | class M(B, D): # Was: class M() = B(), D(): |
| 14965 | def this_or_that_method(self, arg): ... |
| 14966 | |
| 14967 | The old syntax is still accepted by Python 0.9.4, but will disappear |
| 14968 | in Python 1.0 (to be posted to comp.sources). |
| 14969 | |
| 14970 | |
| 14971 | New 'global' statement |
| 14972 | ---------------------- |
| 14973 | |
| 14974 | Every now and then you have a global variable in a module that you |
| 14975 | want to change from within a function in that module -- say, a count |
| 14976 | of calls to a function, or an option flag, etc. Until now this was |
| 14977 | not directly possible. While several kludges are known that |
| 14978 | circumvent the problem, and often the need for a global variable can |
| 14979 | be avoided by rewriting the module as a class, this does not always |
| 14980 | lead to clearer code. |
| 14981 | |
| 14982 | The 'global' statement solves this dilemma. Its occurrence in a |
| 14983 | function body means that, for the duration of that function, the |
| 14984 | names listed there refer to global variables. For instance: |
| 14985 | |
| 14986 | total = 0.0 |
| 14987 | count = 0 |
| 14988 | |
| 14989 | def add_to_total(amount): |
| 14990 | global total, count |
| 14991 | total = total + amount |
| 14992 | count = count + 1 |
| 14993 | |
| 14994 | 'global' must be repeated in each function where it is needed. The |
| 14995 | names listed in a 'global' statement must not be used in the function |
| 14996 | before the statement is reached. |
| 14997 | |
| 14998 | Remember that you don't need to use 'global' if you only want to *use* |
| 14999 | a global variable in a function; nor do you need ot for assignments to |
| 15000 | parts of global variables (e.g., list or dictionary items or |
| 15001 | attributes of class instances). This has not changed; in fact |
| 15002 | assignment to part of a global variable was the standard workaround. |
| 15003 | |
| 15004 | |
| 15005 | New exceptions |
| 15006 | -------------- |
| 15007 | |
| 15008 | Several new exceptions have been defined, to distinguish more clearly |
| 15009 | between different types of errors. |
| 15010 | |
| 15011 | name meaning was |
| 15012 | |
| 15013 | AttributeError reference to non-existing attribute NameError |
| 15014 | IOError unexpected I/O error RuntimeError |
| 15015 | ImportError import of non-existing module or name NameError |
| 15016 | IndexError invalid string, tuple or list index RuntimeError |
| 15017 | KeyError key not in dictionary RuntimeError |
| 15018 | OverflowError numeric overflow RuntimeError |
| 15019 | SyntaxError invalid syntax RuntimeError |
| 15020 | ValueError invalid argument value RuntimeError |
| 15021 | ZeroDivisionError division by zero RuntimeError |
| 15022 | |
| 15023 | The string value of each exception is now its name -- this makes it |
| 15024 | easier to experimentally find out which operations raise which |
| 15025 | exceptions; e.g.: |
| 15026 | |
| 15027 | >>> KeyboardInterrupt |
| 15028 | 'KeyboardInterrupt' |
| 15029 | >>> |
| 15030 | |
| 15031 | |
| 15032 | New argument passing semantics |
| 15033 | ------------------------------ |
| 15034 | |
| 15035 | Off-line discussions with Steve Majewski and Daniel LaLiberte have |
| 15036 | convinced me that Python's parameter mechanism could be changed in a |
| 15037 | way that made both of them happy (I hope), kept me happy, fixed a |
| 15038 | number of outstanding problems, and, given some backward compatibility |
| 15039 | provisions, would only break a very small amount of existing code -- |
| 15040 | probably all mine anyway. In fact I suspect that most Python users |
| 15041 | will hardly notice the difference. And yet it has cost me at least |
| 15042 | one sleepless night to decide to make the change... |
| 15043 | |
| 15044 | Philosophically, the change is quite radical (to me, anyway): a |
| 15045 | function is no longer called with either zero or one argument, which |
| 15046 | is a tuple if there appear to be more arguments. Every function now |
| 15047 | has an argument list containing 0, 1 or more arguments. This list is |
| 15048 | always implemented as a tuple, and it is a (run-time) error if a |
| 15049 | function is called with a different number of arguments than expected. |
| 15050 | |
| 15051 | What's the difference? you may ask. The answer is, very little unless |
| 15052 | you want to write variadic functions -- functions that may be called |
| 15053 | with a variable number of arguments. Formerly, you could write a |
| 15054 | function that accepted one or more arguments with little trouble, but |
| 15055 | writing a function that could be called with either 0 or 1 argument |
| 15056 | (or more) was next to impossible. This is now a piece of cake: you |
| 15057 | can simply declare an argument that receives the entire argument |
| 15058 | tuple, and check its length -- it will be of size 0 if there are no |
| 15059 | arguments. |
| 15060 | |
| 15061 | Another anomaly of the old system was the way multi-argument methods |
| 15062 | (in classes) had to be declared, e.g.: |
| 15063 | |
| 15064 | class Point(): |
| 15065 | def init(self, (x, y, color)): ... |
| 15066 | def setcolor(self, color): ... |
| 15067 | dev moveto(self, (x, y)): ... |
| 15068 | def draw(self): ... |
| 15069 | |
| 15070 | Using the new scheme there is no need to enclose the method arguments |
| 15071 | in an extra set of parentheses, so the above class could become: |
| 15072 | |
| 15073 | class Point: |
| 15074 | def init(self, x, y, color): ... |
| 15075 | def setcolor(self, color): ... |
| 15076 | dev moveto(self, x, y): ... |
| 15077 | def draw(self): ... |
| 15078 | |
| 15079 | That is, the equivalence rule between methods and functions has |
| 15080 | changed so that now p.moveto(x,y) is equivalent to Point.moveto(p,x,y) |
| 15081 | while formerly it was equivalent to Point.moveto(p,(x,y)). |
| 15082 | |
| 15083 | A special backward compatibility rule makes that the old version also |
| 15084 | still works: whenever a function with exactly two arguments (at the top |
| 15085 | level) is called with more than two arguments, the second and further |
| 15086 | arguments are packed into a tuple and passed as the second argument. |
| 15087 | This rule is invoked independently of whether the function is actually a |
| 15088 | method, so there is a slight chance that some erroneous calls of |
| 15089 | functions expecting two arguments with more than that number of |
| 15090 | arguments go undetected at first -- when the function tries to use the |
| 15091 | second argument it may find it is a tuple instead of what was expected. |
| 15092 | Note that this rule will be removed from future versions of the |
| 15093 | language; it is a backward compatibility provision *only*. |
| 15094 | |
| 15095 | Two other rules and a new built-in function handle conversion between |
| 15096 | tuples and argument lists: |
| 15097 | |
| 15098 | Rule (a): when a function with more than one argument is called with a |
| 15099 | single argument that is a tuple of the right size, the tuple's items |
| 15100 | are used as arguments. |
| 15101 | |
| 15102 | Rule (b): when a function with exactly one argument receives no |
| 15103 | arguments or more than one, that one argument will receive a tuple |
| 15104 | containing the arguments (the tuple will be empty if there were no |
| 15105 | arguments). |
| 15106 | |
| 15107 | |
| 15108 | A new built-in function, apply(), was added to support functions that |
| 15109 | need to call other functions with a constructed argument list. The call |
| 15110 | |
| 15111 | apply(function, tuple) |
| 15112 | |
| 15113 | is equivalent to |
| 15114 | |
| 15115 | function(tuple[0], tuple[1], ..., tuple[len(tuple)-1]) |
| 15116 | |
| 15117 | |
| 15118 | While no new argument syntax was added in this phase, it would now be |
| 15119 | quite sensible to add explicit syntax to Python for default argument |
| 15120 | values (as in C++ or Modula-3), or a "rest" argument to receive the |
| 15121 | remaining arguments of a variable-length argument list. |
| 15122 | |
| 15123 | |
| 15124 | ======================================================== |
| 15125 | ==> Release 0.9.3 (never made available outside CWI) <== |
| 15126 | ======================================================== |
| 15127 | |
| 15128 | - string sys.version shows current version (also printed on interactive entry) |
| 15129 | - more detailed exceptions, e.g., IOError, ZeroDivisionError, etc. |
| 15130 | - 'global' statement to declare module-global variables assigned in functions. |
| 15131 | - new class declaration syntax: class C(Base1, Base2, ...): suite |
| 15132 | (the old syntax is still accepted -- be sure to convert your classes now!) |
| 15133 | - C shifting and masking operators: << >> ~ & ^ | (for ints and longs). |
| 15134 | - C comparison operators: == != (the old = and <> remain valid). |
| 15135 | - floating point numbers may now start with a period (e.g., .14). |
| 15136 | - definition of integer division tightened (always truncates towards zero). |
| 15137 | - new builtins hex(x), oct(x) return hex/octal string from (long) integer. |
| 15138 | - new list method l.count(x) returns the number of occurrences of x in l. |
| 15139 | - new SGI module: al (Indigo and 4D/35 audio library). |
| 15140 | - the FORMS interface (modules fl and FL) now uses FORMS 2.0 |
| 15141 | - module gl: added lrect{read,write}, rectzoom and pixmode; |
| 15142 | added (non-GL) functions (un)packrect. |
| 15143 | - new socket method: s.allowbroadcast(flag). |
| 15144 | - many objects support __dict__, __methods__ or __members__. |
| 15145 | - dir() lists anything that has __dict__. |
| 15146 | - class attributes are no longer read-only. |
| 15147 | - classes support __bases__, instances support __class__ (and __dict__). |
| 15148 | - divmod() now also works for floats. |
| 15149 | - fixed obscure bug in eval('1 '). |
| 15150 | |
| 15151 | |
| 15152 | =================================== |
| 15153 | ==> Release 0.9.2 (Autumn 1991) <== |
| 15154 | =================================== |
| 15155 | |
| 15156 | Highlights |
| 15157 | ---------- |
| 15158 | |
| 15159 | - tutorial now (almost) complete; library reference reorganized |
| 15160 | - new syntax: continue statement; semicolons; dictionary constructors; |
| 15161 | restrictions on blank lines in source files removed |
| 15162 | - dramatically improved module load time through precompiled modules |
| 15163 | - arbitrary precision integers: compute 2 to the power 1000 and more... |
| 15164 | - arithmetic operators now accept mixed type operands, e.g., 3.14/4 |
| 15165 | - more operations on list: remove, index, reverse; repetition |
| 15166 | - improved/new file operations: readlines, seek, tell, flush, ... |
| 15167 | - process management added to the posix module: fork/exec/wait/kill etc. |
| 15168 | - BSD socket operations (with example servers and clients!) |
| 15169 | - many new STDWIN features (color, fonts, polygons, ...) |
| 15170 | - new SGI modules: font manager and FORMS library interface |
| 15171 | |
| 15172 | |
| 15173 | Extended list of changes in 0.9.2 |
| 15174 | --------------------------------- |
| 15175 | |
| 15176 | Here is a summary of the most important user-visible changes in 0.9.2, |
| 15177 | in somewhat arbitrary order. Changes in later versions are listed in |
| 15178 | the "highlights" section above. |
| 15179 | |
| 15180 | |
| 15181 | 1. Changes to the interpreter proper |
| 15182 | |
| 15183 | - Simple statements can now be separated by semicolons. |
| 15184 | If you write "if t: s1; s2", both s1 and s2 are executed |
| 15185 | conditionally. |
| 15186 | - The 'continue' statement was added, with semantics as in C. |
| 15187 | - Dictionary displays are now allowed on input: {key: value, ...}. |
| 15188 | - Blank lines and lines bearing only a comment no longer need to |
| 15189 | be indented properly. (A completely empty line still ends a multi- |
| 15190 | line statement interactively.) |
| 15191 | - Mixed arithmetic is supported, 1 compares equal to 1.0, etc. |
| 15192 | - Option "-c command" to execute statements from the command line |
| 15193 | - Compiled versions of modules are cached in ".pyc" files, giving a |
| 15194 | dramatic improvement of start-up time |
| 15195 | - Other, smaller speed improvements, e.g., extracting characters from |
| 15196 | strings, looking up single-character keys, and looking up global |
| 15197 | variables |
| 15198 | - Interrupting a print operation raises KeyboardInterrupt instead of |
| 15199 | only cancelling the print operation |
| 15200 | - Fixed various portability problems (it now passes gcc with only |
| 15201 | warnings -- more Standard C compatibility will be provided in later |
| 15202 | versions) |
| 15203 | - Source is prepared for porting to MS-DOS |
| 15204 | - Numeric constants are now checked for overflow (this requires |
| 15205 | standard-conforming strtol() and strtod() functions; a correct |
| 15206 | strtol() implementation is provided, but the strtod() provided |
| 15207 | relies on atof() for everything, including error checking |
| 15208 | |
| 15209 | |
| 15210 | 2. Changes to the built-in types, functions and modules |
| 15211 | |
| 15212 | - New module socket: interface to BSD socket primitives |
| 15213 | - New modules pwd and grp: access the UNIX password and group databases |
| 15214 | - (SGI only:) New module "fm" interfaces to the SGI IRIX Font Manager |
| 15215 | - (SGI only:) New module "fl" interfaces to Mark Overmars' FORMS library |
| 15216 | - New numeric type: long integer, for unlimited precision |
| 15217 | - integer constants suffixed with 'L' or 'l' are long integers |
| 15218 | - new built-in function long(x) converts int or float to long |
| 15219 | - int() and float() now also convert from long integers |
| 15220 | - New built-in function: |
| 15221 | - pow(x, y) returns x to the power y |
| 15222 | - New operation and methods for lists: |
| 15223 | - l*n returns a new list consisting of n concatenated copies of l |
| 15224 | - l.remove(x) removes the first occurrence of the value x from l |
| 15225 | - l.index(x) returns the index of the first occurrence of x in l |
| 15226 | - l.reverse() reverses l in place |
| 15227 | - New operation for tuples: |
| 15228 | - t*n returns a tuple consisting of n concatenated copies of t |
| 15229 | - Improved file handling: |
| 15230 | - f.readline() no longer restricts the line length, is faster, |
| 15231 | and isn't confused by null bytes; same for raw_input() |
| 15232 | - f.read() without arguments reads the entire (rest of the) file |
| 15233 | - mixing of print and sys.stdout.write() has different effect |
| 15234 | - New methods for files: |
| 15235 | - f.readlines() returns a list containing the lines of the file, |
| 15236 | as read with f.readline() |
| 15237 | - f.flush(), f.tell(), f.seek() call their stdio counterparts |
| 15238 | - f.isatty() tests for "tty-ness" |
| 15239 | - New posix functions: |
| 15240 | - _exit(), exec(), fork(), getpid(), getppid(), kill(), wait() |
| 15241 | - popen() returns a file object connected to a pipe |
| 15242 | - utime() replaces utimes() (the latter is not a POSIX name) |
| 15243 | - New stdwin features, including: |
| 15244 | - font handling |
| 15245 | - color drawing |
| 15246 | - scroll bars made optional |
| 15247 | - polygons |
| 15248 | - filled and xor shapes |
| 15249 | - text editing objects now have a 'settext' method |
| 15250 | |
| 15251 | |
| 15252 | 3. Changes to the standard library |
| 15253 | |
| 15254 | - Name change: the functions path.cat and macpath.cat are now called |
| 15255 | path.join and macpath.join |
| 15256 | - Added new modules: formatter, mutex, persist, sched, mainloop |
| 15257 | - Added some modules and functionality to the "widget set" (which is |
| 15258 | still under development, so please bear with me): |
| 15259 | DirList, FormSplit, TextEdit, WindowSched |
| 15260 | - Fixed module testall to work non-interactively |
| 15261 | - Module string: |
| 15262 | - added functions join() and joinfields() |
| 15263 | - fixed center() to work correct and make it "transitive" |
| 15264 | - Obsolete modules were removed: util, minmax |
| 15265 | - Some modules were moved to the demo directory |
| 15266 | |
| 15267 | |
| 15268 | 4. Changes to the demonstration programs |
| 15269 | |
| 15270 | - Added new useful scipts: byteyears, eptags, fact, from, lfact, |
| 15271 | objgraph, pdeps, pi, primes, ptags, which |
| 15272 | - Added a bunch of socket demos |
| 15273 | - Doubled the speed of ptags |
| 15274 | - Added new stdwin demos: microedit, miniedit |
| 15275 | - Added a windowing interface to the Python interpreter: python (most |
| 15276 | useful on the Mac) |
| 15277 | - Added a browser for Emacs info files: demo/stdwin/ibrowse |
| 15278 | (yes, I plan to put all STDWIN and Python documentation in texinfo |
| 15279 | form in the future) |
| 15280 | |
| 15281 | |
| 15282 | 5. Other changes to the distribution |
| 15283 | |
| 15284 | - An Emacs Lisp file "python.el" is provided to facilitate editing |
| 15285 | Python programs in GNU Emacs (slightly improved since posted to |
| 15286 | gnu.emacs.sources) |
| 15287 | - Some info on writing an extension in C is provided |
| 15288 | - Some info on building Python on non-UNIX platforms is provided |
| 15289 | |
| 15290 | |
| 15291 | ===================================== |
| 15292 | ==> Release 0.9.1 (February 1991) <== |
| 15293 | ===================================== |
| 15294 | |
| 15295 | - Micro changes only |
| 15296 | - Added file "patchlevel.h" |
| 15297 | |
| 15298 | |
| 15299 | ===================================== |
| 15300 | ==> Release 0.9.0 (February 1991) <== |
| 15301 | ===================================== |
| 15302 | |
| 15303 | Original posting to alt.sources. |