]> granicus.if.org Git - python/log
python
24 years agoAdd test that ensures hash() of objects defining __cmp__ or __eq__ but
Guido van Rossum [Thu, 18 Jan 2001 23:47:15 +0000 (23:47 +0000)]
Add test that ensures hash() of objects defining __cmp__ or __eq__ but
not __hash__ raises TypeError.

24 years agoRich comparisons fallout: instance_hash() should check for both
Guido van Rossum [Thu, 18 Jan 2001 23:46:31 +0000 (23:46 +0000)]
Rich comparisons fallout: instance_hash() should check for both
__cmp__ and __eq__ absent before deciding to do a quickie
based on the object address.  (Tim Peters discovered this.)

24 years agoAdd test that ensures hash([]) and hash({}) raise TypeError.
Guido van Rossum [Thu, 18 Jan 2001 23:36:14 +0000 (23:36 +0000)]
Add test that ensures hash([]) and hash({}) raise TypeError.

24 years agoRich comparisons fallout: PyObject_Hash() should check for both
Guido van Rossum [Thu, 18 Jan 2001 23:33:37 +0000 (23:33 +0000)]
Rich comparisons fallout: PyObject_Hash() should check for both
tp_compare and tp_richcompare NULL before deciding to do a quickie
based on the object address.  (Tim Peters discovered this.)

24 years agoChanges to recursive-object comparisons, having to do with a test case
Guido van Rossum [Thu, 18 Jan 2001 22:07:06 +0000 (22:07 +0000)]
Changes to recursive-object comparisons, having to do with a test case
I found where rich comparison of unequal recursive objects gave
unintuituve results.  In a discussion with Tim, where we discovered
that our intuition on when a<=b should be true was failing, we decided
to outlaw ordering comparisons on recursive objects.  (Once we have
fixed our intuition and designed a matching algorithm that's practical
and reasonable to implement, we can allow such orderings again.)

- Refactored the recursive-object comparison framework; more is now
  done in the support routines so less needs to be done in the calling
  routines (even at the expense of slowing it down a bit -- this
  should normally never be invoked, it's mostly just there to avoid
  blowing up the interpreter).

- Changed the framework so that the comparison operator used is also
  stored.  (The dictionary now stores triples (v, w, op) instead of
  pairs (v, w).)

- Changed the nesting limit to a more reasonable small 20; this only
  slows down comparisons of very deeply nested objects (unlikely to
  occur in practice), while speeding up comparisons of recursive
  objects (previously, this would first waste time and space on 500
  nested comparisons before it would start detecting recursion).

- Changed rich comparisons for recursive objects to raise a ValueError
  exception when recursion is detected for ordering oprators (<, <=,
  >, >=).

Unrelated change:

- Moved PyObject_Unicode() to just under PyObject_Str(), where it
  belongs.  MAL's patch must've inserted in a random spot between two
  functions in the file -- between two helpers for rich comparison...

24 years agoSince I'm about to check in a change to the recursion-detection code
Guido van Rossum [Thu, 18 Jan 2001 21:52:26 +0000 (21:52 +0000)]
Since I'm about to check in a change to the recursion-detection code
for comparisons that outlaws requets for ordering on recursive data
structures, remove the tests for ordering recursive data structures.

24 years agoPatch #103313: Fixes "make test" by adding a little file named
Andrew M. Kuchling [Thu, 18 Jan 2001 21:20:56 +0000 (21:20 +0000)]
Patch #103313: Fixes "make test" by adding a little file named
    "platform", running the Python binary to create it, and then
    using it to set PYTHONPATH.

24 years agoPatch from Barry: gets rid of two unused imports,
Andrew M. Kuchling [Thu, 18 Jan 2001 20:39:34 +0000 (20:39 +0000)]
Patch from Barry: gets rid of two unused imports,
   wraps to 80chars, and adds some really hacky setting of compiler
   options when CC and LDSHARED are given on the make command line.
   (The Distutils should probably provide a utility function to
    automatically handle a number of common environment variables)

24 years agoClarifications.
Tim Peters [Thu, 18 Jan 2001 19:01:39 +0000 (19:01 +0000)]
Clarifications.

