]> granicus.if.org Git - python/log
python
22 years agoDocumented os.fsync and os.fdatasync. Closes SF bug 584695.
Raymond Hettinger [Wed, 7 Aug 2002 15:48:17 +0000 (15:48 +0000)]
Documented os.fsync and os.fdatasync.  Closes SF bug 584695.

22 years ago"Unbuffered" mode of class _fileobject wasn't actually unbuffered,
Guido van Rossum [Wed, 7 Aug 2002 15:46:19 +0000 (15:46 +0000)]
"Unbuffered" mode of class _fileobject wasn't actually unbuffered,
and this broke a Zope "pipelining" test which read multiple responses
from the same connection (this attaches a new file object to the
socket for each response).  Added a test for this too.

(I want to do some code cleanup too, but I thought I'd first fix
the problem with as little code as possible, and add a unit test
for this case.  So that's what this checkin is about.)

22 years ago- If an OSA identifier is a Python reserved word we now append an _
Jack Jansen [Wed, 7 Aug 2002 15:44:53 +0000 (15:44 +0000)]
- If an OSA identifier is a Python reserved word we now append an _
  in stead of prepending it, which messes up "import * from".
- A few ascii()s added again.
- Changed the getbaseclasses a little, but it still isn't perfect.

22 years agoClarify that the bool instances are acceptable return values from
Fred Drake [Wed, 7 Aug 2002 15:40:15 +0000 (15:40 +0000)]
Clarify that the bool instances are acceptable return values from
__nonzero__(), in response to SF bug #579991.

22 years agoUse Py_FatalError instead of abort.
Martin v. Löwis [Wed, 7 Aug 2002 15:18:57 +0000 (15:18 +0000)]
Use Py_FatalError instead of abort.

22 years agoDon't be over-enthusiastic with the ascii() calls: we don't need it if
Jack Jansen [Wed, 7 Aug 2002 15:05:42 +0000 (15:05 +0000)]
Don't be over-enthusiastic with the ascii() calls: we don't need it if
the result passes through backticks.

22 years agoDonovan Preston's patch #538395, with some mods by me.
Jack Jansen [Wed, 7 Aug 2002 14:49:00 +0000 (14:49 +0000)]
Donovan Preston's patch #538395, with some mods by me.

This patch makes inheritance for OSA classes work. The implementation is a
bit convoluted, but I don't immedeately see a simpler way of doing it.

I added calls to ascii() everywhere we output strings that may contain
non-ascii characters (Python has gotten very picky since the encoding
patch:-).

I also removed Donovan's different way of opening resource files: I don't
seem to need it.

22 years agoQuote the arguments, they may contain strings.
Jack Jansen [Wed, 7 Aug 2002 14:05:58 +0000 (14:05 +0000)]
Quote the arguments, they may contain strings.

22 years agoFix up some more markup problems.
Fred Drake [Wed, 7 Aug 2002 13:24:09 +0000 (13:24 +0000)]
Fix up some more markup problems.

22 years agoChange the markup a bit more; the parameter was not marked as \var in the
Fred Drake [Wed, 7 Aug 2002 12:39:33 +0000 (12:39 +0000)]
Change the markup a bit more; the parameter was not marked as \var in the
sample code, and the note was marked as a logical thing.

22 years agoFix PEP 263 code --without-unicode. Fixes #591943.
Martin v. Löwis [Wed, 7 Aug 2002 12:33:18 +0000 (12:33 +0000)]
Fix PEP 263 code --without-unicode. Fixes #591943.

22 years agoFix markup errors.
Steve Holden [Wed, 7 Aug 2002 12:01:41 +0000 (12:01 +0000)]
Fix markup errors.

22 years agoExpanded the unittests for the new width sensitive PyUnicode_Contains().
Raymond Hettinger [Tue, 6 Aug 2002 23:08:51 +0000 (23:08 +0000)]
Expanded the unittests for the new width sensitive PyUnicode_Contains().

22 years agoDocument handling of raw-unicode-escapes. Closes SF bug 587087.
Raymond Hettinger [Tue, 6 Aug 2002 22:36:26 +0000 (22:36 +0000)]
Document handling of raw-unicode-escapes.  Closes SF bug 587087.

22 years agointernal_connect(): Windows. When sock_timeout > 0 and connect() yields
Tim Peters [Tue, 6 Aug 2002 22:25:02 +0000 (22:25 +0000)]
internal_connect():  Windows.  When sock_timeout > 0 and connect() yields
WSAEWOULDBLOCK, the second connect() attempt appears to yield WSAEISCONN
on Win98 but WSAEINVAL on Win2K.  So accept either as meaning "yawn,
fine".  This allows test_socket to succeed on my Win2K box (which it
already did on my Win98SE box).

