summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Unlink the structseq type from the global list ofMartin v. Löwis2006-04-151-0/+8
| | | | | | | objects before initializing it. It might be linked already if there was a Py_Initialize/Py_Finalize cycle earlier; not unlinking it would break the global list.
* frame_clear(): Explain why it's important to make the frameTim Peters2006-04-151-18/+11
| | | | | look dead right at the start. Use Py_CLEAR for four more frame members.
* frame_traverse(): Use the standard Py_VISIT macro.Tim Peters2006-04-151-16/+14
| | | | | | | Py_VISIT: cast the `op` argument to PyObject* when calling `visit()`. Else the caller has to pay too much attention to this silly detail (e.g., frame_traverse needs to traverse `struct _frame *` and `PyCodeObject *` pointers too).
* Trimmed trailing whitespace.Tim Peters2006-04-151-13/+12
|
* Fix SF#1470508: crash in generator cycle finalization. There were twoPhillip J. Eby2006-04-152-19/+22
| | | | | | | | | | | problems: first, PyGen_NeedsFinalizing() had an off-by-one bug that prevented it from ever saying a generator didn't need finalizing, and second, frame objects cleared themselves in a way that caused their owning generator to think they were still executable, causing a double deallocation of objects on the value stack if there was still a loop on the block stack. This revision also removes some unnecessary close() operations from test_generators that are now appropriately handled by the cycle collector.
* Make Py_BuildValue, PyObject_CallFunction andMartin v. Löwis2006-04-143-28/+92
| | | | PyObject_CallMethod aware of PY_SSIZE_T_CLEAN.
* Change more occurrences of maxsplit to Py_ssize_t.Martin v. Löwis2006-04-131-4/+4
|
* Change maxsplit types to Py_ssize_t.Martin v. Löwis2006-04-131-4/+4
|
* Replace INT_MAX with PY_SSIZE_T_MAX.Martin v. Löwis2006-04-131-2/+2
|
* Replace INT_MAX with PY_SSIZE_T_MAX where string lengthMartin v. Löwis2006-04-131-4/+4
| | | | are concerned.
* Remove another INT_MAX limitationMartin v. Löwis2006-04-131-2/+1
|
* Replace most INT_MAX with PY_SSIZE_T_MAX.Martin v. Löwis2006-04-131-11/+11
|
* Change more ints to Py_ssize_t.Martin v. Löwis2006-04-131-40/+39
|
* Revert 34153: Py_UNICODE should not be signed.Martin v. Löwis2006-04-131-8/+3
|
* spread the extern "C" { } magic pixie dust around. Python itself builds nowAnthony Baxter2006-04-133-0/+28
| | | | | using a C++ compiler. Still lots and lots of errors in the modules built by setup.py, and a bunch of warnings from g++ in the core.
* Add a cast to make code compile with a C++ compiler.Anthony Baxter2006-04-131-1/+1
|
* Don't set gi_frame to Py_None, use NULL instead, eliminating some insanePhillip J. Eby2006-04-121-7/+7
| | | | pointer dereferences.
* Ignore the references to the dummy objects used as deleted keysArmin Rigo2006-04-123-1/+34
| | | | in dicts and sets when computing the total number of references.
* wrap docstrings so they are less than 80 columns. add spaces after commas.Neal Norwitz2006-04-121-3/+5
|
* gen_throw(): The caller doesn't own PyArg_ParseTuple()Tim Peters2006-04-121-3/+1
| | | | | | "O" arguments, so must not decref them. This accounts for why running test_contextlib.test_main() in a loop eventually tried to deallocate Py_None.
* Fix int() and long() to repr() their argument when formatting the exception,Thomas Wouters2006-04-112-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to avoid confusing situations like: >>> int("") ValueError: invalid literal for int(): >>> int("2\n\n2") ValueError: invalid literal for int(): 2 2 Also report the base used, to avoid: ValueError: invalid literal for int(): 2 They now report: >>> int("") ValueError: invalid literal for int() with base 10: '' >>> int("2\n\n2") ValueError: invalid literal for int() with base 10: '2\n\n2' >>> int("2", 2) ValueError: invalid literal for int() with base 2: '2' (Reporting the base could be avoided when base is 10, which is the default, but hrm.) Another effect of these changes is that the errormessage can be longer; before, it was cut off at about 250 characters. Now, it can be up to four times as long, as the unrepr'ed string is cut off at 200 characters, instead. No tests were added or changed, since testing for exact errormsgs is (pardon the pun) somewhat errorprone, and I consider not testing the exact text preferable. The actually changed code is tested frequent enough in the test_builtin test as it is (120 runs for each of ints and longs.)
* _Py_PrintReferenceAddresses,_Py_PrintReferences:Tim Peters2006-04-111-7/+3
| | | | | | | | | | interpolate PY_FORMAT_SIZE_T for refcount display instead of casting refcounts to long. I understand that gcc on some boxes delivers nuisance warnings about this, but if any new ones appear because of this they'll get fixed by magic when the others get fixed.
* Correct casts to char*.Martin v. Löwis2006-04-111-4/+4
|
* Remove "static forward" declaration. Move constructorsMartin v. Löwis2006-04-113-85/+79
| | | | after the type objects.
* Get compiling againNeal Norwitz2006-04-111-1/+1
|
* More low-hanging fruit. Still need to re-arrange some code (or find a betterAnthony Baxter2006-04-115-79/+80
| | | | | solution) in the same way as listobject.c got changed. Hoping for a better solution.
* More C++-compliance. Note especially listobject.c - to get C++ to accept theAnthony Baxter2006-04-118-136/+147
| | | | | | | | | PyTypeObject structures, I had to make prototypes for the functions, and move the structure definition ahead of the functions. I'd dearly like a better way to do this - to change this would make for a massive set of changes to the codebase. There's still some warnings - this is purely to get rid of errors first.
* Patch #837242: id() for large ptr should return a long.Martin v. Löwis2006-04-101-3/+9
|
* SF Patch #1463867: Improved generator finalization to allow generatorsPhillip J. Eby2006-04-101-0/+20
| | | | | | | | that are suspended outside of any try/except/finally blocks to be garbage collected even if they are part of a cycle. Generators that suspend inside of an active try/except or try/finally block (including those created by a ``with`` statement) are still not GC-able if they are part of a cycle, however.
* Remove dead code (reported by HP compiler).Neal Norwitz2006-04-061-8/+5
| | | | Can probably be backported if anyone cares.
* Add PY_SSIZE_T_MIN, as suggested by Ralf W. Grosse-Kunstleve.Martin v. Löwis2006-04-051-1/+1
|
* Make xrange more Py_ssize_t aware, by assuming a Py_ssize_t is always atThomas Wouters2006-04-041-7/+0
| | | | | | | | | | | least as big as a long. I believe this to be a safe assumption that is being made in many parts of CPython, but a check could be added. len(xrange(sys.maxint)) works now, so fix the testsuite's odd exception for 64-bit platforms too. It also fixes 'zip(xrange(sys.maxint), it)' as a portable-ish (if expensive) alternative to enumerate(it); since zip() now calls len(), this was breaking on (real) 64-bit platforms. No additional test was added for that behaviour.
* Allow long integers in PySlice_GetIndices.Martin v. Löwis2006-04-031-3/+3
|
* Use Py_ssize_t in slicesNeal Norwitz2006-04-031-5/+5
|
* Bug #1177964: make file iterator raise MemoryError on too big filesGeorg Brandl2006-03-311-1/+2
|
* SF patch #1458476 with modifications based on discussions in python-dev. ThisBarry Warsaw2006-03-301-1/+68
| | | | | | adds the following API calls: PySet_Clear(), _PySet_Next(), and _PySet_Update(). The latter two are considered non-public. Tests and documentation (for the public API) are included.
* Minor bugs in the __index__ code (PEP 357), with tests.Armin Rigo2006-03-302-34/+24
|
* That one was a mistake.Georg Brandl2006-03-301-1/+1
|
* Remove unnecessary casts in type object initializers.Georg Brandl2006-03-3020-271/+272
|
* Fixed bug #1459029 - unicode reprs were double-escaped.Anthony Baxter2006-03-301-1/+1
| | | | Backed out an old patch from 2000.
* fix a comment.Armin Rigo2006-03-281-1/+1
|
* Tighten an overbroad and misleading assertion.Raymond Hettinger2006-03-261-1/+1
| | | | (Reported by Jim Jewett.)
* Get rid of warnings on some platforms by using %u for a size_t.Neal Norwitz2006-03-251-1/+1
|
* Support throw() of string exceptions.Phillip J. Eby2006-03-251-1/+4
|
* Stop duplicating code and handle slice indices consistently and correctlyNeal Norwitz2006-03-233-44/+24
| | | | wrt to ssize_t.
* Heh -- used the right format for a refcount, but forgotTim Peters2006-03-231-1/+1
| | | | to stop truncating it.
* _Py_NegativeRefcount(): print the full value of ob_refcnt.Tim Peters2006-03-231-3/+2
|
* Update function name to reflect params and stop casting to long to avoid ↵Neal Norwitz2006-03-201-5/+5
| | | | losing data
* Use macro versions instead of function versions when we already know the type.Neal Norwitz2006-03-203-11/+12
| | | | | | | | This will hopefully get rid of some Coverity warnings, be a hint to developers, and be marginally faster. Some asserts were added when the type is currently known, but depends on values from another function.
* Previously, Python code had no easy way to access the contents of aGeorg Brandl2006-03-181-0/+19
| | | | | cell object. Now, a ``cell_contents`` attribute has been added (closes patch #1170323).