24 years agoSizable reorganization of how header and library files are found
Andrew M. Kuchling [Thu, 18 Jan 2001 18:44:20 +0000 (18:44 +0000)]
Sizable reorganization of how header and library files are found
Check additional include directories for SSL
Don't build modules that are linked into the Python binary statically
Factored out the detection of Tkinter out into a method, since it's
    the most complicated module to set up
Simplify the logic for detecting Tkinter

24 years agoMinor markup cleaning, and one required fix in the unistr() description.
Fred Drake [Thu, 18 Jan 2001 18:09:07 +0000 (18:09 +0000)]
Minor markup cleaning, and one required fix in the unistr() description.

24 years agoUse openssl/*.h to include the OpenSSL header files
Andrew M. Kuchling [Thu, 18 Jan 2001 17:41:41 +0000 (17:41 +0000)]
Use openssl/*.h to include the OpenSSL header files

24 years agoA dumb test for the dumdbm module.
Guido van Rossum [Thu, 18 Jan 2001 16:46:52 +0000 (16:46 +0000)]
A dumb test for the dumdbm module.

24 years agoAdd test for comparing recursive data types.
Guido van Rossum [Thu, 18 Jan 2001 16:21:57 +0000 (16:21 +0000)]
Add test for comparing recursive data types.

24 years agoMake the original, makesetup-based, targets for building shared modules
Andrew M. Kuchling [Thu, 18 Jan 2001 16:10:56 +0000 (16:10 +0000)]
Make the original, makesetup-based, targets for building shared modules
   available as "oldsharedmods" and "oldsharedinstall".  You'll need
   to get a copy of the full Setup.dist out of the CVS for them to
   actually do much.

24 years agoBite the bullet: use rich comparisons here, too.
Guido van Rossum [Thu, 18 Jan 2001 16:09:55 +0000 (16:09 +0000)]
Bite the bullet: use rich comparisons here, too.

24 years agoAdd test for misbehaving rich comparisons (always returning 0) --
Guido van Rossum [Thu, 18 Jan 2001 15:55:59 +0000 (15:55 +0000)]
Add test for misbehaving rich comparisons (always returning 0) --
these fall back to __cmp__.

24 years agoRich comparison tests
Guido van Rossum [Thu, 18 Jan 2001 15:48:05 +0000 (15:48 +0000)]
Rich comparison tests

24 years agoDocument rich comparisons.
Guido van Rossum [Thu, 18 Jan 2001 15:17:06 +0000 (15:17 +0000)]
Document rich comparisons.

24 years agoUpdated for 2.1; removed references to BeOpen.com and PythonLabs.
Guido van Rossum [Thu, 18 Jan 2001 14:51:12 +0000 (14:51 +0000)]
Updated for 2.1; removed references to BeOpen.com and PythonLabs.
Added Copyright GvR.

24 years agoAdd my name to the copyright notice.
Guido van Rossum [Thu, 18 Jan 2001 14:50:11 +0000 (14:50 +0000)]
Add my name to the copyright notice.

24 years agoAdd note about copyright ownership and license situation.
Guido van Rossum [Thu, 18 Jan 2001 14:39:49 +0000 (14:39 +0000)]
Add note about copyright ownership and license situation.

24 years ago- Add note about complex numbers.
Guido van Rossum [Thu, 18 Jan 2001 14:28:08 +0000 (14:28 +0000)]
- Add note about complex numbers.

- Changed description of rich comparisons to emphasize that < and >
  (etc.) are each other's reflection.  Also use this word in the note
  about the demise of __rcmp__.

24 years agocorrect typo - closes bug #129205
Skip Montanaro [Thu, 18 Jan 2001 10:44:08 +0000 (10:44 +0000)]
correct typo - closes bug #129205

24 years agoFix the example (it didn't seem to reflect reality).
Ka-Ping Yee [Thu, 18 Jan 2001 07:50:17 +0000 (07:50 +0000)]
Fix the example (it didn't seem to reflect reality).

24 years agoRemove build/ subdirectory in "clean" target, not "clobber"
Andrew M. Kuchling [Thu, 18 Jan 2001 04:40:27 +0000 (04:40 +0000)]
Remove build/ subdirectory in "clean" target, not "clobber"

24 years agoVariant of SF patch 103252: Startup optimize: read *.pyc as string, not with getc().
Tim Peters [Thu, 18 Jan 2001 04:39:16 +0000 (04:39 +0000)]
Variant of SF patch 103252: Startup optimize: read *.pyc as string, not with getc().

24 years agoMove distributed and duplicated config for stat() and fstat() into pyport.h.
Tim Peters [Thu, 18 Jan 2001 03:03:16 +0000 (03:03 +0000)]
Move distributed and duplicated config for stat() and fstat() into pyport.h.

24 years agoWhitespace normalization. Leaving tokenize_tests.py alone for now.
Tim Peters [Thu, 18 Jan 2001 02:22:22 +0000 (02:22 +0000)]
Whitespace normalization.  Leaving tokenize_tests.py alone for now.

24 years agoUse rich comparisons to fulfill an old wish: complex numbers now raise
Guido van Rossum [Thu, 18 Jan 2001 01:12:39 +0000 (01:12 +0000)]
Use rich comparisons to fulfill an old wish: complex numbers now raise
exceptions when compared using <, <=, > or >=.

NOTE: This is a tentative change: this means that cmp() involving
complex numbers will raise an exception when the numbers differ, and
that in turn means that e.g. dictionaries and certain other compounds
(e.g. UserLists) containing complex numbers can't be compared either.
So we'll have to decide whether this is acceptable.  The alpha test
cycle is a good time to keep an eye on this!

24 years agoSame treatment as listobject.c:
Guido van Rossum [Thu, 18 Jan 2001 01:02:55 +0000 (01:02 +0000)]
Same treatment as listobject.c:

- In count(), remove(), index(): call RichCompare(Py_EQ).

- Get rid of array_compare(), in favor of new array_richcompare() (a
  near clone of list_compare()).

- Aligned items in array_methods initializer and comments for type
  struct initializer.

- Folded a few long lines.

24 years agoRich comparisons:
Guido van Rossum [Thu, 18 Jan 2001 00:39:02 +0000 (00:39 +0000)]
Rich comparisons:

- Use PyObject_RichCompareBool() when comparing keys; this makes the
  error handling cleaner.

- There were two implementations for dictionary comparison, an old one
  (#ifdef'ed out) and a new one.  Got rid of the old one, which was
  abandoned years ago.

- In the characterize() function, part of dictionary comparison, use
  PyObject_RichCompareBool() to compare keys and values instead.  But
  continue to use PyObject_Compare() for comparing the final
  (deciding) elements.

- Align the comments in the type struct initializer.

Note: I don't implement rich comparison for dictionaries -- there
doesn't seem to be much to be gained.  (The existing comparison
already decides that shorter dicts are always smaller than longer
dicts.)

24 years agoSame treatment as listobject.c:
Guido van Rossum [Thu, 18 Jan 2001 00:00:53 +0000 (00:00 +0000)]
Same treatment as listobject.c:

- tuplecontains(): call RichCompare(Py_EQ).

- Get rid of tuplecompare(), in favor of new tuplerichcompare() (a
  clone of list_compare()).

- Aligned the comments for large struct initializers.

24 years agoFix a leak in instance_coerce(). This was introduced by Neil's
Guido van Rossum [Wed, 17 Jan 2001 23:43:43 +0000 (23:43 +0000)]
Fix a leak in instance_coerce().  This was introduced by Neil's
earlier coercion changes, not by rich comparisons.  When a coercion
function returns 1 (meaning it cannot do it), it should not INCREF the
arguments.  When no __coerce__() method was found, instance_coerce()
originally returned 0, pretending it did it.  Neil changed the return
value to 1, more accurately reflecting that it didn't do anything, but
forgot to take out the two INCREF calls.

24 years agoWindows: 2.1a1 changes so Python runs again. Note that the python20
Tim Peters [Wed, 17 Jan 2001 23:23:13 +0000 (23:23 +0000)]
Windows:  2.1a1 changes so Python runs again.  Note that the python20
subproject is gone, replaced by the new pythoncore subproject.

24 years agoThe signal module has to be compiled statically, so add it to Setup.dist
Andrew M. Kuchling [Wed, 17 Jan 2001 22:17:16 +0000 (22:17 +0000)]
The signal module has to be compiled statically, so add it to Setup.dist
    and remove support for it from setup.py

24 years agoConvert to rich comparisons:
Guido van Rossum [Wed, 17 Jan 2001 22:11:59 +0000 (22:11 +0000)]
Convert to rich comparisons:

- sort's docompare() calls RichCompare(Py_LT).

- list_contains(), list_index(), listcount(), listremove() call
  RichCompare(Py_EQ).

- Get rid of list_compare(), in favor of new list_richcompare().  The
  latter does some nice shortcuts, like when == or != is requested, it
  first compares the lengths for trivial accept/reject.  Then it goes
  over the items until it finds an index where the items differe; then
  it does more shortcut magic to minimize the number of additional
  comparisons.

- Aligned the comments for large struct initializers.

24 years agoBump up version number.
Neil Schemenauer [Wed, 17 Jan 2001 21:59:33 +0000 (21:59 +0000)]
Bump up version number.

24 years ago- compile struct module
Neil Schemenauer [Wed, 17 Jan 2001 21:58:00 +0000 (21:58 +0000)]
- compile struct module
- get version number from sys.version_info

24 years agoa bold attempt to fix things broken by MAL's verify patch: import
Fredrik Lundh [Wed, 17 Jan 2001 21:51:36 +0000 (21:51 +0000)]
a bold attempt to fix things broken by MAL's verify patch: import
'verify' iff it's used by a test module...

24 years agoMarc-Andre must not have run these tests -- they used verify() but
Guido van Rossum [Wed, 17 Jan 2001 21:43:06 +0000 (21:43 +0000)]
Marc-Andre must not have run these tests -- they used verify() but
didn't import it.  Also got rid of some inconsistent spaces inside
parentheses in test_gzip.py.

24 years agoGet rid of the declaration for _PyCompareState_Key.
Guido van Rossum [Wed, 17 Jan 2001 21:28:08 +0000 (21:28 +0000)]
Get rid of the declaration for _PyCompareState_Key.

24 years agoGet rid of the initialization of _PyCompareState_Key.
Guido van Rossum [Wed, 17 Jan 2001 21:27:36 +0000 (21:27 +0000)]
Get rid of the initialization of _PyCompareState_Key.

24 years agoDeal properly (?) with comparing recursive datastructures.
Guido van Rossum [Wed, 17 Jan 2001 21:27:02 +0000 (21:27 +0000)]
Deal properly (?) with comparing recursive datastructures.

- Use the compare nesting level and in-progress dictionary properly in
  PyObject_RichCompare().

- Change the in-progress code to use static variables instead of
  globals (both the nesting level and the key for the thread dict were
  globals but have no reason to be globals; the key can even be a
  function-static variable in get_inprogress_dict()).

- Rewrote try_rich_to_3way_compare() to benefit from the similarity of
  the three cases, making it table-driven.

- In try_rich_to_3way_compare(), test for EQ before LT and GT.  This
  turns out essential when comparing recursive UserList instances;
  with the old code, these would recurse into rich comparison three
  times for each nesting level up to NESTING_LIMIT/2, making the total
  number of calls in the order of 3**(NESTING_LIMIT/2)!

NOTE: I'm not 100% comfortable with this.  It works for the standard
test suite (which compares a few trivial recursive data structures
only), but I'm not sure that the in-progress dictionary is used
properly by the rich comparison code.  Jeremy suggested that maybe the
operation should be included in the dict.  Currently I presume that
objects in the dict are equal unless proven otherwise, and I set the
outcome for the rich comparison accordingly: true for operators EQ,
LE, GE, and false for the other three.  But Jeremy seems to think that
there may be counter-examples where this doesn't do the right thing.

24 years agoFix for bug #129173, reported by Skip Montanaro:
Andrew M. Kuchling [Wed, 17 Jan 2001 20:51:18 +0000 (20:51 +0000)]
Fix for bug #129173, reported by Skip Montanaro:
   Check for the two possible headers for Expat, expat.h and xmlparse.h,
   and only compile the pyexpat module if one of them is found.

24 years agostrop doesn't actually seem to be needed
Andrew M. Kuchling [Wed, 17 Jan 2001 20:21:30 +0000 (20:21 +0000)]
strop doesn't actually seem to be needed

24 years agoUse the extended library search path when looking for readline (simple
Andrew M. Kuchling [Wed, 17 Jan 2001 20:20:44 +0000 (20:20 +0000)]
Use the extended library search path when looking for readline (simple
   oversight in using self.compiler.library_dirs)

24 years agoRestore lost AFMT_S16_NE entry.
Ka-Ping Yee [Wed, 17 Jan 2001 19:31:29 +0000 (19:31 +0000)]
Restore lost AFMT_S16_NE entry.

24 years agoThis patch removes all uses of "assert" in the regression test suite
Marc-André Lemburg [Wed, 17 Jan 2001 19:11:13 +0000 (19:11 +0000)]
This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.

24 years agoStop creating an unbounded number of "Jack is my hero" files under Windows.
Tim Peters [Wed, 17 Jan 2001 18:59:46 +0000 (18:59 +0000)]
Stop creating an unbounded number of "Jack is my hero" files under Windows.
Not that Jack doesn't deserve them, but saying it so often cheapens the
sentiment.

24 years agoPatch #102588 / PEP 229:
Andrew M. Kuchling [Wed, 17 Jan 2001 18:55:13 +0000 (18:55 +0000)]
Patch #102588 / PEP 229:
   The final piece of this change...

   Strip down Setup.config.in and Setup.dist to the minimal sets required
       to get a working Python; setup.py will handle the rest

24 years agoPatch #102588 / PEP 229:
Andrew M. Kuchling [Wed, 17 Jan 2001 18:54:54 +0000 (18:54 +0000)]
Patch #102588 / PEP 229:
   The final piece of this change...

   Run setup.py to build shared modules and to install them.

24 years agoUndoing the whitespace patches which sneaked into the earlier patch.
Marc-André Lemburg [Wed, 17 Jan 2001 18:04:31 +0000 (18:04 +0000)]
Undoing the whitespace patches which sneaked into the earlier patch.

24 years agoThis patch adds a new builtin unistr() which behaves like str()
Marc-André Lemburg [Wed, 17 Jan 2001 17:09:53 +0000 (17:09 +0000)]
This patch adds a new builtin unistr() which behaves like str()
except that it always returns Unicode objects.

A new C API PyObject_Unicode() is also provided.

This closes patch #101664.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.

24 years agoVarious clean-ups:
Andrew M. Kuchling [Wed, 17 Jan 2001 15:59:25 +0000 (15:59 +0000)]
Various clean-ups:
  * Uncomment the xreadlines module
  * The Tcl/Tk detection code doesn't need to worry about pre-8.0 versions
  * Fix some debugging changes (not running ar, a commented-out line)

24 years agoNews item for rich comparisons.
Guido van Rossum [Wed, 17 Jan 2001 15:54:45 +0000 (15:54 +0000)]
News item for rich comparisons.

(I'm going to check in some more uses of rich comparisons, but the
basic feature should be in place now.)

24 years agoUse rich comparisons in min and max.
Guido van Rossum [Wed, 17 Jan 2001 15:47:24 +0000 (15:47 +0000)]
Use rich comparisons in min and max.

24 years agoRich comparisons fall-out:
Guido van Rossum [Wed, 17 Jan 2001 15:42:30 +0000 (15:42 +0000)]
Rich comparisons fall-out:

- Use PyObject_RichCompare*() where possible: when comparing
  keyword arguments, in _PyEval_SliceIndex(), and of course in
  cmp_outcome().

Unrelated stuff:

- Removed all trailing whitespace.

- Folded some long lines.

24 years agoRich comparisons fall-out:
Guido van Rossum [Wed, 17 Jan 2001 15:33:42 +0000 (15:33 +0000)]
Rich comparisons fall-out:

- Get rid of float_cmp().

- Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.

24 years agoRich comparisons fall-out:
Guido van Rossum [Wed, 17 Jan 2001 15:33:18 +0000 (15:33 +0000)]
Rich comparisons fall-out:

- Get rid of long_cmp().

- Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.

24 years agoRich comparisons fall-out:
Guido van Rossum [Wed, 17 Jan 2001 15:32:23 +0000 (15:32 +0000)]
Rich comparisons fall-out:

- Get rid of int_cmp().

- Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.

24 years agoRich comparisons fall-out:
Guido van Rossum [Wed, 17 Jan 2001 15:29:42 +0000 (15:29 +0000)]
Rich comparisons fall-out:

- Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.

- Use PyObject_RichCompareBool() in PySequence_Contains().

24 years agoRich comparisons.
Guido van Rossum [Wed, 17 Jan 2001 15:28:20 +0000 (15:28 +0000)]
Rich comparisons.

- Got rid of instance_cmp(); refactored instance_compare().

- Added instance_richcompare() which calls __lt__() etc.

Some unrelated stuff mixed in:

- Aligned comments in various large struct initializers.

- Better test to avoid recursion if __coerce__ returns self as the
  first argument (this is an unrelated fix by Neil Schemenauer!).

- Style nit: don't use Py_DECREF(Py_NotImplemented); use
  Py_DECREF(result) -- it just looks better. :-)

24 years agoPatch #102588 / PEP 229:
Andrew M. Kuchling [Wed, 17 Jan 2001 15:24:57 +0000 (15:24 +0000)]
Patch #102588 / PEP 229:
    Tweak the configure script to build setup.cfg

24 years agoRich comparisons. Refactored internal routine do_cmp() and added APIs
Guido van Rossum [Wed, 17 Jan 2001 15:24:28 +0000 (15:24 +0000)]
Rich comparisons.  Refactored internal routine do_cmp() and added APIs
PyObject_RichCompare() and PyObject_RichCompareBool().

XXX Note: the code that checks for deeply nested rich comparisons is
bogus -- it assumes the two objects are always identical, rather than
using the same logic as PyObject_Compare().  I'll fix that later.

24 years ago[Patch #102588/PEP 229]:
Andrew M. Kuchling [Wed, 17 Jan 2001 15:23:23 +0000 (15:23 +0000)]
[Patch #102588/PEP 229]:
   Check in the setup.py script, and the setup.cfg.in file, which
   handle compiling and installing as many extension modules as possible

24 years agoRich comparisons: ensure that LT == Py_LT, etc.
Guido van Rossum [Wed, 17 Jan 2001 15:21:09 +0000 (15:21 +0000)]
Rich comparisons: ensure that LT == Py_LT, etc.

24 years agoIntroduction to rich comparisons:
Guido van Rossum [Wed, 17 Jan 2001 15:20:39 +0000 (15:20 +0000)]
Introduction to rich comparisons:

- Removed the nb_add slot from the PyNumberMethods struct.

- Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.

- Added typedef richcmpfunc.

- Added tp_richcompare slot to PyTypeObject (replacing spare tp_xxx7).

- Added APIs PyObject_RichCompare() and PyObject_RichCompareBool().

- Added rich comparison operators Py_LT through Py_GE.

24 years agoPatch #103279: sysconfig.py always looks for versions of files in
Andrew M. Kuchling [Wed, 17 Jan 2001 15:16:52 +0000 (15:16 +0000)]
Patch #103279: sysconfig.py always looks for versions of files in
sys.prefix + 'config/Makefile'. When building Python for the first
time, these files aren't there, so the files from the build tree have
to be used instead; this file adds an entry point for specifying that
the build tree files should be used.  (Perhaps 'set_python_build' should
should be preceded with an underscore?)

24 years agoFix a bizarre typo in the helper class ComparableException: the
Guido van Rossum [Wed, 17 Jan 2001 15:08:37 +0000 (15:08 +0000)]
Fix a bizarre typo in the helper class ComparableException: the
__getattr__() method, which clearly (like the other methods) was
intended to pass the __getattr__() call on to the self.err object,
mistakenly returned getattr(self, self.err) rather than
getattr(self.err, attr).  Since self.err is not a string, this always
raises a TypeError.  Apparently that doesn't bother for the one
attribute for which __getattr__() is actually called ('__coerce__'),
but it broke the rich comparisons stuff that I'm trying to get into
shape, so I'm fixing this now.  (I could also simply remove the
__getattr__() method, but fixing it seems more in the spirit of what
the ComparableException class is trying to do.)

24 years agoChanged name of codec to full path name. This allows importing
Marc-André Lemburg [Wed, 17 Jan 2001 15:07:00 +0000 (15:07 +0000)]
Changed name of codec to full path name. This allows importing
the test_charmapcodec test via the test package.

24 years agoBump version to 2.1a1. (To be released Friday.)
Guido van Rossum [Wed, 17 Jan 2001 14:12:33 +0000 (14:12 +0000)]
Bump version to 2.1a1.  (To be released Friday.)

24 years agoFixed typo: Using --with-dbm had no effect because due to a typo it
Sjoerd Mullender [Wed, 17 Jan 2001 09:42:21 +0000 (09:42 +0000)]
Fixed typo: Using --with-dbm had no effect because due to a typo it
was never enabled.

24 years agoHand repair of cases where reindent changed lines of the form
Tim Peters [Wed, 17 Jan 2001 09:13:33 +0000 (09:13 +0000)]
Hand repair of cases where reindent changed lines of the form

\t\t\t\t\treal code
##\t\t\t\t\tunused code
\t\t\t\t\treal code

via untabifying and shifting the real code left.  Semantically the
same but made the intent of the commented-out-in-column-0 unused code
unclear.  The exact same unused code appears to have gotten copied from
file to file over the years.

24 years agoWindows installer: update dialogs, program groups, etc, to 2.1 alpha 1.
Tim Peters [Wed, 17 Jan 2001 08:54:19 +0000 (08:54 +0000)]
Windows installer:  update dialogs, program groups, etc, to 2.1 alpha 1.

24 years agoWhitespace normalization.
Tim Peters [Wed, 17 Jan 2001 08:48:39 +0000 (08:48 +0000)]
Whitespace normalization.

24 years agoEric the half-a-wit, driven to berserk rage after repeatedly doing
Eric S. Raymond [Wed, 17 Jan 2001 08:25:11 +0000 (08:25 +0000)]
Eric the half-a-wit, driven to berserk rage after repeatedly doing
builds during which he forgot to uncomment crucial library lines in
Setup, walks into Guido's East End nightclub with a tactical nuclear
weapon on his shoulder.  Said nuclear weapon is promptly deployed
exactly where it will do the most good, right in the middle of
configure.in.

With this patch, the set of libraries autoconfigured in is extended to
include ndbm, gdbm, and crypt.  This essentially eliminates any need to
tweak Setup for a normal Linux build.

"'E was a fair man.  Cruel, but fair."

24 years agoAdd a missing newline in an example; caught by Chris Ryland
Fred Drake [Wed, 17 Jan 2001 05:12:13 +0000 (05:12 +0000)]
Add a missing newline in an example; caught by Chris Ryland
<cpr@emsoftware.com>.

24 years agoUse __name__ instead of "test_regex" as the module name in the
Guido van Rossum [Wed, 17 Jan 2001 03:12:01 +0000 (03:12 +0000)]
Use __name__ instead of "test_regex" as the module name in the
warnings.filterwarnings() call.  This suppresses the warning when the
module is imported with its full name (test.test_regex) too.

24 years agoDocument xreadlines() method. (Forgot to check this in before!)
Guido van Rossum [Wed, 17 Jan 2001 01:18:00 +0000 (01:18 +0000)]
Document xreadlines() method.  (Forgot to check this in before!)

24 years agoRationalizing the fallback code for portable fseek -- this is all much
Guido van Rossum [Tue, 16 Jan 2001 20:53:31 +0000 (20:53 +0000)]
Rationalizing the fallback code for portable fseek -- this is all much
simpler if we use fgetpos and fsetpos, rather than trying to mess with
platform-specific TELL64 alternatives.

Of course, this hasn't been tested on a 64-bit platform, so I may have
to withdraw this -- but I'm hopeful, and Trent Mick supports this
patch!

24 years agoFix a few small markup/consistency nits.
Fred Drake [Tue, 16 Jan 2001 20:52:41 +0000 (20:52 +0000)]
Fix a few small markup/consistency nits.

24 years agoFix bugs with integer-valued variables when parsing Makefiles. Values
Andrew M. Kuchling [Tue, 16 Jan 2001 16:33:28 +0000 (16:33 +0000)]
Fix bugs with integer-valued variables when parsing Makefiles.  Values
for done[n] can be integers as well as strings, but the code
concatenates them with strings (fixed by adding a str()) and calls
string.strip() on them (fixed by rearranging the logic)

(Presumably this wasn't noticed previously because parse_makefile()
was only called on Modules/Makefile, which contains no integer-valued
variables.)

24 years agoModified version of a patch from Jeremy Kloth, to make .get_outputs()
Andrew M. Kuchling [Tue, 16 Jan 2001 16:16:03 +0000 (16:16 +0000)]
Modified version of a patch from Jeremy Kloth, to make .get_outputs()
produce a list of unique filenames:
    "While attempting to build an RPM using distutils on Python 2.0,
    rpm complained about duplicate files.  The following patch fixed
    that problem.

24 years agoTrigger keep-console-open on GUSISIOUX_STATE_UNKNOWN. Better than the previous compli...
Jack Jansen [Tue, 16 Jan 2001 15:54:58 +0000 (15:54 +0000)]
Trigger keep-console-open on GUSISIOUX_STATE_UNKNOWN. Better than the previous complicated expression.

24 years agoConfig file for standalone carbon python.
Jack Jansen [Tue, 16 Jan 2001 15:51:24 +0000 (15:51 +0000)]
Config file for standalone carbon python.

24 years agoAdded Carbon interpreter.
Jack Jansen [Tue, 16 Jan 2001 15:50:48 +0000 (15:50 +0000)]
Added Carbon interpreter.

24 years agoCommit version of config.h.in that covers the TERMIOS test.
Eric S. Raymond [Tue, 16 Jan 2001 15:32:53 +0000 (15:32 +0000)]
Commit version of config.h.in that covers the TERMIOS test.

24 years agoCheck in a version with the termios test in place.
Eric S. Raymond [Tue, 16 Jan 2001 15:26:34 +0000 (15:26 +0000)]
Check in a version with the termios test in place.

24 years agoMake pop_source and push_source available, as documented.
Eric S. Raymond [Tue, 16 Jan 2001 15:19:13 +0000 (15:19 +0000)]
Make pop_source and push_source available, as documented.

24 years agoMake HAVE_TERMIOS_H and associated config.sh shell variable available
Eric S. Raymond [Tue, 16 Jan 2001 15:01:26 +0000 (15:01 +0000)]
Make HAVE_TERMIOS_H and associated config.sh shell variable available
when configure detects the presence of termios.h; later we'll use this
for correct configuration of edline/readline.

Also, fix a bug in acconfig.h -- somebody forgot to add an undef to
cover the LIBNDBM configure symbol, which was preventing autoheader
from working properly.

24 years agoConverted to CW Pro 6 and new naming scheme.
Jack Jansen [Tue, 16 Jan 2001 14:24:56 +0000 (14:24 +0000)]
Converted to CW Pro 6 and new naming scheme.

24 years agopush_source() and pop_source() entry points for shlex instances.
Eric S. Raymond [Tue, 16 Jan 2001 14:18:55 +0000 (14:18 +0000)]
push_source() and pop_source() entry points for shlex instances.
These basically just make available to the user what userhook()
does to the source stack.  Documentation included.

24 years agoAdded the 'carb' resource to the carbon interpreter.
Jack Jansen [Tue, 16 Jan 2001 13:01:48 +0000 (13:01 +0000)]
Added the 'carb' resource to the carbon interpreter.

24 years agoReplaced the single .exp file by two files, one for classic and one for carbon.
Jack Jansen [Tue, 16 Jan 2001 13:01:11 +0000 (13:01 +0000)]
Replaced the single .exp file by two files, one for classic and one for carbon.

24 years agoAdded checks to prevent PyUnicode_Count() from dumping core
Marc-André Lemburg [Tue, 16 Jan 2001 11:54:12 +0000 (11:54 +0000)]
Added checks to prevent PyUnicode_Count() from dumping core
in case the parameters are out of bounds and fixes error handling
for .count(), .startswith() and .endswith() for the case of
mixed string/Unicode objects.

This patch adds Python style index semantics to PyUnicode_Count()
indices (including the special handling of negative indices).

The patch is an extended version of patch #103249 submitted
by Michael Hudson (mwh) on SF. It also includes new test cases.

24 years agobumped SRE version number to 2.1. cleaned up and added 1.5.2
Fredrik Lundh [Tue, 16 Jan 2001 07:37:30 +0000 (07:37 +0000)]
bumped SRE version number to 2.1.  cleaned up and added 1.5.2
compatibility patches.

24 years agoWhitespace normalization.
Tim Peters [Tue, 16 Jan 2001 07:12:46 +0000 (07:12 +0000)]
Whitespace normalization.

24 years agodoctest-- The Little Module That Could --finally makes it to the Big Show <wink>.
Tim Peters [Tue, 16 Jan 2001 07:10:57 +0000 (07:10 +0000)]
doctest-- The Little Module That Could --finally makes it to the Big Show <wink>.

24 years agofixed a memory leak in pattern cleanup (patch #103248 by cgw)
Fredrik Lundh [Tue, 16 Jan 2001 07:05:29 +0000 (07:05 +0000)]
fixed a memory leak in pattern cleanup (patch #103248 by cgw)