22 years agoAdded a note about the inability to specify a pathname to a non-existing
Jack Jansen [Tue, 6 Aug 2002 22:15:23 +0000 (22:15 +0000)]
Added a note about the inability to specify a pathname to a non-existing
file in unix-Python.

22 years agoChanged a sentence that confused some people.
Jack Jansen [Tue, 6 Aug 2002 22:14:23 +0000 (22:14 +0000)]
Changed a sentence that confused some people.

22 years agoMake more functions static
Neal Norwitz [Tue, 6 Aug 2002 22:12:52 +0000 (22:12 +0000)]
Make more functions static

22 years agoMake readahead functions static
Neal Norwitz [Tue, 6 Aug 2002 21:50:54 +0000 (21:50 +0000)]
Make readahead functions static

22 years agoFix SF bug 574207 (chained __slots__ dealloc segfault).
Guido van Rossum [Tue, 6 Aug 2002 21:41:44 +0000 (21:41 +0000)]
Fix SF bug 574207 (chained __slots__ dealloc segfault).

This is inspired by SF patch 581742 (by Jonathan Hogg, who also
submitted the bug report, and two other suggested patches), but
separates the non-GC case from the GC case to avoid testing for GC
several times.

Had to fix an assert() from call_finalizer() that asserted that the
object wasn't untracked, because it's possible that the object isn't
GC'ed!

22 years agoFix the markup so it doesn't break formatting.
Fred Drake [Tue, 6 Aug 2002 21:36:06 +0000 (21:36 +0000)]
Fix the markup so it doesn't break formatting.

22 years agoAdd testcase for SF bug 574207 (chained __slots__ dealloc segfault).
Guido van Rossum [Tue, 6 Aug 2002 21:28:28 +0000 (21:28 +0000)]
Add testcase for SF bug 574207 (chained __slots__ dealloc segfault).
Fix forthcoming.

22 years agoAdded references to the email package.
Fred Drake [Tue, 6 Aug 2002 21:26:01 +0000 (21:26 +0000)]
Added references to the email package.
Closes SF bug #586937.

22 years agoAdded a test for PyUnicode_Contains() taking into account the width of
Barry Warsaw [Tue, 6 Aug 2002 19:03:56 +0000 (19:03 +0000)]
Added a test for PyUnicode_Contains() taking into account the width of
Py_UNICODE.

22 years agoPyUnicode_Contains(): The memcmp() call didn't take into account the
Barry Warsaw [Tue, 6 Aug 2002 19:03:17 +0000 (19:03 +0000)]
PyUnicode_Contains(): The memcmp() call didn't take into account the
width of Py_UNICODE.  Good catch, MAL.

