]> granicus.if.org Git - python/log
python
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)

24 years agoFix for SF bug #123625: some newsservers need 'authinfo' *before* 'mode
Thomas Wouters [Tue, 16 Jan 2001 06:35:14 +0000 (06:35 +0000)]
Fix for SF bug #123625: some newsservers need 'authinfo' *before* 'mode
readers', others *after*. (Netscape Collabra for the first category,
INN-which-forks-nnrpd for the second.)

24 years agoPlug memory leak.
Neil Schemenauer [Tue, 16 Jan 2001 04:27:47 +0000 (04:27 +0000)]
Plug memory leak.

24 years agoAdd strip_dir argument to the single call to .object_filenames(), to
Andrew M. Kuchling [Tue, 16 Jan 2001 03:10:43 +0000 (03:10 +0000)]
Add strip_dir argument to the single call to .object_filenames(), to
    prevent creating files such as build/lib.whatever/Modules/foo.o
    when given a source filename such as Modules/foo.c.

24 years agoVariant of Skip's patch 103246 (Remove unneeded string exception compat from Queue).
Tim Peters [Mon, 15 Jan 2001 22:53:46 +0000 (22:53 +0000)]
Variant of Skip's patch 103246 (Remove unneeded string exception compat from Queue).

24 years agoUgh. Sorry. Checked in the wrong file. Please ignore revision 1.3;
Ka-Ping Yee [Mon, 15 Jan 2001 22:27:06 +0000 (22:27 +0000)]
Ugh.  Sorry.  Checked in the wrong file.  Please ignore revision 1.3;
it anticipates another patch i was about to propose.

24 years agobetter format names and error messages
Ka-Ping Yee [Mon, 15 Jan 2001 22:21:39 +0000 (22:21 +0000)]
better format names and error messages

24 years agoThis patch makes sure that the function name always appears in the error
Ka-Ping Yee [Mon, 15 Jan 2001 22:14:16 +0000 (22:14 +0000)]
This patch makes sure that the function name always appears in the error
message, and tries to make the messages more consistent and helpful when
the wrong number of arguments or duplicate keyword arguments are supplied.
Comes with more tests for test_extcall.py and and an update to an error
message in test/output/test_pyexpat.

24 years agoAdd tokenizer support and tests for u'', U"", uR'', Ur"", etc.
Ka-Ping Yee [Mon, 15 Jan 2001 22:04:30 +0000 (22:04 +0000)]
Add tokenizer support and tests for u'', U"", uR'', Ur"", etc.

24 years agoAdd a test case suggested by Guido, where a method is created with the
Barry Warsaw [Mon, 15 Jan 2001 21:00:02 +0000 (21:00 +0000)]
Add a test case suggested by Guido, where a method is created with the
new module.

24 years agoeffbot caught a typo!
Barry Warsaw [Mon, 15 Jan 2001 20:51:40 +0000 (20:51 +0000)]
effbot caught a typo!

24 years agoAdd a NEWS item about function attributes.
Barry Warsaw [Mon, 15 Jan 2001 20:43:18 +0000 (20:43 +0000)]
Add a NEWS item about function attributes.

24 years agoCommitting PEP 232, function attribute feature, approved by Guido.
Barry Warsaw [Mon, 15 Jan 2001 20:40:19 +0000 (20:40 +0000)]
Committing PEP 232, function attribute feature, approved by Guido.
Closes SF patch #103123.

funcobject.h:

    PyFunctionObject: add the func_dict slot.

funcobject.c:

    PyFunction_New(): Initialize the func_dict slot to NULL.

    func_getattr(): Rename to func_getattro() and change the
    signature.  It's more efficient to use attro methods and dig the C
    string out than it is to re-convert a C string to a PyString.

    Also, add support for getting the __dict__ (a.k.a. func_dict)
    attribute, and for getting an arbitrary function attribute.

    func_setattr(): Rename to func_setattro() and change the signature
    for the same reason.  Also add support for setting __dict__
    (a.k.a. func_dict) and any arbitrary function attribute.

    func_dealloc(): Be sure to DECREF the func_dict slot.

    func_traverse(): Be sure to traverse func_dict too.

    PyFunction_Type: make the necessary func_?etattro() changes.

classobject.c:

    instancemethod_memberlist: Add __dict__

    instancemethod_setattro(): New method to set arbitrary attributes
    on methods (really the underlying im_func).  Raise TypeError when
    the instance is bound or when you're trying to set one of the
    reserved im_* attributes.

    instancemethod_getattr(): Renamed to instancemethod_getattro()
    since that's what it really is.  Also, added support fo getting
    arbitrary attributes through the im_func.

    PyMethod_Type: Do the ?etattr{,o} dance.

24 years agoCommitting PEP 232, function attribute feature, approved by Guido.
Barry Warsaw [Mon, 15 Jan 2001 20:30:15 +0000 (20:30 +0000)]
Committing PEP 232, function attribute feature, approved by Guido.
Closes SF patch #103123.

Regression test for function attributes, with output file.

24 years agoDocument function attributes for both the function type and the method
Barry Warsaw [Mon, 15 Jan 2001 20:28:50 +0000 (20:28 +0000)]
Document function attributes for both the function type and the method
type.  The method documentation also includes a new brief discussion
of `bound' vs. `unbound' and why setting an attr on a bound method is
a TypeError.  Includes Skip's suggested text.

24 years agoAdd note about new and improved xrange().
Guido van Rossum [Mon, 15 Jan 2001 19:11:10 +0000 (19:11 +0000)]
Add note about new and improved xrange().

24 years agoSF patch #103158 by Greg Ball: Don't do unsafe arithmetic in xrange
Guido van Rossum [Mon, 15 Jan 2001 18:58:56 +0000 (18:58 +0000)]
SF patch #103158 by Greg Ball: Don't do unsafe arithmetic in xrange
object.

This fixes potential overflows in xrange()'s internal calculations on
64-bit platforms.  The fix is complicated because the sq_length slot
function can only return an int; we want to support
xrange(sys.maxint), which is a 64-bit quantity on most 64-bit
platforms (except Win64).  The solution is hacky but the best
possible: when the range is that long, we can use it in a for loop but
we can't ask for its length (nor can we actually iterate beyond
2**31-1, because the sq_item slot function has the same restrictions
on its arguments.  Fixing those restrictions is a project for another
day...

24 years ago- Make sure to quote the username and password (SF patch #103236 by
Guido van Rossum [Mon, 15 Jan 2001 18:31:13 +0000 (18:31 +0000)]
- Make sure to quote the username and password (SF patch #103236 by
  dogfort).

- Don't drop the data argument when calling open_https() from the
  authentication error handler.