]> granicus.if.org Git - python/log
python
24 years agoTreat an empty kwdict argument the same as a missing one.
Jack Jansen [Fri, 19 Jan 2001 23:46:28 +0000 (23:46 +0000)]
Treat an empty kwdict argument the same as a missing one.

24 years agoUndefine and redefine PRAGMA_ALIGN_SUPPORTED under Carbon. Apple's "solution" of...
Jack Jansen [Fri, 19 Jan 2001 23:45:57 +0000 (23:45 +0000)]
Undefine and redefine PRAGMA_ALIGN_SUPPORTED under Carbon. Apple's "solution" of a funny define makes portable code impossible:-(

24 years agoUse #if TARGET_API_MAC_CARBON to determine carbon/classic macos, not #ifdef.
Jack Jansen [Fri, 19 Jan 2001 23:34:06 +0000 (23:34 +0000)]
Use #if TARGET_API_MAC_CARBON to determine carbon/classic macos, not #ifdef.

24 years agoMake the 'time' argument to the timemodule functions strftime, asctime,
Thomas Wouters [Fri, 19 Jan 2001 23:16:56 +0000 (23:16 +0000)]
Make the 'time' argument to the timemodule functions strftime, asctime,
ctime, gmtime and localtime optional, defaulting to 'the current time' in
all cases. Adjust docs, add news item. Also convert all argument-handling to
METH_VARARGS. Closes SF patch #103265.

24 years agoFixed a bunch of typos caught by Gilles Civario.
Fred Drake [Fri, 19 Jan 2001 22:48:33 +0000 (22:48 +0000)]
Fixed a bunch of typos caught by Gilles Civario.

24 years agoClarify comments about returning None using a return without an expression;
Fred Drake [Fri, 19 Jan 2001 22:34:59 +0000 (22:34 +0000)]
Clarify comments about returning None using a return without an expression;
this is not hard to explain!

Closes SF bug #129345.

24 years agoNow that Marc-Andre has retracted unistr(), remove the tests.
Guido van Rossum [Fri, 19 Jan 2001 21:57:52 +0000 (21:57 +0000)]
Now that Marc-Andre has retracted unistr(), remove the tests.

24 years agoA hack to augment sys.path with the build/lib.<platform> directory
Guido van Rossum [Fri, 19 Jan 2001 21:54:59 +0000 (21:54 +0000)]
A hack to augment sys.path with the build/lib.<platform> directory
created by Andrew's setup.py script, *if* we're actually running from
the build directory.  (The test for that: whether the sys.path[-1]
ends in "/Modules".)

This has one disadvantage: it imports a fair amount of code from the
distutils package, just in order to be able to calculate the correct
pathname.  See if I care. :-)

24 years agoRun tests twice by default, first time deleting .pyc/.pyo files.
Tim Peters [Fri, 19 Jan 2001 21:43:49 +0000 (21:43 +0000)]
Run tests twice by default, first time deleting .pyc/.pyo files.
New option "-q" to leave .pyc/.pyo alone.

24 years agoBacked out the unistr() builtin.
Marc-André Lemburg [Fri, 19 Jan 2001 21:36:19 +0000 (21:36 +0000)]
Backed out the unistr() builtin.

24 years agoUse a saner test filename, to work on Windows.
Guido van Rossum [Fri, 19 Jan 2001 21:06:50 +0000 (21:06 +0000)]
Use a saner test filename, to work on Windows.

24 years agoDelete the bytecode from the library and tests before running the
Guido van Rossum [Fri, 19 Jan 2001 21:00:04 +0000 (21:00 +0000)]
Delete the bytecode from the library and tests before running the
tests for the first time -- like the Unix Makefile does.  This
avoids not catching problems in the bytecode generator and/or bytecode
marshalling.

24 years ago"make test" was still broken when building in a subdirectory: Andrew's
Guido van Rossum [Fri, 19 Jan 2001 20:21:59 +0000 (20:21 +0000)]
"make test" was still broken when building in a subdirectory: Andrew's
fix set PYTHONPATH to something starting with $(srcdir)/build/lib....
The use of $(srcdir) was wrong here, it should be ./build/lib...

24 years agoOK, checking in patch 103329.
Moshe Zadka [Fri, 19 Jan 2001 19:56:27 +0000 (19:56 +0000)]
OK, checking in patch 103329.
Please check it against your nearest pop server --
mine doesn't support APOP (I checked I'm getting the same error
message, though)

24 years agoAdd some regression tests of coredump bugs in funcobject.c 2.31. Also
Barry Warsaw [Fri, 19 Jan 2001 19:55:12 +0000 (19:55 +0000)]
Add some regression tests of coredump bugs in funcobject.c 2.31.  Also
added a test of a coredump that would occur when del'ing
func_defaults (put here for convenience).