22 years agoget rid of GETNAMEV macro - use GETITEM directly
Skip Montanaro [Tue, 6 Aug 2002 17:47:40 +0000 (17:47 +0000)]
get rid of GETNAMEV macro - use GETITEM directly
same idea as getting rid of GETCONST & GETNAME (see patch #506436)

22 years agoAdd a coding cookie, because of the møøse quote.
Guido van Rossum [Tue, 6 Aug 2002 17:29:38 +0000 (17:29 +0000)]
Add a coding cookie, because of the møøse quote.

22 years agoUpdate the URL for getting zlib, and update the minimal required
Guido van Rossum [Tue, 6 Aug 2002 17:28:30 +0000 (17:28 +0000)]
Update the URL for getting zlib, and update the minimal required
version to 1.1.4 (because of the 1.1.3 security problem).  Also
replace a funny use of line.find() with line.startswith().

22 years agoBump the LOOPS count. 50,000 iterations takes about 5 seconds on my
Guido van Rossum [Tue, 6 Aug 2002 17:21:20 +0000 (17:21 +0000)]
Bump the LOOPS count.  50,000 iterations takes about 5 seconds on my
machine -- that feels just right.

22 years agoAdd some fine points: METH_KEYWORDS implies METH_VARARGS, and ob_size
Guido van Rossum [Tue, 6 Aug 2002 17:18:56 +0000 (17:18 +0000)]
Add some fine points: METH_KEYWORDS implies METH_VARARGS, and ob_size
is no longer unused in type objects.

22 years agoMark xreadlines deprecated. Don't use f.xreadlines() in test_iter.py.
Guido van Rossum [Tue, 6 Aug 2002 17:14:04 +0000 (17:14 +0000)]
Mark xreadlines deprecated.  Don't use f.xreadlines() in test_iter.py.

22 years agoRemove mention of deprecated xreadlines method.
Guido van Rossum [Tue, 6 Aug 2002 17:03:25 +0000 (17:03 +0000)]
Remove mention of deprecated xreadlines method.

22 years agoDescribe new "str1 in str2" behavior.
Barry Warsaw [Tue, 6 Aug 2002 17:01:51 +0000 (17:01 +0000)]
Describe new "str1 in str2" behavior.

22 years agoDocument file.next(). Mark xreadlines obsolete (both method and
Guido van Rossum [Tue, 6 Aug 2002 17:01:28 +0000 (17:01 +0000)]
Document file.next().  Mark xreadlines obsolete (both method and
module).  (One thing remains to be done: the gzip class has an
xreadline method; this ought to be replaced by an iterator as well.)

22 years agoCommitting patch #591250 which provides "str1 in str2" when str1 is a
Barry Warsaw [Tue, 6 Aug 2002 16:58:21 +0000 (16:58 +0000)]
Committing patch #591250 which provides "str1 in str2" when str1 is a
string of longer than 1 character.

22 years agoFiles are now their own iterator. The xreadlines method and module
Guido van Rossum [Tue, 6 Aug 2002 16:20:26 +0000 (16:20 +0000)]
Files are now their own iterator.  The xreadlines method and module
are obsolete.

22 years agoAdd comment about os.path.walk()'s behavior with symbolic links.
Steve Holden [Tue, 6 Aug 2002 16:07:07 +0000 (16:07 +0000)]
Add comment about os.path.walk()'s behavior with symbolic links.

22 years agoAdd next and __iter__ to the list of file methods that should raise
Guido van Rossum [Tue, 6 Aug 2002 15:58:24 +0000 (15:58 +0000)]
Add next and __iter__ to the list of file methods that should raise
ValueError when called for a closed file.

22 years agoSF patch 580331 by Oren Tirosh: make file objects their own iterator.
Guido van Rossum [Tue, 6 Aug 2002 15:55:28 +0000 (15:55 +0000)]
SF patch 580331 by Oren Tirosh: make file objects their own iterator.

For a file f, iter(f) now returns f (unless f is closed), and f.next()
is similar to f.readline() when EOF is not reached; however, f.next()
uses a readahead buffer that messes up the file position, so mixing
f.next() and f.readline() (or other methods) doesn't work right.
Calling f.seek() drops the readahead buffer, but other operations
don't.

The real purpose of this change is to reduce the confusion between
objects and their iterators.  By making a file its own iterator, it's
made clearer that using the iterator modifies the file object's state
(in particular the current position).

A nice side effect is that this speeds up "for line in f:" by not
having to use the xreadlines module.  The f.xreadlines() method is
still supported for backwards compatibility, though it is the same as
iter(f) now.

(I made some cosmetic changes to Oren's code, and added a test for
"file closed" to file_iternext() and file_iter().)

22 years agoIn the altbininstall target, which is the first subtarget for "make install",
Jack Jansen [Tue, 6 Aug 2002 13:40:31 +0000 (13:40 +0000)]
In the altbininstall target, which is the first subtarget for "make install",
if we are running in an OSX framework enabled build directory, test that
the framework infrastructure exists. This catches the very common
error of doing "make install" in stead of "make frameworkinstall".

22 years agoPatch #567296 by Pim Buurman, slightly modified by me so it can be disabled
Jack Jansen [Tue, 6 Aug 2002 12:59:44 +0000 (12:59 +0000)]
Patch #567296 by Pim Buurman, slightly modified by me so it can be disabled
at compile time: use PBGetCatInfoSync() to get FInfo data in stead of
GetFInfo. The latter doesn't work for folders. The former does, at
least on OSX, and insofar the info makes sense for a folder.

22 years agoWrapper around _IBCarbon.
Jack Jansen [Tue, 6 Aug 2002 09:32:57 +0000 (09:32 +0000)]
Wrapper around _IBCarbon.

22 years agoMention list.sort()
Andrew M. Kuchling [Tue, 6 Aug 2002 01:40:48 +0000 (01:40 +0000)]
Mention list.sort()
Document heapq module
Add PEP263 section (not sure I really understand the PEP's effect on 8-bit
   strings, though -- will have to experiment with it)

22 years agoSF patch #591305 Documentation err in bytecode defs
Neal Norwitz [Mon, 5 Aug 2002 23:33:54 +0000 (23:33 +0000)]
SF patch #591305 Documentation err in bytecode defs

22 years agoWe only need to check for StopIteration here.
Fred Drake [Mon, 5 Aug 2002 22:16:40 +0000 (22:16 +0000)]
We only need to check for StopIteration here.

22 years agoPatch by Ronald Oussoren: if there's a .lproj in the extras list also
Jack Jansen [Mon, 5 Aug 2002 22:06:29 +0000 (22:06 +0000)]
Patch by Ronald Oussoren: if there's a .lproj in the extras list also
check whether it contains a .nib, and do the Cocoa song and dance if
it does.

22 years agoIn copy() don't try to obtain an FSSpec until we know the destination
Jack Jansen [Mon, 5 Aug 2002 21:53:57 +0000 (21:53 +0000)]
In copy() don't try to obtain an FSSpec until we know the destination
exists. Partial fix for #585923.

22 years agoBe a lot less verbose by default.
Jack Jansen [Mon, 5 Aug 2002 21:15:22 +0000 (21:15 +0000)]
Be a lot less verbose by default.

22 years agoBetter output for errors, and some progress reports.
Jack Jansen [Mon, 5 Aug 2002 21:14:16 +0000 (21:14 +0000)]
Better output for errors, and some progress reports.
Handle the two modules with non-standard scanner module names.

22 years agoFixed the last two bgen-based modules to be buildable on OSX.
Jack Jansen [Mon, 5 Aug 2002 21:13:07 +0000 (21:13 +0000)]
Fixed the last two bgen-based modules to be buildable on OSX.

22 years agoInitial prototype of framer: a tool to build the frame for extension modules.
Jeremy Hylton [Mon, 5 Aug 2002 18:29:45 +0000 (18:29 +0000)]
Initial prototype of framer: a tool to build the frame for extension modules.

22 years agoRemove function definition from cStringIO.h.
Jeremy Hylton [Mon, 5 Aug 2002 18:20:01 +0000 (18:20 +0000)]
Remove function definition from cStringIO.h.

xxxPyCObject_Import() seems to be a copy of PyCObject_Import().

22 years agoSince the errno module is needed by os._execvpe(), and that is used by the
Fred Drake [Mon, 5 Aug 2002 18:06:17 +0000 (18:06 +0000)]
Since the errno module is needed by os._execvpe(), and that is used by the
setup.py (indirectly) script to build the standard dynamically loaded
modules, the errno module is being made static so it will always be
available.
Closes SF bug #591205 (needed on trunk only).

22 years agoSF patch 590294: os._execvpe security fix (Zack Weinberg).
Guido van Rossum [Mon, 5 Aug 2002 16:14:46 +0000 (16:14 +0000)]
SF patch 590294: os._execvpe security fix (Zack Weinberg).

22 years agoSF patch 590294: os._execvpe security fix (Zack Weinberg).
Guido van Rossum [Mon, 5 Aug 2002 16:13:24 +0000 (16:13 +0000)]
SF patch 590294: os._execvpe security fix (Zack Weinberg).

1) Do not attempt to exec a file which does not exist
just to find out what error the operating system
returns. This is an exploitable race on all platforms
that support symbolic links.

2) Immediately re-raise the exception if we get an
error other than errno.ENOENT or errno.ENOTDIR. This
may need to be adapted for other platforms.

