| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
| |
- The copy module now "copies" function objects (as atomic objects).
- dict.__getitem__ now looks for a __missing__ hook before raising
KeyError.
- Added a new type, defaultdict, to the collections module.
This uses the new __missing__ hook behavior added to dict (see above).
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
buffer_new(). Probably fixes a bug in 'buffer("", 10, 10)' on platforms
where sizeof(Py_ssize_t) != sizeof(long) (Win64?)
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes:
>>> u"".center(10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError
on 64-bit systems.
|
| |
|
|
|
|
| |
Convert Py_ssize_t using PyInt_FromSsize_t
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Py_SAFE_DOWNCAST can evaluate its first argument multiple
times in a debug build. This caused two distinct assert-
failures in test_unicode run under a debug build. Rewrote
the code in trivial ways so that multiple evaluation of the
first argument doesn't hurt.
|
| |
|
|
|
|
| |
whitespace.
|
| |
|
|
|
|
|
|
|
| |
* Allow the 3rd argument to generator.throw() to be None.
The 'raise' statement does the same, and anyway it follows the
general policy that optional arguments of built-ins should, when
reasonable, have a default value specifiable from Python.
|
|
|
|
|
|
|
| |
readline/readlines/read/readinto, loudly break by raising ValueError, rather
than silently deliver data out of order or hitting EOF prematurely.
Probably not a bugfix candidate, even though it affects no 'working' code.
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2006-February/060524.html
|
|
|
|
|
|
|
|
|
|
|
| |
to protect against actual uninitialized usage.
Objects/longobject.c: In function ‘PyLong_AsDouble’:
Objects/longobject.c:655: warning: ‘e’ may be used uninitialized in this function
Objects/longobject.c: In function ‘long_true_divide’:
Objects/longobject.c:2263: warning: ‘aexp’ may be used uninitialized in this function
Objects/longobject.c:2263: warning: ‘bexp’ may be used uninitialized in this function
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is how string objects work. u'%f' could use , instead of .
for the decimal point. Now both strings and unicode always use periods.
This is the code that would break:
import locale
locale.setlocale(locale.LC_NUMERIC, 'de_DE')
u'%.1f' % 1.0
assert '1.0' == u'%.1f' % 1.0
I couldn't create a test case which fails, but this fixes the problem.
Will backport.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Also, stop determining Unicode sizes with PyString_GET_SIZE.
|
| |
|
|
|
|
| |
no code changes.
|
|
|
|
|
| |
A patch by mwh to check that user-defined mro's are reasonable
enough.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* set sq_repeat and sq_concat to NULL for user-defined new-style
classes, as a way to fix a number of related problems. See
test_descr.notimplemented()). One of these problems was fixed
in r25556 and r25557 but many more existed; this is a general
fix and thus reverts r25556-r25557.
* to avoid having PySequence_Repeat()/PySequence_Concat() failing
on user-defined classes, they now fall back to nb_add/nb_mul if
sq_concat/sq_repeat are not defined and the arguments appear to
be sequences.
* added tests.
Backport candidate.
|
| |
|
|
|
|
| |
just like string codecs.
|
|
|
|
|
| |
(calling ftell(stdin) doesn't seem defined). So we won't test errors
from ftell unless we can do it portably.
|
|
|
|
|
| |
ftell(3) on BSD doesn't set errno even for ttys and returns useless
values.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In C++, it's an error to pass a string literal to a char* function
without a const_cast(). Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.
I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc. Predictably, there were a large set of functions that
needed to be fixed as a result of these changes. The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].
One cast was required as a result of the changes: A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
|
|
|
|
|
|
|
|
| |
[ 1346144 ] Segfaults from unaligned loads in floatobject.c
by using memcpy and not just blinding casting char* to double*.
Thanks to Rune Holm for the report.
|
| |
|
|
|
|
| |
Perhaps Py_NO_INLINE should be moved to pyport.h or some other header?
|
| |
|
|
|
|
|
|
|
|
| |
'[].__add__', to match what the other internal descriptor types provide:
'__objclass__' attribute, '__self__' member, and reasonable repr and
comparison.
Added a test.
|
| |
|
| |
|
|
|
|
| |
properties now.
|
| |
|
|
|
|
| |
Remove duplicate declarations from compile.h
|