24 years agoApplication and elaboration of patch #103305 to fix core dumps when
Barry Warsaw [Fri, 19 Jan 2001 19:53:29 +0000 (19:53 +0000)]
Application and elaboration of patch #103305 to fix core dumps when
del'ing func.func_dict.  I took the opportunity to also clean up some
other nits with the code, namely core dumps when del'ing func_defaults
and KeyError instead of AttributeError when del'ing a non-existant
function attribute.

Specifically,

func_memberlist: Move func_dict and __dict__ into here instead of
special casing them in the setattro and getattro methods.  I don't
remember why I took them out of here before I first uploaded the PEP
232 patch. :/

func_getattro(): No need to special case __dict__/func_dict since
their now in the func_memberlist and PyMember_Get() should Do The
Right Thing (i.e. transforms NULL values into Py_None).

func_setattro(): Document the intended behavior of del'ing or setting
to None one of the special func_* attributes.  I.e.:

    func_code - can only be set to a code object.  It can't be del'd
    or set to None.

    func_defaults - can be del'd.  Can only be set to None or a tuple.

    func_dict - can be del'd.  Can only be set to None or a
    dictionary.

Fix core dumps and incorrect exceptions as described above.  Also, if
we're del'ing an arbitrary function attribute but func_dict is NULL,
don't create func_dict before discovering that we'll get an
AttributeError anyway.

24 years agogethash/cmpname both looked beyond the end of the character name.
Fredrik Lundh [Fri, 19 Jan 2001 19:45:02 +0000 (19:45 +0000)]
gethash/cmpname both looked beyond the end of the character name.
This patch makes u"\N{x}" a bit less dependent on pure luck...

24 years agoRepair "selective cut-&-paste" screwup.
Tim Peters [Fri, 19 Jan 2001 19:17:46 +0000 (19:17 +0000)]
Repair "selective cut-&-paste" screwup.

24 years agoChange verify() function to raise TestFailed, not AssertionError.
Guido van Rossum [Fri, 19 Jan 2001 19:01:56 +0000 (19:01 +0000)]
Change verify() function to raise TestFailed, not AssertionError.