(As a security issue, this should be considered for 2.1
and 2.2 as well as 2.3.)

22 years agoEnable building of Carbon toolbox modules with unix-Python.
Jack Jansen [Mon, 5 Aug 2002 15:39:30 +0000 (15:39 +0000)]
Enable building of Carbon toolbox modules with unix-Python.

22 years agoGot rid of staticforward.
Jack Jansen [Mon, 5 Aug 2002 15:36:57 +0000 (15:36 +0000)]
Got rid of staticforward.

22 years agoThis can now run under unix-Python too. You have to pass the folder
Jack Jansen [Mon, 5 Aug 2002 15:33:44 +0000 (15:33 +0000)]
This can now run under unix-Python too. You have to pass the folder
to search on the command line in that case.

22 years agoFixed to run better in unix-Python, and to cater for bgenlocations
Jack Jansen [Mon, 5 Aug 2002 15:32:30 +0000 (15:32 +0000)]
Fixed to run better in unix-Python, and to cater for bgenlocations
possibly being missing.

22 years agoTypo: "now" --> "the new"
Fred Drake [Mon, 5 Aug 2002 15:24:19 +0000 (15:24 +0000)]
Typo:  "now" --> "the new"

22 years agoIDLE support for PEP 263.
Martin v. Löwis [Mon, 5 Aug 2002 15:11:26 +0000 (15:11 +0000)]
IDLE support for PEP 263.

