| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
no "doc" argument given. This makes it possible to legitimately use
property() as a decorator to produce a read-only property.
|
|
|
|
|
|
| |
This was mostly written by Travis Oliphant.
I've inspected it all; Neal Norwitz and MvL have also looked at it
(in an earlier incarnation).
|
|
|
|
| |
(reviewed by Neal Norwitz)
|
|
|
|
|
| |
Add (int) casts to silence compiler warnings.
Raise Python exceptions for overflows.
|
|
|
|
| |
Actually define Py_RefTotal as a Py_ssize_t.
|
| |
|
| |
|
|
|
|
|
| |
available %zd format character. Mark with an XXX comment so we can fix this,
later.
|
|
|
|
|
|
|
|
|
| |
added message attribute compared to the previous version of Exception. It is
also a new-style class, making all exceptions now new-style. KeyboardInterrupt
and SystemExit inherit from BaseException directly. String exceptions now
raise DeprecationWarning.
Applies patch 1104669, and closes bugs 1012952 and 518846.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- New semantics for __exit__() -- it must re-raise the exception
if type is not None; the with-statement itself doesn't do this.
(See the updated PEP for motivation.)
- Added context managers to:
- file
- thread.LockType
- threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore}
- decimal.Context
- Added contextlib.py, which defines @contextmanager, nested(), closing().
- Unit tests all around; bot no docs yet.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- 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 *.
|