]> granicus.if.org Git - python/log
python
22 years agoFix markup error that suppressed space.
Fred Drake [Fri, 10 May 2002 12:37:56 +0000 (12:37 +0000)]
Fix markup error that suppressed space.
Closes SF bug #554257.  Not relevant to older releases.

22 years agoFix typo
Andrew M. Kuchling [Thu, 9 May 2002 14:33:18 +0000 (14:33 +0000)]
Fix typo

22 years agoFixed string and dict conversion, and implemented booleans and numbers (int and float...
Jack Jansen [Wed, 8 May 2002 22:13:51 +0000 (22:13 +0000)]
Fixed string and dict conversion, and implemented booleans and numbers (int and float). I think we now have enough CFType support to start on plists and CFpreferences!

Transparent handling of unknown CFType objects still TBD.

22 years agoPartial fix for string handling. Null byte TBD.
Jack Jansen [Wed, 8 May 2002 15:29:33 +0000 (15:29 +0000)]
Partial fix for string handling. Null byte TBD.

22 years agoRemove news about PyMalloc_*. Do we need to say anything about
Neil Schemenauer [Wed, 8 May 2002 14:14:41 +0000 (14:14 +0000)]
Remove news about PyMalloc_*.  Do we need to say anything about
pymalloc?

22 years agoUpdates and rewriting
Andrew M. Kuchling [Wed, 8 May 2002 13:39:03 +0000 (13:39 +0000)]
Updates and rewriting

22 years agoPatch #553230: Create LIBDIR if necessary. Bugfix candidate.
Martin v. Löwis [Wed, 8 May 2002 08:59:59 +0000 (08:59 +0000)]
Patch #553230: Create LIBDIR if necessary. Bugfix candidate.

22 years agoPatch #553277: Accept callbacks that are callable, not callbacks that are true.
Martin v. Löwis [Wed, 8 May 2002 08:56:33 +0000 (08:56 +0000)]
Patch #553277: Accept callbacks that are callable, not callbacks that are true.

22 years agoPatch #553403: Fix typo.
Martin v. Löwis [Wed, 8 May 2002 08:51:29 +0000 (08:51 +0000)]
Patch #553403: Fix typo.

22 years agoPatch #551410: Implement tp_getiter.
Martin v. Löwis [Wed, 8 May 2002 08:49:27 +0000 (08:49 +0000)]
Patch #551410: Implement tp_getiter.

22 years agoPatch #552433: Special-case tuples. Avoid sub-type checking for lists.
Martin v. Löwis [Wed, 8 May 2002 08:44:21 +0000 (08:44 +0000)]
Patch #552433: Special-case tuples. Avoid sub-type checking for lists.
Avoid checks for negative indices and duplicate checks for support of
the sequence protocol.

22 years agoPatch #551011: Fix compilation problems with Cygwin.
Martin v. Löwis [Wed, 8 May 2002 07:16:37 +0000 (07:16 +0000)]
Patch #551011: Fix compilation problems with Cygwin.

22 years agoMore support for bridging between Python and CoreFoundation objects. Still untested.
Jack Jansen [Tue, 7 May 2002 23:00:03 +0000 (23:00 +0000)]
More support for bridging between Python and CoreFoundation objects. Still untested.

22 years agoAdded pycfbridge.c
Jack Jansen [Tue, 7 May 2002 22:59:06 +0000 (22:59 +0000)]
Added pycfbridge.c

22 years agoAdded enumobject.c
Jack Jansen [Tue, 7 May 2002 21:42:08 +0000 (21:42 +0000)]
Added enumobject.c

22 years agoMove 'Tips and Tricks' to be the last section
Andrew M. Kuchling [Tue, 7 May 2002 21:03:45 +0000 (21:03 +0000)]
Move 'Tips and Tricks' to be the last section

22 years agoAdd section on Setup file
Andrew M. Kuchling [Tue, 7 May 2002 21:02:35 +0000 (21:02 +0000)]
Add section on Setup file
Updates for 2.2
Remove references to Makefile.pre.in build method

22 years agoMore filling out
Andrew M. Kuchling [Tue, 7 May 2002 21:01:16 +0000 (21:01 +0000)]
More filling out

22 years agoFix typos
Andrew M. Kuchling [Tue, 7 May 2002 20:58:03 +0000 (20:58 +0000)]
Fix typos

22 years agoFixed a mistake on my part when regenerating: removed a bogus import of Applscript_Suite.
Jack Jansen [Tue, 7 May 2002 20:16:20 +0000 (20:16 +0000)]
Fixed a mistake on my part when regenerating: removed a bogus import of Applscript_Suite.

Bugfix candidate (I'll move it over myself).

22 years agoWrite two sections, and write some partial text for some other sections
Andrew M. Kuchling [Mon, 6 May 2002 17:46:39 +0000 (17:46 +0000)]
Write two sections, and write some partial text for some other sections

22 years agoAdd a note explaining the interaction between unbuffered input and
Fred Drake [Mon, 6 May 2002 16:02:42 +0000 (16:02 +0000)]
Add a note explaining the interaction between unbuffered input and
xreadlines.xreadlines().
This closes SF patch #552804.

22 years agoPrevent convert_path from crashing if the path is an empty string. Bugfix candidate.
Andrew M. Kuchling [Mon, 6 May 2002 13:57:19 +0000 (13:57 +0000)]
Prevent convert_path from crashing if the path is an empty string.  Bugfix candidate.

22 years agoFirst steps towards a generalized converter of Python object
Jack Jansen [Sun, 5 May 2002 21:48:12 +0000 (21:48 +0000)]
First steps towards a generalized converter of Python object
hierarchies to CoreFoundation object hierarchies and vice versa.

22 years agorandom.gauss() uses a piece of hidden state used by nothing else,
Tim Peters [Sun, 5 May 2002 20:40:00 +0000 (20:40 +0000)]
random.gauss() uses a piece of hidden state used by nothing else,
and the .seed() and .whseed() methods failed to reset it.  In other
words, setting the seed didn't completely determine the sequence of
results produced by random.gauss().  It does now.  Programs repeatedly
mixing calls to a seed method with calls to gauss() may see different
results now.

Bugfix candidate (random.gauss() has always been broken in this way),
despite that it may change results.

22 years agoRename posix_WCONTINUED to posix_WIFCONTINUED, call WIFCONTINUED inside,
Martin v. Löwis [Sat, 4 May 2002 13:13:41 +0000 (13:13 +0000)]
Rename posix_WCONTINUED to posix_WIFCONTINUED, call WIFCONTINUED inside,
add it to the posix_methods.

22 years ago_PyGC_generation0 is now a pointer
Neil Schemenauer [Sat, 4 May 2002 05:36:06 +0000 (05:36 +0000)]
_PyGC_generation0 is now a pointer

22 years agoMove all data for a single generation into a structure. The set of
Neil Schemenauer [Sat, 4 May 2002 05:35:20 +0000 (05:35 +0000)]
Move all data for a single generation into a structure.  The set of
generations is now an array.  This cleans up some code and makes it easy
to change the number of generations.  Also, implemented a
gc_list_is_empty() function.  This makes the logic a little clearer in
places.  The performance impact of these changes should be negligible.

One functional change is that allocation/collection counters are always
zeroed at the start of a collection.  This should fix SF bug #551915.
This change is too big for back-porting but the minimal patch on SF
looks good for a bugfix release.

22 years agoPatch #551093: Let cygwin default to --enable-shared.
Martin v. Löwis [Fri, 3 May 2002 05:53:15 +0000 (05:53 +0000)]
Patch #551093: Let cygwin default to --enable-shared.

22 years agoIntegrated SF patch #539487 by Matthias Klose:
Fred Drake [Fri, 3 May 2002 04:50:51 +0000 (04:50 +0000)]
Integrated SF patch #539487 by Matthias Klose:
This patch adds Milan Zamazal's conversion script and
modifies the mkinfo script to build the info doc files
from the LaTeX sources.  Currently, the mac, doc and
inst TeX files are not handled.
Explicitly checks for GNU Emacs 21.

22 years agoBoost the list of stop words, by merging in the little list Jeremy
Tim Peters [Thu, 2 May 2002 21:59:08 +0000 (21:59 +0000)]
Boost the list of stop words, by merging in the little list Jeremy
just checked into Zope's ZCTextIndex branch.  This reduces the size
of the .chm file by about 100KB.

22 years agoUpdate the xrange object description to reflect the removal of deprecated
Fred Drake [Thu, 2 May 2002 21:37:23 +0000 (21:37 +0000)]
Update the xrange object description to reflect the removal of deprecated
features.

22 years agoAdded notes related to the removal of deprecated features of the xrange type.
Fred Drake [Thu, 2 May 2002 21:28:26 +0000 (21:28 +0000)]
Added notes related to the removal of deprecated features of the xrange type.

22 years agoAdded note about using the documentation build tools under Cygwin.
Fred Drake [Thu, 2 May 2002 21:17:00 +0000 (21:17 +0000)]
Added note about using the documentation build tools under Cygwin.

22 years agoRemove the warning about the Cygwin directions not working -- the latest
Fred Drake [Thu, 2 May 2002 21:10:48 +0000 (21:10 +0000)]
Remove the warning about the Cygwin directions not working -- the latest
change to Doc/tools/node2label.pl (revision 1.13) makes this work.

22 years agoWork around limitation of Cygwin Perl: To avoid a permission denial, we need
Fred Drake [Thu, 2 May 2002 20:42:30 +0000 (20:42 +0000)]
Work around limitation of Cygwin Perl:  To avoid a permission denial, we need
to do the inplace-edit with a backup file.  A quick test leads me to
believe this is sufficient to allow building the documentation on Cygwin;
a full test is in progress.

22 years agoIndicate delayed initialization of slots. Suggested by tim.one.
Martin v. Löwis [Thu, 2 May 2002 20:34:12 +0000 (20:34 +0000)]
Indicate delayed initialization of slots. Suggested by tim.one.

22 years agoPatch #551008: DL_IMPORT PyBool_FromLong.
Martin v. Löwis [Thu, 2 May 2002 20:23:27 +0000 (20:23 +0000)]
Patch #551008: DL_IMPORT PyBool_FromLong.

22 years agoPyObject_Realloc(): If a small block is shrinking, bite the expense of
Tim Peters [Thu, 2 May 2002 20:19:34 +0000 (20:19 +0000)]
PyObject_Realloc():  If a small block is shrinking, bite the expense of
copying it if at least 25% of the input block can be reclaimed.

22 years agoPatch #551009: Initialize array type dynamically.
Martin v. Löwis [Thu, 2 May 2002 20:09:59 +0000 (20:09 +0000)]
Patch #551009: Initialize array type dynamically.

22 years agoRemove old deprecated features from the xrange object.
Fred Drake [Thu, 2 May 2002 19:56:55 +0000 (19:56 +0000)]
Remove old deprecated features from the xrange object.

22 years agoRemove all tests that rely on deprecated-in-2.2 features of xrange objects.
Fred Drake [Thu, 2 May 2002 18:40:31 +0000 (18:40 +0000)]
Remove all tests that rely on deprecated-in-2.2 features of xrange objects.
"What's New in Python 2.2" documented that these would be removed in
Python 2.3.

22 years agoMany minor markup adjustments for consistency.
Fred Drake [Thu, 2 May 2002 17:55:26 +0000 (17:55 +0000)]
Many minor markup adjustments for consistency.

22 years agoRemove extra period produced by previous change.
Fred Drake [Thu, 2 May 2002 17:54:18 +0000 (17:54 +0000)]
Remove extra period produced by previous change.

22 years agoPatch 550804: Make os.environ.copy() return a copy.
Martin v. Löwis [Thu, 2 May 2002 17:39:19 +0000 (17:39 +0000)]
Patch 550804: Make os.environ.copy() return a copy.

22 years agoAdded regression tests for xrange object attributes.
Fred Drake [Thu, 2 May 2002 16:07:44 +0000 (16:07 +0000)]
Added regression tests for xrange object attributes.
See SF bug #551285.

22 years agoFix attribute access for the xrange objects. The tp_getattr and tp_getattro
Fred Drake [Thu, 2 May 2002 16:05:27 +0000 (16:05 +0000)]
Fix attribute access for the xrange objects.  The tp_getattr and tp_getattro
handlers were both set, but were not compatible.  This change uses only the
tp_getattro handler with a more "modern" approach.
This fixes SF bug #551285.

22 years agoCorrect Moshe's e-mail address
Andrew M. Kuchling [Thu, 2 May 2002 14:48:26 +0000 (14:48 +0000)]
Correct Moshe's e-mail address
Point to PEP 100 for MAL's Unicode proposal
Fix URL for XML HOWTO
Bump version number

22 years agoNote that NameError's message also changed in 2.0
Andrew M. Kuchling [Thu, 2 May 2002 14:37:14 +0000 (14:37 +0000)]
Note that NameError's message also changed in 2.0

22 years agoMessage for NameError has changed
Andrew M. Kuchling [Thu, 2 May 2002 14:31:55 +0000 (14:31 +0000)]
Message for NameError has changed

22 years agoclarify message when raising TypeError to indicate that float() accepts
Skip Montanaro [Thu, 2 May 2002 13:03:22 +0000 (13:03 +0000)]
clarify message when raising TypeError to indicate that float() accepts
strings or numbers

22 years agoGuard gettext and friends with HAVE_LIBINTL_H. Fixes #549907.
Martin v. Löwis [Thu, 2 May 2002 12:16:29 +0000 (12:16 +0000)]
Guard gettext and friends with HAVE_LIBINTL_H. Fixes #549907.

22 years agoCorrect information on support for repietition & concatenation for buffer
Fred Drake [Thu, 2 May 2002 05:56:04 +0000 (05:56 +0000)]
Correct information on support for repietition & concatenation for buffer
and xrange objects.
This closes SF bug #550555.

22 years agoBuffer-object repitition and concatenation has worked all along; add a test
Fred Drake [Thu, 2 May 2002 04:27:20 +0000 (04:27 +0000)]
Buffer-object repitition and concatenation has worked all along; add a test
to make avoid regression.

22 years agoAdded some notes on setting up the documentation tools on Cygwin.
Fred Drake [Wed, 1 May 2002 22:05:30 +0000 (22:05 +0000)]
Added some notes on setting up the documentation tools on Cygwin.

22 years agoAdded more style for major warnings.
Fred Drake [Wed, 1 May 2002 22:03:40 +0000 (22:03 +0000)]
Added more style for major warnings.

22 years agoPickler_clear_memo(): convert to METH_NOARGS.
Fred Drake [Wed, 1 May 2002 20:36:39 +0000 (20:36 +0000)]
Pickler_clear_memo(): convert to METH_NOARGS.

22 years agoAdd Pickler.clear_memo() so the pickle and cPickle modules are more similar.
Fred Drake [Wed, 1 May 2002 20:33:53 +0000 (20:33 +0000)]
Add Pickler.clear_memo() so the pickle and cPickle modules are more similar.

22 years agolist_documented_items(): Basic implementation.
Fred Drake [Wed, 1 May 2002 17:25:04 +0000 (17:25 +0000)]
list_documented_items():  Basic implementation.
This still does not work well since ctags does not do a good job with the
Python headers, appearantly due to the DL_IMPORT macro.  ;-(

22 years agoExplain what os.read() returns at end of file.
Fred Drake [Wed, 1 May 2002 03:31:42 +0000 (03:31 +0000)]
Explain what os.read() returns at end of file.
This closes SF bug #550409.  Applying to release21-maint & release22-maint.

22 years agoAdd missing right-parenthesis.
Fred Drake [Wed, 1 May 2002 03:23:03 +0000 (03:23 +0000)]
Add missing right-parenthesis.

22 years agoWatch out for older XEmacsen for which requiring info-look doesn't
Barry Warsaw [Tue, 30 Apr 2002 18:58:52 +0000 (18:58 +0000)]
Watch out for older XEmacsen for which requiring info-look doesn't
define info-lookup-maybe-add-help.

22 years agomoved from Tools/scripts (was only at rev 1.1 - no changes yet - so I simply
Skip Montanaro [Tue, 30 Apr 2002 16:25:37 +0000 (16:25 +0000)]
moved from Tools/scripts (was only at rev 1.1 - no changes yet - so I simply
removed it from there and added it here)

22 years agomoving into the Doc/tools directory
Skip Montanaro [Tue, 30 Apr 2002 16:23:42 +0000 (16:23 +0000)]
moving into the Doc/tools directory

22 years agoAdd a note about when the "%r" formatting code was added.
Fred Drake [Tue, 30 Apr 2002 14:54:47 +0000 (14:54 +0000)]
Add a note about when the "%r" formatting code was added.

22 years agoadd enumobject.c to build machinery
Andrew MacIntyre [Tue, 30 Apr 2002 13:06:32 +0000 (13:06 +0000)]
add enumobject.c to build machinery

22 years agoFred's recent changes to support "-u all" resulted in subset resource
Andrew MacIntyre [Tue, 30 Apr 2002 12:11:04 +0000 (12:11 +0000)]
Fred's recent changes to support "-u all" resulted in subset resource
selections (eg "-u network") being ignored.

22 years agoadd enumobject.c to build machinery
Andrew MacIntyre [Tue, 30 Apr 2002 12:06:23 +0000 (12:06 +0000)]
add enumobject.c to build machinery

22 years agoAdded a missing "|" in the grammar productions used in the reference manual
Fred Drake [Tue, 30 Apr 2002 02:18:51 +0000 (02:18 +0000)]
Added a missing "|" in the grammar productions used in the reference manual
(reported by François Pinard).
Added some missing "_" characters in the same cluster of productions.
Added missing floor division operator in m_expr production, and mention
floor division in the relevant portion of the text.

22 years agobuiltin_zip(): Take a good guess at how big the result list will be,
Tim Peters [Mon, 29 Apr 2002 21:27:32 +0000 (21:27 +0000)]
builtin_zip():  Take a good guess at how big the result list will be,
and allocate it in one gulp.

This isn't a bugfix, it's just a minor optimization that may or may not
pay off.

22 years agoTypo: whcar_t should be wchar_t.
Thomas Heller [Mon, 29 Apr 2002 17:28:43 +0000 (17:28 +0000)]
Typo: whcar_t should be wchar_t.

Bugfix candidate? Don't know how this is handled in the docs.

22 years agoAdd some items, and remove a note to myself
Andrew M. Kuchling [Mon, 29 Apr 2002 15:42:16 +0000 (15:42 +0000)]
Add some items, and remove a note to myself

22 years agoSmall markup adjustments for consistency.
Fred Drake [Mon, 29 Apr 2002 15:17:16 +0000 (15:17 +0000)]
Small markup adjustments for consistency.

22 years agoSee discussion at SF bug 547537.
Guido van Rossum [Mon, 29 Apr 2002 13:54:48 +0000 (13:54 +0000)]
See discussion at SF bug 547537.

Unicode objects are currently taken as binary data by the write()
method.  This is not what Unicode users expect, nor what the
StringIO.py code does.  Until somebody adds a way to specify binary or
text mode for cStringIO objects, change the format string to use "t#"
instead of "s#", so that it will request the "text buffer" version.
This will try the default encoding for Unicode objects.

This is *not* a 2.2 bugfix (since it *is* a semantic change).

22 years agoMostly in SequenceMatcher.{__chain_b, find_longest_match}:
Tim Peters [Mon, 29 Apr 2002 01:37:32 +0000 (01:37 +0000)]
Mostly in SequenceMatcher.{__chain_b, find_longest_match}:
This now does a dynamic analysis of which elements are so frequently
repeated as to constitute noise.  The primary benefit is an enormous
speedup in find_longest_match, as the innermost loop can have factors
of 100s less potential matches to worry about, in cases where the
sequences have many duplicate elements.  In effect, this zooms in on
sequences of non-ubiquitous elements now.

While I like what I've seen of the effects so far, I still consider
this experimental.  Please give it a try!

22 years agoJust added comments, and cleared some XXX questions, related to int
Tim Peters [Sun, 28 Apr 2002 16:57:34 +0000 (16:57 +0000)]
Just added comments, and cleared some XXX questions, related to int
memory management.

22 years ago_PyObject_DebugCheckAddress(): If the leading pad bytes are corrupt,
Tim Peters [Sun, 28 Apr 2002 06:14:45 +0000 (06:14 +0000)]
_PyObject_DebugCheckAddress():  If the leading pad bytes are corrupt,
display a msg warning that the count of bytes requested may be bogus,
and that a segfault may happen next.

22 years agoMoving pymalloc along.
Tim Peters [Sun, 28 Apr 2002 04:11:46 +0000 (04:11 +0000)]
Moving pymalloc along.

As threatened, PyMem_{Free, FREE} also invoke the object deallocator now
when pymalloc is enabled (well, it does when pymalloc isn't enabled too,
but in that case "the object deallocator" is plain free()).

This is maximally backward-compatible, but it leaves a bitter aftertaste.

Also massive reworking of comments.

22 years ago_PyObject_GC_New: Could call PyObject_INIT with a NULL 1st argument.
Tim Peters [Sun, 28 Apr 2002 01:57:25 +0000 (01:57 +0000)]
_PyObject_GC_New:  Could call PyObject_INIT with a NULL 1st argument.
_PyObject_GC_NewVar:  Could call PyObject_INIT_VAR likewise.

Bugfix candidate.

22 years agoRepair widespread misuse of _PyString_Resize. Since it's clear people
Tim Peters [Sat, 27 Apr 2002 18:44:32 +0000 (18:44 +0000)]
Repair widespread misuse of _PyString_Resize.  Since it's clear people
don't understand how this function works, also beefed up the docs.  The
most common usage error is of this form (often spread out across gotos):

if (_PyString_Resize(&s, n) < 0) {
Py_DECREF(s);
s = NULL;
goto outtahere;
}

The error is that if _PyString_Resize runs out of memory, it automatically
decrefs the input string object s (which also deallocates it, since its
refcount must be 1 upon entry), and sets s to NULL.  So if the "if"
branch ever triggers, it's an error to call Py_DECREF(s):  s is already
NULL!  A correct way to write the above is the simpler (and intended)

if (_PyString_Resize(&s, n) < 0)
goto outtahere;

Bugfix candidate.

22 years agoSF patch 549375: Compromise PyUnicode_EncodeUTF8
Tim Peters [Sat, 27 Apr 2002 18:03:26 +0000 (18:03 +0000)]
SF patch 549375:  Compromise PyUnicode_EncodeUTF8
This implements ideas from Marc-Andre, Martin, Guido and me on Python-Dev.

"Short" Unicode strings are encoded into a "big enough" stack buffer,
then exactly as much string space as they turn out to need is allocated
at the end.  This should have speed benefits akin to Martin's "measure
once, allocate once" strategy, but without needing a distinct measuring
pass.

"Long" Unicode strings allocate as much heap space as they could possibly
need (4 x # Unicode chars), and do a realloc at the end to return the
untouched excess.  Since the overallocation is likely to be substantial,
this shouldn't burden the platform realloc with unusably small excess
blocks.

Also simplified uses of the PyString_xyz functions.  Also added a release-
build check that 4*size doesn't overflow a C int.  Sooner or later, that's
going to happen.

22 years agoTeach the Windows build about the new enumobject.c file.
Tim Peters [Fri, 26 Apr 2002 21:20:02 +0000 (21:20 +0000)]
Teach the Windows build about the new enumobject.c file.

22 years agoSlightly expand and clarify the differences between getegid(), getgid(),
Fred Drake [Fri, 26 Apr 2002 20:59:40 +0000 (20:59 +0000)]
Slightly expand and clarify the differences between getegid(), getgid(),
getpgrp(), and setpgid().
This closes SF bug #547939.

22 years agoBe more consistent, both internally and with recommended practice.
Fred Drake [Fri, 26 Apr 2002 20:44:14 +0000 (20:44 +0000)]
Be more consistent, both internally and with recommended practice.
This closes SF bug #547953.

22 years agoDocumentation for the enumerate() function/type.
Fred Drake [Fri, 26 Apr 2002 20:29:44 +0000 (20:29 +0000)]
Documentation for the enumerate() function/type.
This closes SF patch #547162.

22 years agoClarify that the strip changes also apply to Unicode.
Guido van Rossum [Fri, 26 Apr 2002 20:11:29 +0000 (20:11 +0000)]
Clarify that the strip changes also apply to Unicode.

22 years ago- New builtin function enumerate(x), from PEP 279. Example:
Guido van Rossum [Fri, 26 Apr 2002 19:40:56 +0000 (19:40 +0000)]
- New builtin function enumerate(x), from PEP 279.  Example:
  enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
  The argument can be an arbitrary iterable object.

22 years ago(py-comint-output-filter-function): Put the pop-to-buffer call inside
Barry Warsaw [Fri, 26 Apr 2002 15:49:52 +0000 (15:49 +0000)]
(py-comint-output-filter-function): Put the pop-to-buffer call inside
the `when' condition so other non-Python shell comint changes won't
cause random buffers to pop.

22 years agoPyNumber_CoerceEx: this took a shortcut (not doing anything) when the
Guido van Rossum [Fri, 26 Apr 2002 02:49:14 +0000 (02:49 +0000)]
PyNumber_CoerceEx: this took a shortcut (not doing anything) when the
left and right type were of the same type and not classic instances.

This shortcut is dangerous for proxy types, because it means that
coerce(Proxy(1), Proxy(2.1)) leaves Proxy(1) unchanged rather than
turning it into Proxy(1.0).

In an ever-so-slight change of semantics, I now only take the shortcut
when the left and right types are of the same type and don't have the
CHECKTYPES feature.  It so happens that classic instances have this
flag, so the shortcut is still skipped in this case (i.e. nothing
changes for classic instances).  Proxies also have this flag set
(otherwise implementing numeric operations on proxies would become
nightmarish) and this means that the shortcut is also skipped there,
as desired.  It so happens that int, long and float also have this
flag set; that means that e.g. coerce(1, 1) will now invoke
int_coerce().  This is fine: int_coerce() can deal with this, and I'm
not worried about the performance; int_coerce() is only invoked when
the user explicitly calls coerce(), which should be rarer than rare.

22 years agoClean up uses of some deprecated features.
Fred Drake [Fri, 26 Apr 2002 02:29:55 +0000 (02:29 +0000)]
Clean up uses of some deprecated features.
Reported by Neal Norwitz on python-dev.

22 years agoIf Py_OptimizeFlag is false then always evaluate assert conditions, don't
Neil Schemenauer [Fri, 26 Apr 2002 01:58:53 +0000 (01:58 +0000)]
If Py_OptimizeFlag is false then always evaluate assert conditions, don't
test __debug__ at runtime.  Closes SF patch #548833.

22 years agoMake sure that tp_free frees the int the same way as tp_dealloc would.
Guido van Rossum [Fri, 26 Apr 2002 00:53:34 +0000 (00:53 +0000)]
Make sure that tp_free frees the int the same way as tp_dealloc would.
This fixes the problem that Barry reported on python-dev:
   >>> 23000 .__class__ = bool
crashes in the deallocator.  This was because int inherited tp_free
from object, which uses the default allocator.

2.2. Bugfix candidate.

22 years agoFix typo in the setup of interpreter-mode-alist.
Barry Warsaw [Thu, 25 Apr 2002 21:46:33 +0000 (21:46 +0000)]
Fix typo in the setup of interpreter-mode-alist.

22 years agoSF patch #510288 by Kevin J. Butler, mod'd by Barry. This provides
Barry Warsaw [Thu, 25 Apr 2002 21:31:47 +0000 (21:31 +0000)]
SF patch #510288 by Kevin J. Butler, mod'd by Barry.  This provides
better auto-recognition of a Jython file vs. a CPython (or agnostic)
file by looking at the #! line more closely, and inspecting the import
statements in the first 20000 bytes (configurable).  Specifically,

(py-import-check-point-max): New variable, controlling how far into
the buffer it will search for import statements.

(py-jpython-packages): List of package names that are Jython-ish.

(py-shell-alist): List of #! line programs and the modes associated
with them.

(jpython-mode-hook): Extra hook that runs when entering jpython-mode
(what about Jython mode? <20k wink>).

(py-choose-shell-by-shebang, py-choose-shell-by-import,
py-choose-shell): New functions.

(python-mode): Use py-choose-shell.

(jpython-mode): New command.

(py-execute-region): Don't use my previous hacky attempt at doing
this, use the new py-choose-shell function.

One other thing this file now does: it attempts to add the proper
hooks to interpreter-mode-alist and auto-mode-alist if they aren't
already there.  Might help with Emacs users since that editor doesn't
come with python-mode by default.

22 years agoClean up the layout of the bool_as_number struct initializer.
Guido van Rossum [Thu, 25 Apr 2002 20:01:10 +0000 (20:01 +0000)]
Clean up the layout of the bool_as_number struct initializer.

22 years ago(py-execute-region): Alexander Schmolck points out that leading
Barry Warsaw [Thu, 25 Apr 2002 19:17:42 +0000 (19:17 +0000)]
(py-execute-region): Alexander Schmolck points out that leading
whitespace can hose the needs-if test.  So just skip all blank lines
at the start of the region right off the bat.

22 years agoPass the full pathname to MSVC when compiling a debug version. This
Thomas Heller [Thu, 25 Apr 2002 17:29:45 +0000 (17:29 +0000)]
Pass the full pathname to MSVC when compiling a debug version. This
allows the debugger to find the source without asking the user to
browse for it.

22 years agoAppend the PC specific include 'PC' and library 'PCBuild' directories
Thomas Heller [Thu, 25 Apr 2002 17:26:37 +0000 (17:26 +0000)]
Append the PC specific include 'PC' and library 'PCBuild' directories
under NT - this allows distutils to work with the CVS version or the
source distribution.

Wrap a long line.

22 years agoFix trivial typo.
Thomas Heller [Thu, 25 Apr 2002 17:03:30 +0000 (17:03 +0000)]
Fix trivial typo.

22 years ago(py-comint-output-filter-function): Add a pop-to-buffer call so you
Barry Warsaw [Thu, 25 Apr 2002 16:26:38 +0000 (16:26 +0000)]
(py-comint-output-filter-function): Add a pop-to-buffer call so you
always get to see the result of e.g. a py-execute-region.  Funny, this
bugged both me /and/ Guido!