22 years agoMoved bgenlocations to the Mac/Lib directory. Not perfect, but better than
Jack Jansen [Mon, 5 Aug 2002 14:56:04 +0000 (14:56 +0000)]
Moved bgenlocations to the Mac/Lib directory. Not perfect, but better than
where it was: it is really a configuration file, not a normal module.

By moving it into Mac/Lib we can now also store the location of bgen
itself in there, which is needed because bgen isn't installed.

22 years agoPatch #590913: PEP 263 support.
Martin v. Löwis [Mon, 5 Aug 2002 14:55:21 +0000 (14:55 +0000)]
Patch #590913: PEP 263 support.

22 years agoUse ascii_letters to avoid UnicodeErrors.
Martin v. Löwis [Mon, 5 Aug 2002 14:53:52 +0000 (14:53 +0000)]
Use ascii_letters to avoid UnicodeErrors.

22 years agoAdd a small description of PEP 263.
Guido van Rossum [Mon, 5 Aug 2002 14:17:20 +0000 (14:17 +0000)]
Add a small description of PEP 263.

22 years agoAdded a cast to shut up a compiler warning.
Jack Jansen [Mon, 5 Aug 2002 14:14:05 +0000 (14:14 +0000)]
Added a cast to shut up a compiler warning.

22 years agoRenamed Py_Main to PyMac_Main as it has a different signature than the "normal" Py_Ma...
Jack Jansen [Mon, 5 Aug 2002 14:13:31 +0000 (14:13 +0000)]
Renamed Py_Main to PyMac_Main as it has a different signature than the "normal" Py_Main, and that signature has appeared in a .h file.

