| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
doesn't mean what the Python programmer thought...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
his copy of test_contains.py seems to be broken -- the lines he
deleted were already absent). Checkin messages:
New Unicode support for int(), float(), complex() and long().
- new APIs PyInt_FromUnicode() and PyLong_FromUnicode()
- added support for Unicode to PyFloat_FromString()
- new encoding API PyUnicode_EncodeDecimal() which converts
Unicode to a decimal char* string (used in the above new
APIs)
- shortcuts for calls like int(<int object>) and float(<float obj>)
- tests for all of the above
Unicode compares and contains checks:
- comparing Unicode and non-string types now works; TypeErrors
are masked, all other errors such as ValueError during
Unicode coercion are passed through (note that PyUnicode_Compare
does not implement the masking -- PyObject_Compare does this)
- contains now works for non-string types too; TypeErrors are
masked and 0 returned; all other errors are passed through
Better testing support for the standard codecs.
Misc minor enhancements, such as an alias dbcs for the mbcs codec.
Changes:
- PyLong_FromString() now applies the same error checks as
does PyInt_FromString(): trailing garbage is reported
as error and not longer silently ignored. The only characters
which may be trailing the digits are 'L' and 'l' -- these
are still silently ignored.
- string.ato?() now directly interface to int(), long() and
float(). The error strings are now a little different, but
the type still remains the same. These functions are now
ready to get declared obsolete ;-)
- PyNumber_Int() now also does a check for embedded NULL chars
in the input string; PyNumber_Long() already did this (and
still does)
Followed by:
Looks like I've gone a step too far there... (and test_contains.py
seem to have a bug too).
I've changed back to reporting all errors in PyUnicode_Contains()
and added a few more test cases to test_contains.py (plus corrected
the join() NameError).
|
| |
|
|
|
|
| |
dictionary that contains the same key/value pairs as p.
|
| |
|
|
|
|
|
|
| |
Added "better safe than sorry" patch to the new
trashcan code in object.c, to ensure that tstate
is not touched when it might be undefined.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Attached you find an update of the Unicode implementation.
The patch is against the current CVS version. I would appreciate
if someone with CVS checkin permissions could check the changes
in.
The patch contains all bugs and patches sent this week and also
fixes a leak in the codecs code and a bug in the free list code
for Unicode objects (which only shows up when compiling Python
with Py_DEBUG; thanks to MarkH for spotting this one).
|
|
|
|
|
|
| |
This (1) avoids thread unsafety whereby another thread could zap the
list while we were using it, and (2) now supports writing arbitrary
sequences of strings.
|
|
|
|
|
|
|
|
| |
Added wrapping macros to dictobject.c, listobject.c, tupleobject.c,
frameobject.c, traceback.c that safely prevends core dumps
on stack overflow. Macros and functions in object.c, object.h.
The method is an "elevator destructor" that turns cascading
deletes into tail recursive behavior when some limit is hit.
|
| |
|
| |
|
|
|
|
|
| |
with a twist: you have to define NO_STRICT_LIST_APPEND manually
to enable multi-arg append().
|
| |
|
| |
|
|
|
|
| |
Fredrik Lundh.
|
| |
|
|
|
|
|
| |
PySequence_Contains() now that string objects have this code in their
tp_contains.
|
|
|
|
|
|
| |
here.
[Patch modified by GvR to keep the original exception.]
|
|
|
|
| |
few other paths through the function that leaked).
|
|
|
|
| |
PyArg_ParseTuple() format string arguments as possible.
|
|
|
|
|
|
| |
an instance method instance_contains as sq_contains. It looks for
__contains__ and if not found falls back to previous behaviour.
Done.
|
|
|
|
|
| |
patches PySequence_Contains() to check for a valid sq_contains field.
More to follow.
|
|
|
|
| |
format strings.
|
|
|
|
|
|
|
|
| |
diagnostics.
*** INCOMPATIBLE CHANGE: This changes append(), remove(), index(), and
*** count() to require exactly one argument -- previously, multiple
*** arguments were silently assumed to be a tuple.
|
|
|
|
|
|
| |
and _DelItem().
In sequence multiplication by a long, only call PyErr_Occurred() when the
value returned is -1.
|
|
|
|
| |
Andreas Jung <ajung@sz-sb.de>.
|
|
|
|
|
|
| |
messages from "OverflowError: integer pow()" to "OverflowError:
integer exponentiation". (Not that this takes care of the complaint
in general that the error messages could be greatly improved. :-)
|
| |
|
|
|
|
| |
compilation on NT Alpha. Mostly added casts etc.
|
|
|
|
|
| |
previous output. Call clearerr() to prevent past errors affecting our
ferror() test later, in PyObject_Print(). Suggested by Marc Lemburg.
|
|
|
|
| |
while str() uses %.12g as before.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
trailing 'L' is appended to the representation,
otherwise not.
All existing call sites are modified to pass true for
addL.
Remove incorrect statement about external use of this
function from elsewhere; it's static!
long_str(): Handler for the tp_str slot in the type object.
Identical to long_repr(), but passes false as the addL
parameter of long_format().
|
|
|
|
| |
zero arguments (found by Marc Lemburg).
|
|
|
|
| |
messages for specific changes.
|
|
|
|
| |
long_pow().
|
|
|
|
| |
object is DECREFed too early.
|
|
|
|
| |
Integer division can crash under Windows.
|
|
|
|
| |
long(+/- infinity) returns nonsense.
|
| |
|
|
|
|
|
|
|
| |
constructors didn't miss this).
Raise MemoryError if malloc() fails, instead of just
returning NULL.
|
|
|
|
|
| |
when n == 0... So divide by a->ob_size instead which was already
tested for 0.
|
|
|
|
| |
dump core.
|
| |
|
|
|
|
|
|
|
|
| |
specifier came from an int expression instead of a constant in the
format, a negative width was truncated to zero instead of taken to
mean the same as that negative constant plugged into the format. E.g.
"(%*s)" % (-5, "foo") yielded "(foo)" while "(%-5s)" yields "(foo )".
Now both yield the latter -- like sprintf() in C.
|
|
|
|
|
|
|
|
|
|
| |
1. Fixes float divmod so that the quotient it returns is always an integral
value.
2. Fixes float % and float divmod so that the remainder always gets the
right sign (the current code uses a "are the signs different?" test that
doesn't work half the time <wink> when the product of the divisor and the
remainder underflows to 0).
|
| |
|
| |
|
| |
|
| |
|