Neil Schemenauer [Mon, 18 Nov 2002 16:04:52 +0000 (16:04 +0000)]
str and unicode objects now have a __mod__ slot so don't special case them in
PyNumber_Remainder(). This fixes SF bug #615506 and allows string and unicode
subclasses to override __mod__.
Improve DictMixin.
Replaced docstring with comments. Prevents subclass contamination.
Added the missing __cmp__() method and a test for __cmp__().
Used try/except style in preference to has_key() followed by a look-up.
Used iteritem() where possible to save creating a long key list and
to save redundant lookups.
Expanded .update() to look for the most helpful methods first and gradually
work down to a mininum expected interface.
Expanded documentation to be more clear on how to use the class.
Neil Schemenauer [Sun, 17 Nov 2002 17:52:44 +0000 (17:52 +0000)]
Remove _Py_ResetReferences. Fixes bug #529750 "Circular reference makes
Py_Init crash". refchain cannot be cleared because objects can live across
Py_Finalize() and Py_Initialize() if they are kept alive by circular
references.
Tim Peters [Fri, 15 Nov 2002 19:08:50 +0000 (19:08 +0000)]
Style guide reformats. I saw this test fail on a very heavily loaded
Win98SE box, but whatever the cause, it had scrolled off the DOS box.
(There was just the "test_queue failed" summary at the end of the
regrtest run.)
Fred Drake [Fri, 15 Nov 2002 19:04:10 +0000 (19:04 +0000)]
Squash an enormous number of warnings reported when adding "use
warnings;" to this, and keep the "use" statement this time.
Fix an obscure bug that caused weird index entries to be generated in
a few cases, and a minor problem with horizontal alignmetn of the last
column of 5-column tables.
[I'd report a SF bug #, but I can't get to that right now.]
SF patch #520382: Expand shelve.py to have a full dictionary interface
and add a mixin to UserDict.py to make it easier to implement a full
dictionary interface.
SF patch #520382: Expand shelve.py to have a full dictionary interface
and add a mixin to UserDict.py to make it easier to implement a full
dictionary interface.
Draft a section on modifying Python's path. I'm not sure where
this section fits best in inst.tex's organization; Fred or someone, feel
free to move it.
Jack Jansen [Fri, 15 Nov 2002 00:13:33 +0000 (00:13 +0000)]
First stab at a Makefile that will create a MacPython that uses the
Apple-installed Python 2.2 from /usr/bin as it's underlying engine.
All the MacPython stuff is installed into /Applications/MacPython-OSX,
and .pth files and other magic are used to tie everything together.
So far only the raw windowing interpreter and BuildApplet work.
Jack Jansen [Fri, 15 Nov 2002 00:05:47 +0000 (00:05 +0000)]
Added a hack so we can build applets with a MacPython that uses the
OSX 10.2 apple-supplied Python as its base: if we've copied a symlink
as the executable we remove it and install appletrunner in stead.
Tim Peters [Thu, 14 Nov 2002 23:24:40 +0000 (23:24 +0000)]
Windows changes to move from Tcl/Tk 8.3.2 to 8.4.1. I tested this by
running IDLE, and since I'm not a Tcl Guy I'm not sure what else to do.
Up to you! See XXX comments in PCbuild\readme.txt for cautions.
Also repaired typos in the new bz2-for-Windows instructions.
Guido van Rossum [Thu, 14 Nov 2002 22:00:19 +0000 (22:00 +0000)]
Checking in Greg Ward's Optik, as optparse.py. This is the most
recent version from Greg's CVS. I've changed the module docstring,
added a copyright notice, and renamed OptikError to OptParseError.
Guido van Rossum [Thu, 14 Nov 2002 19:49:16 +0000 (19:49 +0000)]
Use the new C3 MRO algorithm, implemented by Samuele Pedroni (SF patch
619475; also closing SF bug 618704). I tweaked his code a bit for
style.
This raises TypeError for MRO order disagreements, which is an
improvement (previously these went undetected) but also a degradation:
what if the order disagreement doesn't affect any method lookups?
I don't think I care.
If you have source files srcdir1/foo.c and srcdir2/foo.c, the
temporary .o for both files is written to build/temp.<platform>/foo.o.
This patch sets strip_dir to false for both calls to object_filename,
so now the object files are written to temp.<platform>/srcdir1/foo.o
and .../srcdir2/foo.o.
Eric S. Raymond [Wed, 13 Nov 2002 23:05:35 +0000 (23:05 +0000)]
Make nntplib aware of ~/.netrc credentials; now they get used if they are
present and the caller has not specified a name/password pair. This change
makes it less likely that a lazy coder will expose sensitive information in a
word-readable script.
Also, make the test a bit smarter. If NNTPSERVER is defined in the environment
it will go talk to that server rather than look for a possibly nonexistent
local one named 'news'. Maybe the osession initializer ought to look at
NNTPSERVER rather than requiring a host arg? Must look around and see how
universal this convention is first.
Fred Drake [Wed, 13 Nov 2002 19:16:37 +0000 (19:16 +0000)]
- Committing the modified signature lines I've been using for a long
time in http://www.python.org/dev/doc/. There have been no bug
reports on these for a long time now.
- Remove local "use" statement that duplicates a top-level "use".
Back out part of rev. 1.53, restoring the use of the string module.
The two long lines have been reflowed differently; hopefully someone on
BeOS can test them. Rev. 1.53 also converted string.atoi() to int(); I've
left that alone.
Fred Drake [Wed, 13 Nov 2002 15:32:34 +0000 (15:32 +0000)]
Update: Older versions of Python crashed when calling repr()
(including the implied call using back-ticks) of a recursive object,
but this is no longer the case.
Reported by Manus Hand via email.
Improved clarity and thoroughness of docstring.
Added design notes in comments.
Used better variable names.
Eliminated the unsavory "pool[-k:]" which was an aspiring bug (for k==0).
Used if/else to show the two algorithms in parallel style.
Added one more test assertion.
Fred Drake [Wed, 13 Nov 2002 15:13:38 +0000 (15:13 +0000)]
Clarify that PyImport_AddModule() and PyImport_ExecCodeModule() don't
add any package support structure even if a dotted-name is passed for
the module.
Closes SF bug #424106.