22 years agoAdded _IBCarbon module.
Jack Jansen [Mon, 5 Aug 2002 14:12:24 +0000 (14:12 +0000)]
Added _IBCarbon module.

22 years agoSF 582071 clarified the .split() method's docstring to note that sep=None
Raymond Hettinger [Mon, 5 Aug 2002 06:28:21 +0000 (06:28 +0000)]
SF 582071 clarified the .split() method's docstring to note that sep=None
will trigger splitting on any whitespace.

22 years agoNote that True and False are pickable objects
Raymond Hettinger [Mon, 5 Aug 2002 03:55:36 +0000 (03:55 +0000)]
Note that True and False are pickable objects

22 years agoGvR provided solution to the socket rebinding timeout problem.
Kurt B. Kaiser [Mon, 5 Aug 2002 03:52:10 +0000 (03:52 +0000)]
GvR provided solution to the socket rebinding timeout problem.

M PyShell.py
M rpc.py
M run.py

22 years agoAdd 1 to lineno in deprecation warning. Fixes #590888.
Martin v. Löwis [Mon, 5 Aug 2002 01:49:16 +0000 (01:49 +0000)]
Add 1 to lineno in deprecation warning. Fixes #590888.

22 years agoTest whether a Cyrillic text correctly appears in a Unicode literal.
Martin v. Löwis [Mon, 5 Aug 2002 01:32:09 +0000 (01:32 +0000)]
Test whether a Cyrillic text correctly appears in a Unicode literal.

22 years agoWe don't really need the name of the test in the "test skipped" msg, and
Tim Peters [Sun, 4 Aug 2002 22:55:35 +0000 (22:55 +0000)]
We don't really need the name of the test in the "test skipped" msg, and
having it there causes the line to wrap.

22 years agoOops! Forgot the closing paren.
Tim Peters [Sun, 4 Aug 2002 22:52:30 +0000 (22:52 +0000)]
Oops!  Forgot the closing paren.

22 years agoFinally got around to figuring out and documenting why this test fails
Tim Peters [Sun, 4 Aug 2002 22:35:31 +0000 (22:35 +0000)]
Finally got around to figuring out and documenting why this test fails
on Windows.  The test_sequence() ERROR is easily repaired if we're
willing to add an os.unlink() line to mhlib's updateline().  The
test_listfolders FAIL I gave up on -- I don't remember enough about Unix
link esoterica to recall why a link count of 2 is something a well-
written program should be keenly interested in <wink>.

22 years agoBuild the _IBCarbon module.
Jack Jansen [Sun, 4 Aug 2002 22:04:25 +0000 (22:04 +0000)]
Build the _IBCarbon module.

22 years agoThe definitions for IBCarbonRuntime.h
Jack Jansen [Sun, 4 Aug 2002 22:03:36 +0000 (22:03 +0000)]
The definitions for IBCarbonRuntime.h

22 years agoUpdated to something that works on my system, and regenerated module.
Jack Jansen [Sun, 4 Aug 2002 21:59:37 +0000 (21:59 +0000)]
Updated to something that works on my system, and regenerated module.

22 years agoSpecify pathnames in a way that works on both OS9 and OSX.
Jack Jansen [Sun, 4 Aug 2002 21:56:12 +0000 (21:56 +0000)]
Specify pathnames in a way that works on both OS9 and OSX.
You'll still have to manually edit it, though...