(I realize that I didn't really test this, because all the tests
succeed, so verify() never raised an AssertionError -- but the test
suite still succeeds, so I'm not too worried.)

24 years agoGvR pointed out the correct way to check for statically built modules;
Andrew M. Kuchling [Fri, 19 Jan 2001 16:58:21 +0000 (16:58 +0000)]
GvR pointed out the correct way to check for statically built modules;
    sys.builtin_module_names
Add SSL directories in /usr/contrib/ for FreeBSD

24 years agoBump __version__; add authorship note for the BaseServer patch.
Guido van Rossum [Fri, 19 Jan 2001 16:45:46 +0000 (16:45 +0000)]
Bump __version__; add authorship note for the BaseServer patch.

24 years agoAdd Jason Tishler to the ACKS file
Andrew M. Kuchling [Fri, 19 Jan 2001 16:29:28 +0000 (16:29 +0000)]
Add Jason Tishler to the ACKS file

24 years agoPatch #103220 from Jason Tishler:
Andrew M. Kuchling [Fri, 19 Jan 2001 16:26:12 +0000 (16:26 +0000)]
Patch #103220 from Jason Tishler:
  This patch adds support for Cygwin to util.get_platform(). A Cygwin
  specific case is needed due to the format of Cygwin's uname command,
  which contains '/' characters.

24 years agoMinor patch from Thomas Gellekum:
Andrew M. Kuchling [Fri, 19 Jan 2001 15:35:26 +0000 (15:35 +0000)]
Minor patch from Thomas Gellekum:
   * Deletes the Panel_NoArgReturnStringFunction() macro, which isn't used
     anymore
   * Adjusts two comments.

24 years agonew unicode name database (~160k)
Fredrik Lundh [Fri, 19 Jan 2001 11:52:33 +0000 (11:52 +0000)]
new unicode name database (~160k)

24 years agoimproved the ucnhash test a bit
Fredrik Lundh [Fri, 19 Jan 2001 11:13:46 +0000 (11:13 +0000)]
improved the ucnhash test a bit

24 years agoadded "getcode" and "getname" methods to the ucnhash module (they're
Fredrik Lundh [Fri, 19 Jan 2001 11:00:42 +0000 (11:00 +0000)]
added "getcode" and "getname" methods to the ucnhash module (they're
probably more useful for the test code than for any applications, but
one never knows...)

24 years agoColor all word instances of "as" after "import", & on the same line, as if
Tim Peters [Fri, 19 Jan 2001 10:41:49 +0000 (10:41 +0000)]
Color all word instances of "as" after "import", & on the same line, as if
keywords.  Cheap approximation to the truth.

24 years agorefactored the unicodeobject/ucnhash interface, to hide the
Fredrik Lundh [Fri, 19 Jan 2001 09:45:02 +0000 (09:45 +0000)]
refactored the unicodeobject/ucnhash interface, to hide the
implementation details inside the ucnhash module.

also cleaned up the unicode copyright blurb a little; Secret Labs'
internal revision history isn't that interesting...

24 years agoUpdate the example DLL instructions for 2.1. Add example.def to the
Tim Peters [Fri, 19 Jan 2001 08:45:48 +0000 (08:45 +0000)]
Update the example DLL instructions for 2.1.  Add example.def to the
MSVC project file (as the instructions always recommended doing).

24 years agourllib.py very recently changed to produce uppercase escapes, but no
Tim Peters [Fri, 19 Jan 2001 07:00:08 +0000 (07:00 +0000)]
urllib.py very recently changed to produce uppercase escapes, but no
corresponding changes were made to its std test.

24 years agoWhitespace normalization.
Tim Peters [Fri, 19 Jan 2001 06:12:17 +0000 (06:12 +0000)]
Whitespace normalization.

24 years agotest_urllib is failing on Windows. I don't know why, but I can at least
Tim Peters [Fri, 19 Jan 2001 06:06:37 +0000 (06:06 +0000)]
test_urllib is failing on Windows.  I don't know why, but I can at least
change the test to give a clue about *where* it's failing.

24 years agoUse constructor form of "raise"; normalize <wink> docstrings.
Tim Peters [Fri, 19 Jan 2001 05:59:21 +0000 (05:59 +0000)]
Use constructor form of "raise"; normalize <wink> docstrings.

24 years agoJeremy's patch #103323: trivial tests of all untested modules.
Tim Peters [Fri, 19 Jan 2001 05:41:36 +0000 (05:41 +0000)]
Jeremy's patch #103323:  trivial tests of all untested modules.

24 years agoThis still mentioned IdlePrefs.py as the place to edit color
Guido van Rossum [Fri, 19 Jan 2001 03:30:58 +0000 (03:30 +0000)]
This still mentioned IdlePrefs.py as the place to edit color
preferences.  It is now in config.txt or ~/.idle.

24 years agomake the output of _test() suitable for use in the regression test
Jeremy Hylton [Fri, 19 Jan 2001 03:30:22 +0000 (03:30 +0000)]
make the output of _test() suitable for use in the regression test

24 years agoAnonymous SF bug 129288: "The python 2.0 urllib has %%%x as a format
Guido van Rossum [Fri, 19 Jan 2001 03:28:15 +0000 (03:28 +0000)]
Anonymous SF bug 129288: "The python 2.0 urllib has %%%x as a format
when quoting forbidden characters. There are scripts out there that
break with lower case, therefore I guess %%%X should be used."

I agree, so am fixing this.

24 years agomake error msg more informative when test of exec fails
Jeremy Hylton [Fri, 19 Jan 2001 03:26:33 +0000 (03:26 +0000)]
make error msg more informative when test of exec fails

24 years agoadd test for SyntaxError on
Jeremy Hylton [Fri, 19 Jan 2001 03:25:56 +0000 (03:25 +0000)]
add test for SyntaxError on
    def f(a):
        global a

24 years agoclearer error messages for apply() and "no locals"
Jeremy Hylton [Fri, 19 Jan 2001 03:25:05 +0000 (03:25 +0000)]
clearer error messages for apply() and "no locals"

24 years agoadd test of bastion and rexec to std regression test suite
Jeremy Hylton [Fri, 19 Jan 2001 03:22:48 +0000 (03:22 +0000)]
add test of bastion and rexec to std regression test suite

24 years agoThis patch introduces an extra pass to the compiler that generates a
Jeremy Hylton [Fri, 19 Jan 2001 03:21:30 +0000 (03:21 +0000)]
This patch introduces an extra pass to the compiler that generates a
symbol table for each top-level compilation unit.  The information in
the symbol table allows the elimination of the later optimize() pass;
the bytecode generation emits the correct opcodes.

The current version passes the complete regression test, but may still
contain some bugs.  It's a fairly substantial revision.  The current
code adds an assert() and a test that may lead to a Py_FatalError().
I expect to remove these before 2.1 beta 1.

The symbol table (struct symtable) is described in comments in the
code.

The changes affects the several com_XXX() functions that were used to
emit LOAD_NAME and its ilk.  The primary interface for this bytecode
is now com_addop_varname() which takes a kind and a name, where kind
is one of VAR_LOAD, VAR_STORE, or VAR_DELETE.

There are many other smaller changes:

- The name mangling code is no longer contained in ifdefs.  There are
  two functions that expose the mangling logical: com_mangle() and
  symtable_mangle().

- The com_error() function can accept NULL for its first argument;
  this is useful with is_constant_false() is called during symbol
  table generation.

- The loop index names used by list comprehensions have been changed
  from __1__ to [1], so that they can not be accessed by Python code.

- in com_funcdef(), com_argdefs() is now called before the body of the
  function is compiled.  This provides consistency with com_lambdef()
  and symtable_funcdef().

- Helpers do_pad(), dump(), and DUMP() are added to aid in debugging
  the compiler.

24 years agoDerivative of patch #102549, "simpler, faster(!) implementation of string.join".
Tim Peters [Fri, 19 Jan 2001 03:03:47 +0000 (03:03 +0000)]
Derivative of patch #102549, "simpler, faster(!) implementation of string.join".
Also fixes two long-standing bugs (present in 2.0):
1. .join() didn't check that the result size fit in an int.
2. string.join(s) when len(s)==1 returned s[0] regardless of s[0]'s
   type; e.g., "".join([3]) returned 3 (overly optimistic optimization).
I resisted a keen temptation to make .join() apply str() automagically.

24 years agoRevert a single line of my large change earlier today; this broke the ability
Andrew M. Kuchling [Fri, 19 Jan 2001 02:50:34 +0000 (02:50 +0000)]
Revert a single line of my large change earlier today; this broke the ability
    to build in a subdirectory.  The additional directory is unfortunately
    redundant when *not* building in a subdirectory, which is why I took
    it out.

24 years agoChecking in a slight variation of Barry's patch 103303.
Guido van Rossum [Fri, 19 Jan 2001 02:41:41 +0000 (02:41 +0000)]
Checking in a slight variation of Barry's patch 103303.

24 years agoFix for the bug in complex() just reported by Ping.
Guido van Rossum [Fri, 19 Jan 2001 02:11:59 +0000 (02:11 +0000)]
Fix for the bug in complex() just reported by Ping.

24 years agoSF Patch #102980, by Luke Kenneth Casson Leighton: BaseServer class
Guido van Rossum [Fri, 19 Jan 2001 00:44:41 +0000 (00:44 +0000)]
SF Patch #102980, by Luke Kenneth Casson Leighton: BaseServer class
for SocketServer.py (inherited by TCPServer)

Luke wrote:

  The socketserver code, with a little bit of tweaking, can be made
  sufficiently general to service "requests" of any kind, not just by sockets.
  The BaseServer class was created, for example, to poll a table in a MYSQL
  database every 2 seconds. each entry in the table can be allocated a
  Handler which deals with the entry.

  With this patch, using BaseServer and ThreadedServer classes, the creation
  of the server that reads and handles MySQL table entries instead of a
  socket was utterly trivial: about 50 lines of python code.

  You may consider this code to be utterly useless [why would anyone else
  want to do anything like this???] - you are entitled to your opinion. if you
  think so, then think of this: have you considered how to cleanly add SSL to
  the TCPSocketServer? What about using shared memory as the
  communications mechanism for a server, instead of sockets? What about
  communication using files?

  The SocketServer code is extremely good every useful. it's just that as it
  stands, it is tied to sockets, which is not as useful.

I heartily approve of this idea.

24 years agoSF Patch #103188, by Donn Cave: BeOS/ar-fake support for extra
Guido van Rossum [Fri, 19 Jan 2001 00:31:10 +0000 (00:31 +0000)]
SF Patch #103188, by Donn Cave: BeOS/ar-fake support for extra
libraries.

(I have no way to test this, I just trust Donn.)

24 years agoSF Patch #103185, by jlt63: Some more standard modules cleanup for Cygwin
Guido van Rossum [Fri, 19 Jan 2001 00:29:06 +0000 (00:29 +0000)]
SF Patch #103185, by jlt63: Some more standard modules cleanup for Cygwin

Support building this as a DLL under Cygwin.

24 years agoSupport building this as a DLL under Cygwin.
Guido van Rossum [Fri, 19 Jan 2001 00:28:08 +0000 (00:28 +0000)]
Support building this as a DLL under Cygwin.

24 years agoSF Patch #103250, by pj99: Optimize a strspn() out of startup.
Guido van Rossum [Fri, 19 Jan 2001 00:24:06 +0000 (00:24 +0000)]
SF Patch #103250, by pj99: Optimize a strspn() out of startup.

Minor startup speedup: avoid a call to strspn().

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.