| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Will backport to 2.3.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
interning were not clear here -- a subclass could be mutable, for
example -- and had bugs. Explicitly interning a subclass of string
via intern() will raise a TypeError. Internal operations that attempt
to intern a string subclass will have no effect.
Added a few tests to test_builtin that includes the old buggy code and
verifies that calls like PyObject_SetAttr() don't fail. Perhaps these
tests should have gone in test_string.
|
|
|
|
| |
must have annoyed me at some point.
|
|
|
|
|
|
|
| |
* Fixes an incorrect variable in a PyDict_CheckExact.
* Allow general mapping locals arguments for the execfile() function
and exec statement.
* Add tests.
|
|
|
|
|
|
| |
__oct__, and __hex__. Raise TypeError if an invalid type is
returned. Note that PyNumber_Int and PyNumber_Long can still
return ints or longs. Fixes SF bug #966618.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ 960406 ] unblock signals in threads
although the changes do not correspond exactly to any patch attached to
that report.
Non-main threads no longer have all signals masked.
A different interface to readline is used.
The handling of signals inside calls to PyOS_Readline is now rather
different.
These changes are all a bit scary! Review and cross-platform testing
much appreciated.
|
|
|
|
| |
* Add a test case that would have caught it.
|
|
|
|
|
|
| |
The builtin eval() function now accepts any mapping for the locals argument.
Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing
down the normal case. My timings so no measurable impact.
|
| |
|
|
|
|
| |
(SF patch 876178, patch by mwh, unittest by perky)
|
|
|
|
|
| |
Formerly, the length was only fetched from sequence objects.
Now, any object that reports its length can benefit from pre-sizing.
|
|
|
|
|
| |
Formerly, the length was only fetched from sequence objects.
Now, any object that reports its length can benefit from pre-sizing.
|
|
|
|
| |
sorted() becomes a regular function instead of a classmethod.
|
|
|
|
| |
remain deprecated in the documentation.
|
|
|
|
|
|
|
|
| |
* Install the unittests, docs, newsitem, include file, and makefile update.
* Exercise the new functions whereever sets.py was being used.
Includes the docs for libfuncs.tex. Separate docs for the types are
forthcoming.
|
| |
|
|
|
|
| |
alone, because there can be no guarantee re the semantics of += vs + .
|
|
|
|
| |
a performance bug in sum(manylists)), same as in 2.3 maintenance branch.
|
| |
|
|
|
|
|
|
| |
* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c)
* Py_BuildValue("()",a) --> PyTuple_New(0)
* Py_BuildValue("O", a) --> Py_INCREF(a)
|
| |
|
| |
|
|
|
|
|
|
| |
NULL pointer. (Detected by Michael Hudson, patch provided by Neal Norwitz).
Fix refcounting leak in filtertuple().
|
| |
|
|
|
|
| |
by returning an empty list instead of raising a TypeError.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
unexpected type, report the actual type rather than 'float'. (It's
hard to even reach this code with a float. :-)
|
|
|
|
|
|
|
| |
the code erroneously decrefed the istep argument in an error case. This
caused a co_consts tuple to lose a float constant prematurely, which
eventually caused gc to try executing static data in floatobject.c (don't
ask <wink>). So reworked this extensively to ensure refcount correctness.
|
|
|
|
|
|
|
| |
- range() now works even if the arguments are longs with magnitude
larger than sys.maxint, as long as the total length of the sequence
fits. E.g., range(2**100, 2**101, 2**100) is the following list:
[1267650600228229401496703205376L]. (SF patch #707427.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Arranged that all the objects exposed by __builtin__ appear in the list
of all objects. I basically peed away two days tracking down a mystery
leak in sys.gettotalrefcount() in a ZODB app (== tons of code), because
the object leaking the references didn't appear in the sys.getobjects(0)
list. The object happened to be False. Now False is in the list, along
with other popular & previously missing leak candidates (like None).
Alas, we still don't have a choke point covering *all* Python objects,
so the list of all objects may still be incomplete.
|
|
|
|
| |
(patch provided by Greg Chapman)
|
|
|
|
|
|
|
|
|
| |
with an indented code block but no newline would raise SyntaxError.
This would have been a four-line change in parsetok.c... Except
codeop.py depends on this behavior, so a compilation flag had to be
invented that causes the tokenizer to revert to the old behavior;
this required extra changes to 2 .h files, 2 .c files, and 2 .py
files. (Fixes SF bug #501622.)
|
|
|
|
|
| |
instead of PyTuple_GetItem, so an overwritten __getitem__
in a tuple subclass works. SF bug #665835.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
object is not a real str or unicode but an instance
of a subclass, construct the output via looping
over __getitem__. This guarantees that the result
is the same for function==None and function==lambda x:x
This doesn't happen for tuples, because filtertuple()
uses PyTuple_GetItem().
(This was discussed on SF bug #665835).
|
|
|
|
|
| |
my MAL. Fixed. (Btw. eval() still doesn't take buffers, but that was so
even before my patch.)
|
|
|
|
| |
Incorporated nnorwitz's comment re. Py__USING_UNICODE.
|
|
|
|
| |
subclasses. (Discussed in SF patch #665835)
|
|
|
|
|
| |
so we can jump to the error handling code that does.
(Spotted by Neal Norwitz)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
blindly assumed that tp_as_sequence->sq_item always returns
a str or unicode object. This might fail with str or unicode
subclasses.
This patch checks whether the object returned from __getitem__
is a str/unicode object and raises a TypeError if not (and
the filter function returned true).
Furthermore the result for __getitem__ can be more than one
character long, so checks for enough memory have to be done.
|
| |
|
| |
|
|
|
|
| |
Clarify the operation of locals().
|
|
|
|
| |
Suggested by MvL.
|