22 years agoUse universal newline input when scanning header files.
Jack Jansen [Sun, 4 Aug 2002 21:55:25 +0000 (21:55 +0000)]
Use universal newline input when scanning header files.

22 years agoDonovan Preston's interface to IBCarbon, allowing you to use Interface
Jack Jansen [Sun, 4 Aug 2002 21:34:24 +0000 (21:34 +0000)]
Donovan Preston's interface to IBCarbon, allowing you to use Interface
Builder carbon NIB files from Python. As-is, I may need to twiddle a few
things as he donated this long ago.

Donovan is now one of the four people in the world who know how to drive
bgen!

22 years agoChanges to the OSX section:
Jack Jansen [Sun, 4 Aug 2002 21:19:55 +0000 (21:19 +0000)]
Changes to the OSX section:
- steer people away from installing with sudo
- warn that fink-installed software may cause trouble
- explain why you might want a framework build and point people to
  Mac/OSX/README.

22 years agoUse the -n option of ln in stead of -h, as it also works with other ln's
Jack Jansen [Sun, 4 Aug 2002 21:17:20 +0000 (21:17 +0000)]
Use the -n option of ln in stead of -h, as it also works with other ln's
people may have (fink, gnu).

22 years agosmall speedup for constant and name access
Skip Montanaro [Sun, 4 Aug 2002 21:03:35 +0000 (21:03 +0000)]
small speedup for constant and name access
see sf #506436

22 years agoMake pgen compile with pydebug. Duplicate normalized names, as it may
Martin v. Löwis [Sun, 4 Aug 2002 20:10:29 +0000 (20:10 +0000)]
Make pgen compile with pydebug. Duplicate normalized names, as it may
be longer than the old string.

22 years agoGroup statements properly.
Martin v. Löwis [Sun, 4 Aug 2002 18:28:44 +0000 (18:28 +0000)]
Group statements properly.

22 years agoRepaired a fatal compiler error in the debug build: it's not clear what
Tim Peters [Sun, 4 Aug 2002 17:58:34 +0000 (17:58 +0000)]
Repaired a fatal compiler error in the debug build:  it's not clear what
this was trying to assert, but the name it referenced didn't exist.

22 years agoSquash compiler wng about signed-vs-unsigned mismatch.
Tim Peters [Sun, 4 Aug 2002 17:56:42 +0000 (17:56 +0000)]
Squash compiler wng about signed-vs-unsigned mismatch.

22 years agoSped the usual case for sorting by calling PyObject_RichCompareBool
Tim Peters [Sun, 4 Aug 2002 17:47:26 +0000 (17:47 +0000)]
Sped the usual case for sorting by calling PyObject_RichCompareBool
directly when no comparison function is specified.  This saves a layer
of function call on every compare then.  Measured speedups:

 i    2**i  *sort  \sort  /sort  3sort  +sort  %sort  ~sort  =sort  !sort
15   32768  12.5%   0.0%   0.0% 100.0%   0.0%  50.0% 100.0% 100.0% -50.0%
16   65536   8.7%   0.0%   0.0%   0.0%   0.0%   0.0%  12.5%   0.0%   0.0%
17  131072   8.0%  25.0%   0.0%  25.0%   0.0%  14.3%   5.9%   0.0%   0.0%
18  262144   6.3% -10.0%  12.5%  11.1%   0.0%   6.3%   5.6%  12.5%   0.0%
19  524288   5.3%   5.9%   0.0%   5.6%   0.0%   5.9%   5.4%   0.0%   2.9%
20 1048576   5.3%   2.9%   2.9%   5.1%   2.8%   1.3%   5.9%   2.9%   4.2%

The best indicators are those that take significant time (larger i), and
where sort doesn't do very few compares (so *sort and ~sort benefit most
reliably).  The large numbers are due to roundoff noise combined with
platform variability; e.g., the 14.3% speedup for %sort at i=17 reflects
a printed elapsed time of 0.18 seconds falling to 0.17, but a change in
the last digit isn't really meaningful (indeed, if it really took 0.175
seconds, one electron having a lazy nanosecond could shift it to either
value <wink>).  Similarly the 25% at 3sort i=17 was a meaningless change
from 0.05 to 0.04.  However, almost all the "meaningless changes" were
in the same direction, which is good.  The before-and-after times for
*sort are clearest:

