Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | [2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479) | Serhiy Storchaka | 2018-07-31 | 1 | -1/+1 |
| | |||||
* | [2.7] bpo-31579: Fixed a possible leak in enumerate() with large indices. ↵ | Serhiy Storchaka | 2017-09-26 | 1 | -3/+9 |
| | | | | | (GH-3753). (#3761) (cherry picked from commit 0e950dd22b075b4809c84afda8aede02b76ac0fa) | ||||
* | #8635: document enumerate() start parameter in docstring. | Georg Brandl | 2010-05-22 | 1 | -3/+4 |
| | |||||
* | Untabify C files. Will watch buildbots. | Antoine Pitrou | 2010-05-09 | 1 | -295/+295 |
| | |||||
* | #6994: fix typo in enumerate docstring | Ezio Melotti | 2009-09-25 | 1 | -1/+1 |
| | |||||
* | handle errors from _PyObject_LookupSpecial when __get__ fails | Benjamin Peterson | 2009-05-25 | 1 | -1/+4 |
| | |||||
* | *sigh* deal with instances correctly | Benjamin Peterson | 2009-05-09 | 1 | -1/+12 |
| | |||||
* | lookup __reversed__ correctly as a special method | Benjamin Peterson | 2009-05-09 | 1 | -3/+8 |
| | |||||
* | Convert from long to Py_ssize_t. | Raymond Hettinger | 2008-07-24 | 1 | -10/+11 |
| | |||||
* | Don't allow keyword arguments to reversed(). | Georg Brandl | 2008-05-16 | 1 | -1/+4 |
| | |||||
* | #2831: add start argument to enumerate(). Patch by Scott Dial and me. | Georg Brandl | 2008-05-13 | 1 | -5/+23 |
| | |||||
* | #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵ | Christian Heimes | 2007-12-19 | 1 | -3/+3 |
| | | | | Py_REFCNT. Macros for b/w compatibility are available. | ||||
* | enumerate() is no longer bounded to using sequences shorter than LONG_MAX. ↵ | Raymond Hettinger | 2007-10-03 | 1 | -6/+49 |
| | | | | The possibility of overflow was sending some newsgroup posters into a tizzy. | ||||
* | PEP 3123: Provide forward compatibility with Python 3.0, while keeping | Martin v. Löwis | 2007-07-21 | 1 | -7/+5 |
| | | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT. | ||||
* | Do not let overflows in enumerate() and count() pass silently. | Raymond Hettinger | 2007-02-08 | 1 | -0/+6 |
| | |||||
* | Use Py_VISIT in all tp_traverse methods, instead of traversing manually or | Thomas Wouters | 2006-04-15 | 1 | -14/+3 |
| | | | | | | | | using a custom, nearly-identical macro. This probably changes how some of these functions are compiled, which may result in fractionally slower (or faster) execution. Considering the nature of traversal, visiting much of the address space in unpredictable patterns, I'd argue the code readability and maintainability is well worth it ;P | ||||
* | More C++-compliance. Note especially listobject.c - to get C++ to accept the | Anthony Baxter | 2006-04-11 | 1 | -2/+0 |
| | | | | | | | | | 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. | ||||
* | Change int to Py_ssize_t in several places. | Martin v. Löwis | 2006-03-07 | 1 | -1/+1 |
| | | | | | Add (int) casts to silence compiler warnings. Raise Python exceptions for overflows. | ||||
* | Revert backwards-incompatible const changes. | Martin v. Löwis | 2006-02-27 | 1 | -1/+1 |
| | |||||
* | Use Py_ssize_t for counts and sizes. | Martin v. Löwis | 2006-02-16 | 1 | -3/+3 |
| | | | | Convert Py_ssize_t using PyInt_FromSsize_t | ||||
* | Merge ssize_t branch. | Martin v. Löwis | 2006-02-15 | 1 | -1/+1 |
| | |||||
* | Renamed _length_cue() to __length_hint__(). See: | Armin Rigo | 2006-02-11 | 1 | -2/+2 |
| | | | | http://mail.python.org/pipermail/python-dev/2006-February/060524.html | ||||
* | en_sit will be freed when en is DECREF'd. Don't double free. | Neal Norwitz | 2005-12-11 | 1 | -1/+0 |
| | |||||
* | Add const to several API functions that take char *. | Jeremy Hylton | 2005-12-10 | 1 | -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 *. | ||||
* | Convert iterator __len__() methods to a private API. | Raymond Hettinger | 2005-09-24 | 1 | -9/+11 |
| | |||||
* | SF patch #1020188: Use Py_CLEAR where necessary to avoid crashes | Raymond Hettinger | 2004-09-01 | 1 | -4/+1 |
| | | | | (Contributed by Dima Dorfman) | ||||
* | Fix docstring typo. | Raymond Hettinger | 2004-08-25 | 1 | -1/+1 |
| | |||||
* | * Add unittests for iterators that report their length | Raymond Hettinger | 2004-04-12 | 1 | -1/+12 |
| | | | | | | * Document the differences between them * Fix corner cases covered by the unittests * Use Py_RETURN_NONE where possible for dictionaries | ||||
* | Tidied up the implementations of reversed (including the custom ones | Raymond Hettinger | 2004-03-10 | 1 | -16/+20 |
| | | | | | | | | | | | | | | | | | for xrange and list objects). * list.__reversed__ now checks the length of the sequence object before calling PyList_GET_ITEM() because the mutable could have changed length. * all three implementations are now tranparent with respect to length and maintain the invariant len(it) == len(list(it)) even when the underlying sequence mutates. * __builtin__.reversed() now frees the underlying sequence as soon as the iterator is exhausted. * the code paths were rearranged so that the most common paths do not require a jump. | ||||
* | Eliminate the double reverse option. It's only use case | Raymond Hettinger | 2004-03-10 | 1 | -13/+1 |
| | | | | was academic and it was potentially confusing to use. | ||||
* | Make reversed() transparent with respect to length. | Raymond Hettinger | 2004-02-10 | 1 | -1/+13 |
| | |||||
* | Let reversed() work with itself. | Raymond Hettinger | 2004-02-08 | 1 | -1/+12 |
| | |||||
* | * Fix ref counting in extend() and extendleft(). | Raymond Hettinger | 2004-02-07 | 1 | -2/+1 |
| | | | | * Let deques support reversed(). | ||||
* | Optimize reversed(list) using a custom iterator. | Raymond Hettinger | 2003-11-07 | 1 | -2/+2 |
| | |||||
* | Implement and apply PEP 322, reverse iteration | Raymond Hettinger | 2003-11-06 | 1 | -0/+125 |
| | |||||
* | Use PyTuple_Pack() to simplify enumerate(). | Raymond Hettinger | 2003-11-02 | 1 | -5/+1 |
| | |||||
* | * Beefed-up tests | Raymond Hettinger | 2003-05-28 | 1 | -13/+42 |
| | | | | | * Allow tuple re-use * Call tp_iternext directly | ||||
* | Add a useful docstring to enumerate. | Jeremy Hylton | 2003-04-21 | 1 | -1/+6 |
| | |||||
* | Renamed PyObject_GenericGetIter to PyObject_SelfIter | Raymond Hettinger | 2003-03-17 | 1 | -1/+1 |
| | | | | | | to more accurately describe what the function does. Suggested by Thomas Wouters. | ||||
* | Created PyObject_GenericGetIter(). | Raymond Hettinger | 2003-03-17 | 1 | -8/+1 |
| | | | | Factors out the common case of returning self. | ||||
* | Remove the next() method -- one is supplied automatically by | Guido van Rossum | 2002-07-16 | 1 | -16/+11 |
| | | | | | | | | PyType_Ready() because the tp_iternext slot is set (fortunately, because using the tp_iternext implementation for the the next() implementation is buggy). Also changed the allocation order in enum_next() so that the underlying iterator is only moved ahead when we have successfully allocated the result tuple and index. | ||||
* | Patch #568124: Add doc string macros. | Martin v. Löwis | 2002-06-13 | 1 | -2/+2 |
| | |||||
* | - New builtin function enumerate(x), from PEP 279. Example: | Guido van Rossum | 2002-04-26 | 1 | -0/+139 |
enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c"). The argument can be an arbitrary iterable object. |