Commit Graph

23683 Commits

Author SHA1 Message Date
Guido van Rossum c13f724af0 Streamline the fast track for CFunction calls a bit more: there was
nothing special done if keyword arguments were present, so test for
that earlier and fall through to the normal case if there are any.
This ought to slow down CFunction calls with keyword args, but I don't
care; it's a tiny (1%) improvement for pystone.
2002-08-16 16:14:00 +00:00
Jack Jansen 49931887d7 Regenerated with PyDoc_STR() around docstrings. 2002-08-16 09:09:31 +00:00
Jack Jansen 44b99e0a1f iUse PyDoc_STR() around docstrings. 2002-08-16 09:07:42 +00:00
Guido van Rossum c7903a13d2 A nice little speed-up for filter():
- Use PyObject_Call() instead of PyEval_CallObject(), saves several
  layers of calls and checks.

- Pre-allocate the argument tuple rather than calling Py_BuildValue()
  each time round the loop.

- For filter(None, seq), avoid an INCREF and a DECREF.
2002-08-16 07:04:56 +00:00
Guido van Rossum 8e829200b1 Fix SF bug 595838 -- buffer in type_new() should not be static. Moved
to inner scope, too.
2002-08-16 03:47:49 +00:00
Tim Peters 9146f27b77 SF bug 594996: OverflowError in random.randrange
Loosened the acceptable 'start' and 'stop' arguments so that any
Python (bounded) ints can be used.  So, e.g., randrange(-sys.maxint-1,
sys.maxint) no longer blows up.
2002-08-16 03:41:39 +00:00
Tim Peters 012c0a393a Newly-relaxed limits on random.randrange(). Also added some info about
Karatsuba's better cache behavior with extremely large multiplicands.
2002-08-16 03:40:07 +00:00
Guido van Rossum f808b891d6 Mention warnings about defining None. 2002-08-16 03:38:10 +00:00
Guido van Rossum b7164621fa Add warnings for arguments named None. All set. (I could add a
warning for 'global None', but that's either accompanied by an
assignment to None, which will trigger a warning, or not, in which
case it's harmless. :-)
2002-08-16 02:48:11 +00:00
Tim Peters 80703c8930 check_events(): This was failing under -O, due to not expecting any
LINE events when not __debug__.  But we get them anyway under -O now,
so just stop special-casing non-__debug__ mode.
2002-08-16 02:27:15 +00:00
Guido van Rossum 63dd79ac04 Add warning for None used as keyword argument name in function call.
Still to do: function definition arguments (including *None and
**None).
2002-08-16 02:24:56 +00:00
Guido van Rossum 3ac99d4910 Add warnings for assignment or deletion of variables and attributes
named 'None'.  Still to do: function definition parameter lists, and
function call keyword arguments.
2002-08-16 02:13:49 +00:00
Guido van Rossum b081e0c74c Minor cleanup of parsename() and parsestr(): the 'struct compiling *'
argument should be called 'c', like everywhere else.  Renamed a
complex variable 'c' to 'z' and moved it inside the only scope where
it's used.
2002-08-16 01:57:32 +00:00
Barry Warsaw 0a51b58e6b base64.decodestring('') should return '' instead of raising an
exception.  The bug fix for SF #430849 wasn't quite right.  This
closes SF bug #595671.  I'll backport this to Python 2.2.
2002-08-15 22:14:24 +00:00
Jack Jansen 7ca993ed37 Fixed the bugs in the constant definitions, and in the code to test
them.
The FutureWarnings are still there, until a way has been found to
say "I know what I'm doing here when I say 0xff000000".
2002-08-15 22:05:58 +00:00
Jack Jansen 87eea88b5a After generating the Python file with definitions try to run it, so
we catch errors during the build process in stead of later during runtime.
2002-08-15 21:48:16 +00:00
Jack Jansen 81204152d4 Try to cater for a source tree checked out with MacCVS in stead of
unix cvs. In this case the resource files are actual resource files
in stead of AppleSingle encoded files.
2002-08-15 21:31:18 +00:00
Tim Peters e417de0e56 Illustrating by example one good reason not to trust a proof <wink>. 2002-08-15 20:10:45 +00:00
Tim Peters ab86c2be24 k_mul() comments: In honor of Dijkstra, made the proof that "t3 fits"
rigorous instead of hoping for testing not to turn up counterexamples.
Call me heretical, but despite that I'm wholly confident in the proof,
and have done it two different ways now, I still put more faith in
testing ...
2002-08-15 20:06:00 +00:00
Tim Peters 9973d74b2d long_mul(): Simplified exit code. In particular, k_mul() returns a
normalized result, so no point to normalizing it again.  The number
of test+branches was also excessive.
2002-08-15 19:41:06 +00:00
Michael W. Hudson dd32a91cc0 This is my patch
[ 587993 ] SET_LINENO killer

Remove SET_LINENO.  Tracing is now supported by inspecting co_lnotab.

Many sundry changes to document and adapt to this change.
2002-08-15 14:59:02 +00:00
Guido van Rossum add88060c1 Add notes about universal newlines. 2002-08-15 14:01:14 +00:00
Guido van Rossum 402905eaa0 Fix typo. It's --with-universal-newlines, not
--with-universal-newline.
2002-08-15 13:56:35 +00:00
Skip Montanaro ccfdde86eb Slight reordering of directories searched for BerkDB libs and include files.
Push /usr/... further down the list - always check /usr/local/... before
/usr/...

Doubt this will help with http://python.org/sf/589427 or not, but these
changes were prompted by my investigation of that bug report.  I wasn't able
to reproduce that problem though
2002-08-15 01:34:38 +00:00
Skip Montanaro 8c91337221 forgot the best part - the new tests...
see patch 586561
2002-08-15 01:28:54 +00:00
Skip Montanaro 118ec70ea2 provide less mysterious error messages when seeing end-of-line in
single-quoted strings or end-of-file in triple-quoted strings.
closes patch 586561.
2002-08-15 01:20:16 +00:00
Andrew M. Kuchling 90e9a79afd Add 'in' change
Revise sentence
Add two reminders
2002-08-15 00:40:21 +00:00
Guido van Rossum fdb8648327 Add news about Fred's change to Py_InitModule4(). 2002-08-14 21:20:32 +00:00
Jeremy Hylton 8b73542cf5 Reflow long lines. 2002-08-14 21:01:41 +00:00
Fred Drake 794643c314 Py_InitModule() and friends now accept NULL for the 'methods'
argument.  This makes sense now that extension types can support
__init__ directly rather than requiring function constructors.
2002-08-14 20:59:38 +00:00
Fred Drake 233cc5987b Py_InitModule4(): Accept NULL for the 'methods' argument. This makes
sense now that extension types can support __init__ directly rather
than requiring function constructors.
2002-08-14 20:57:56 +00:00
Jeremy Hylton 92bb6e7b96 Docstring nits: The module is neither proposed nor new. 2002-08-14 19:25:42 +00:00
Martin v. Löwis f399fd9635 Added Hisao Suzuki. 2002-08-14 18:52:54 +00:00
Guido van Rossum 54df53a352 More changes of DeprecationWarning to FutureWarning. 2002-08-14 18:38:27 +00:00
Jeremy Hylton 29c2106465 Explain use of currentThread() in _Condition methods. 2002-08-14 17:56:13 +00:00
Guido van Rossum 88b1defb6f The filterwarnings() call here should be updated to filter out
FutureWarning.
2002-08-14 17:54:48 +00:00
Jeremy Hylton 39c12bfba1 Explain a little more. 2002-08-14 17:46:40 +00:00
Jeremy Hylton af7fde7f34 Explain a minor mystery. 2002-08-14 17:43:59 +00:00
Guido van Rossum 323a9cfc83 PyType_Ready(): initialize the base class a bit earlier, so that if we
copy the metatype from the base, the base actually has one!
2002-08-14 17:26:30 +00:00
Tim Peters 48d52c0fcc k_mul() comments: Simplified the simplified explanation of why ah*bh and
al*bl "always fit":  it's actually trivial given what came before.
2002-08-14 17:07:32 +00:00
Barry Warsaw b8c20a723f More updates describing FutureWarnings. 2002-08-14 16:40:54 +00:00
Tim Peters 2f238c1b22 mkstemp's last argument changed from binary=True to text=False. 2002-08-14 16:37:10 +00:00
Tim Peters 8e966ee49a k_mul() comments: Explained why there's always enough room to subtract
ah*bh and al*bl.  This is much easier than explaining why that's true
for (ah+al)*(bh+bl), and follows directly from the simple part of the
(ah+al)*(bh+bl) explanation.
2002-08-14 16:36:23 +00:00
Guido van Rossum 9be8946a3e Add news about FutureWarning and PEP 237 stage B0.
Tim predicts that we might as well call this CassandraWarning.
2002-08-14 16:11:30 +00:00
Barry Warsaw 29ce2d7d1e Document PyExc_FutureWarning 2002-08-14 16:06:28 +00:00
Barry Warsaw 9f00739551 Added a FutureWarning for constructs that will change semantically in
the future.  Changed PEP 237 hex constant warnings from
DeprecationWarning to FutureWarning.  Updated the documentation.
2002-08-14 15:51:29 +00:00
Martin v. Löwis 31d2df5b60 Patch #550192: Set softspace to 0 in raw_input(). 2002-08-14 15:46:02 +00:00
Tim Peters 04490bf225 tempfile's mkstemp(): Changed last argument from
binary=True
to
    text=False

by BDFL Pronouncement.  All other changes follow from this.  The change
to the docs is ready to go, but blocked by another JackMacLock in the
doc directory.
2002-08-14 15:41:26 +00:00
Fred Drake 5c08a99b77 Remove a broken example of extreme backward compatibility; it is
simply not relevant any more.
Closes SF bug #595032.
2002-08-14 15:26:18 +00:00
Jason Tishler 80c02af345 Patch #595014: Cygwin tempfile patch
Although Cygwin attempts to be as Posix compliant
as possible, it has difficulties unlinking open
files. This is not surprising given that Cygwin is
dependent on Win32 which in turn has this problem
itself.

The attached tempfile patch acknowledges this
Cygwin limitation. Without this patch, Cygwin
fails test_tempfile (i.e., test_has_no_name) as
follows:

$ ./python -E -tt ../Lib/test/regrtest.py -l test_tempfile
test_tempfile
test test_tempfile failed -- Traceback (most recent call last):
  File "/home/jt/src/PythonCvs/Lib/test/test_tempfile.py", line 689, in test_has_no_name
    self.failOnException("rmdir", ei)
  File "/home/jt/src/PythonCvs/Lib/test/test_tempfile.py", line 33, in failOnException
    self.fail("%s raised %s: %s" % (what, ei[0], ei[1]))
  File "/home/jt/src/PythonCvs/Lib/unittest.py", line 260, in fail
    raise self.failureException, msg
AssertionError: rmdir raised exceptions.OSError: [Errno 90] Directory not empty: '/mnt/c/DOCUME~1/jatis/LOCALS~1/Temp/tmpM_z8nj'
2002-08-14 15:10:09 +00:00