before after
  0.18  0.16
  0.25  0.23
  0.54  0.50
  1.18  1.11
  2.57  2.44
  5.58  5.30

22 years agoPatch #534304: Implement phase 1 of PEP 263.
Martin v. Löwis [Sun, 4 Aug 2002 17:29:52 +0000 (17:29 +0000)]
Patch #534304: Implement phase 1 of PEP 263.

22 years agoAdd encoding declaration.
Martin v. Löwis [Sun, 4 Aug 2002 17:28:33 +0000 (17:28 +0000)]
Add encoding declaration.

22 years agoAdd encoding declaration.
Martin v. Löwis [Sun, 4 Aug 2002 17:22:59 +0000 (17:22 +0000)]
Add encoding declaration.

22 years agoRemove a syntax error in the example, spotted by Walter Hofman.
Steve Holden [Sun, 4 Aug 2002 15:27:25 +0000 (15:27 +0000)]
Remove a syntax error in the example, spotted by Walter Hofman.

22 years agoAlways link libpython.so with LIBS. Fixes #589422.
Martin v. Löwis [Sun, 4 Aug 2002 12:38:50 +0000 (12:38 +0000)]
Always link libpython.so with LIBS. Fixes #589422.

22 years agoAdd trace_frame. Fixes #534864. Backported to 2.2.
Martin v. Löwis [Sun, 4 Aug 2002 08:24:49 +0000 (08:24 +0000)]
Add trace_frame. Fixes #534864. Backported to 2.2.

22 years agoAdd recursion counter for pickling. Fixes #576084.
Martin v. Löwis [Sun, 4 Aug 2002 08:20:23 +0000 (08:20 +0000)]
Add recursion counter for pickling. Fixes #576084.
2.2 bugfix candidate (may cause RuntimeError for applications that
currently work fine).

22 years agoOS/2 EMX now supported
Andrew MacIntyre [Sun, 4 Aug 2002 07:25:58 +0000 (07:25 +0000)]
OS/2 EMX now supported

22 years agoI don't know what's going on with this test, but the last change from
Tim Peters [Sun, 4 Aug 2002 06:53:18 +0000 (06:53 +0000)]
I don't know what's going on with this test, but the last change from
Piers obviously couldn't have passed on any platform.  Fiddling it so it
works (for a meaning of "works" no stronger than "doesn't fail" <wink>).

22 years agoSF patch #578297:
Andrew MacIntyre [Sun, 4 Aug 2002 06:28:21 +0000 (06:28 +0000)]
SF patch #578297:

Change the parser and compiler to use PyMalloc.

Only the files implementing processes that will request memory
allocations small enough for PyMalloc to be a win have been
changed, which are:-
 - Python/compile.c
 - Parser/acceler.c
 - Parser/node.c
 - Parser/parsetok.c

This augments the aggressive overallocation strategy implemented by
Tim Peters in PyNode_AddChild() [Parser/node.c], in reducing the
impact of platform malloc()/realloc()/free() corner case behaviour.
Such corner cases are known to be triggered by test_longexp and
test_import.

Jeremy Hylton, in accepting this patch, recommended this as a
bugfix candidate for 2.2.  While the changes to Python/compile.c
and Parser/node.c backport easily (and could go in), the changes
to Parser/acceler.c and Parser/parsetok.c require other not
insignificant changes as a result of the differences in the memory
APIs between 2.3 and 2.2, which I'm not in a position to work
through at the moment.  This is a pity, as the Parser/parsetok.c
changes are the most important after the Parser/node.c changes, due
to the size of the memory requests involved and their frequency.