| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
http://mail.python.org/pipermail/python-dev/2002-June/025461.html
with test cases.
Also includes extended slice support for arrays, which I thought I'd
already checked in but obviously not.
|
| |
|
|
|
|
|
| |
I have a patch to make the test work too, but it's not pretty so
I'll submit it to sf.
|
| |
|
| |
|
| |
|
|
|
|
| |
directly.
|
| |
|
|
|
|
|
|
| |
- make array.array a type
- add Py_UNICODE arrays
- support +=, *=
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type.__module__ behavior.
This adds the module name and a dot in front of the type name in every
type object initializer, except for built-in types (and those that
already had this). Note that it touches lots of Mac modules -- I have
no way to test these but the changes look right. Apologies if they're
not. This also touches the weakref docs, which contains a sample type
object initializer. It also touches the mmap test output, because the
mmap type's repr is included in that output. It touches object.h to
put the correct description in a comment.
|
|
|
|
|
| |
Also changed <>-style #includes to ""-style in some places where the
former didn't make sense.
|
| |
|
|
|
|
| |
(Just a change to a comment)
|
| |
|
|
|
|
|
| |
tp_flags. This will become important when I introduce
Py_TPFLAGS_HAVE_RICHCOMPARE (as I should have!).
|
|
|
|
|
|
|
|
|
|
|
|
| |
- In count(), remove(), index(): call RichCompare(Py_EQ).
- Get rid of array_compare(), in favor of new array_richcompare() (a
near clone of list_compare()).
- Aligned items in array_methods initializer and comments for type
struct initializer.
- Folded a few long lines.
|
|
|
|
|
| |
unfortunate consequence of somebody switching from PyArg_Parse to
PyArg_ParseTuple but without changing the argument from a NULL to a tuple.
|
|
|
|
|
|
|
|
| |
Add definitions of INT_MAX and LONG_MAX to pyport.h.
Remove includes of limits.h and conditional definitions of INT_MAX
and LONG_MAX elsewhere.
This closes SourceForge patch #101659 and bug #115323.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
reverse() didn't work at all due to bad arg check.
Fixed that.
Added Brad Chapman to ACKS file, as the proud new owner of two
implicitly copyrighted lines of Python source code <wink>.
Repaired buffer_info's total lack of arg-checking.
Replaced memmove by memcpy in reverse() guts, as memmove is
often slower and the memory areas are guaranteed disjoint.
Replaced poke-and-hope unchecked decl of tmp buffer size by
assert-checked larger tmp buffer.
Got rid of inconsistent spaces before open paren in docstrings.
Added reverse() sanity tests to test_array.py.
|
|
|
|
|
|
|
|
| |
declarations, added some comments where I had to think too hard to
understand what was happening, and changed the primary internal get/set
functions to assert they're passed objects of the correct type instead of
doing runtime tests for that (it's an internal error that "should never
happen", so it's good enough to check it only in the debug build).
|
|
|
|
| |
This should match the situation in the 1.6b1 tree.
|
|
|
|
|
|
| |
Remove some of GCC's warning in -Wstrict-prototypes mode.
This closes SourceForge patch #101342.
|
|
|
|
|
| |
and fwrite return size_t, so it is safer to cast up to the largest type for the
comparison. I believe the cast is required at all to remove compiler warnings.
|
| |
|
|
|
|
| |
changed error messages for extend method from "append" to "extend"
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and a couple of functions that were missed in the previous batches. Not
terribly tested, but very carefully scrutinized, three times.
All these were found by the little findkrc.py that I posted to python-dev,
which means there might be more lurking. Cases such as this:
long
func(a, b)
long a;
long b; /* flagword */
{
and other cases where the last ; in the argument list isn't followed by a
newline and an opening curly bracket. Regexps to catch all are welcome, of
course ;)
|
| |
|
| |
|
|
|
|
| |
Include limits.h if we have it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CHAR_MAX, use hardcoded -128 and 127. This may seem strange, unless
you realize that we're talking about signed bytes here! Bytes are
always 8 bits and 2's complement. CHAR_MIN and CHAR_MAX are
properties of the char data type, which is guaranteed to hold at least
8 bits anyway.
Otherwise you'd get failing tests on platforms where unsigned char is
the default (e.g. AIX).
Thanks, Vladimir Marangozov, for finding this nit!
|
| |
|
| |
|
|
|
|
| |
fromfile(), to hold fread() result.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The cause: Relatively recent (last month) patches to getargs.c added
overflow checking to the PyArg_Parse*() integral formatters thereby
restricting 'b' to unsigned char value and 'h','i', and 'l' to signed
integral values (i.e. if the incoming value is outside of the
specified bounds you get an OverflowError, previous it silently
overflowed).
The problem: This broke the array module (as Fredrik pointed out)
because *its* formatters relied on the loose allowance of signed and
unsigned ranges being able to pass through PyArg_Parse*()'s
formatters.
The fix: This patch fixes the array module to work with the more
strict bounds checking now in PyArg_Parse*().
How: If the type signature of a formatter in the arraymodule exactly
matches one in PyArg_Parse*(), then use that directly. If there is no
equivalent type signature in PyArg_Parse*() (e.g. there is no unsigned
int formatter in PyArg_Parse*()), then use the next one up and do some
extra bounds checking in the array module.
This partially closes SourceForge patch #100506.
|
|
|
|
|
| |
Removed PyErr_BadArgument() calls and replaced them with more useful
error messages.
|
|
|
|
|
|
|
|
|
|
| |
For more comments, read the patches@python.org archives.
For documentation read the comments in mymalloc.h and objimpl.h.
(This is not exactly what Vladimir posted to the patches list; I've
made a few changes, and Vladimir sent me a fix in private email for a
problem that only occurs in debug mode. I'm also holding back on his
change to main.c, which seems unnecessary to me.)
|
|
|
|
|
| |
Attached is patch (against 1.5.2 release) to allow some modules
to be buildable as pyd's (usual &PyType_Type stuff).
|
|
|
|
| |
compilation on NT Alpha. Mostly added casts etc.
|
|
|
|
|
|
|
| |
<bernhard@uwm.edu>.
Added a check that no parameters were passed to byteswap(); previously
allowed any parameters you happened to pass.
|
|
|
|
| |
(for Windows/CE).
|
| |
|
|
|
|
|
| |
-- someone tried to pass in sys.maxint and got bitten by the bogus
calculations.
|
|
|
|
| |
on BeOS or Windows.
|
|
|
|
| |
caller (in import.c) will test for errors and take appropriate action.
|
| |
|
| |
|
|
|
|
| |
the buffer used to hold the array -- for dangerous low-level I/O.
|
| |
|
| |
|