summaryrefslogtreecommitdiffstats
path: root/Objects/structseq.c
Commit message (Collapse)AuthorAgeFilesLines
* Temporarily revert 59967 until GC can be added.Raymond Hettinger2008-01-151-1/+1
|
* Issue 1820: structseq objects did not work with the % formatting operator ↵Raymond Hettinger2008-01-151-1/+1
| | | | | | or isinstance(t, tuple). Orignal patch (without tests) by Leif Walsh.
* Added more comments to the new structseq repr code and implemented several ↵Christian Heimes2008-01-141-17/+36
| | | | of Neal's suggestions.
* I missed the most important fileChristian Heimes2008-01-141-5/+58
|
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-6/+6
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Improve extended slicing support in builtin types and classes. Specifically:Thomas Wouters2007-08-281-1/+54
| | | | | | | | | | | | | | | | | | | | - Specialcase extended slices that amount to a shallow copy the same way as is done for simple slices, in the tuple, string and unicode case. - Specialcase step-1 extended slices to optimize the common case for all involved types. - For lists, allow extended slice assignment of differing lengths as long as the step is 1. (Previously, 'l[:2:1] = []' failed even though 'l[:2] = []' and 'l[:2:None] = []' do not.) - Implement extended slicing for buffer, array, structseq, mmap and UserString.UserString. - Implement slice-object support (but not non-step-1 slice assignment) for UserString.MutableString. - Add tests for all new functionality.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-8/+7
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Klocwork made another run and found a bunch more problems.Neal Norwitz2006-08-121-0/+4
| | | | | | | This is the first batch of fixes that should be easy to verify based on context. This fixes problem numbers: 220 (ast), 323-324 (symtable), 321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree).
* 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.
* Remove unnecessary casts in type object initializers.Georg Brandl2006-03-301-1/+1
|
* Revert backwards-incompatible const changes.Martin v. Löwis2006-02-271-1/+1
|
* Use Py_ssize_t for counts and sizes.Martin v. Löwis2006-02-161-1/+1
| | | | Convert Py_ssize_t using PyInt_FromSsize_t
* Revert 42400.Martin v. Löwis2006-02-161-3/+3
|
* Support %zd in PyErr_Format and PyString_FromFormat.Martin v. Löwis2006-02-161-3/+3
|
* Get rid of compiler warnings (gcc 3.3.4 on x86)Neal Norwitz2006-02-161-3/+3
|
* Merge ssize_t branch.Martin v. Löwis2006-02-151-14/+14
|
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-1/+1
| | | | | | | | | | | | | | | | | | | 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 *.
* Removed all uses of the out-of-favor __safe_for_unpickling__ magicTim Peters2003-02-011-1/+0
| | | | attr, and copy_reg.safe_constructors.
* SF # 654974, fix unchecked return values in structseqNeal Norwitz2002-12-181-2/+6
| | | | | | | Check return values after memory allocation. Also use Py_True instead of PyInt_FromLong(1) for bool value. Backport candidate.
* Add n_unnamed_fields into the type.Martin v. Löwis2002-10-161-5/+15
|
* Add PyStructSequence_UnnamedField. Add stat_float_times.Martin v. Löwis2002-10-161-10/+19
| | | | Use integers in stat tuple, optionally floats in named fields.
* Remove PyMalloc_New and PyMalloc_Del.Neil Schemenauer2002-04-121-2/+2
|
* Use pymalloc if it's enabled.Neil Schemenauer2002-03-221-2/+2
|
* Guido pointed out that I was missing a couple decrefs.Michael W. Hudson2002-03-071-1/+7
|
* Apply (my) patch:Michael W. Hudson2002-03-061-23/+76
| | | | | | | | | | | | | | | | | [ 526072 ] pickling os.stat results round II structseq's constructors can now take "invisible" fields in a dict. Gave the constructors better error messages. their __reduce__ method puts these fields in a dict. (this is all in aid of getting os.stat_result's to pickle portably) Also fixes [ 526039 ] devious code can crash structseqs Thought needed about how much of this counts as a bugfix. Certainly #526039 needs to be fixed.
* A fix & test forMichael W. Hudson2002-03-051-1/+30
| | | | | | | | [ 496873 ] structseqs unpicklable by adding a __reduce__ method to structseqs. Will also commit this to the 2.2.1 branch momentarily.
* structseq_new(): Conversion of sprintf() to PyOS_snprintf() for bufferBarry Warsaw2001-11-281-1/+2
| | | | overrun avoidance.
* Fix bad bug in structseq slicing (NULL pointers in result). Reported byTim Peters2001-10-301-1/+1
| | | | | | Jack Jansen on python-dev. Add simple test case. Move vereq() from test_descr to test_support (it's handy!).
* Missing file structseq.c for SF patch #462296Guido van Rossum2001-10-181-0/+284