summaryrefslogtreecommitdiff
path: root/Objects/sliceobject.c
AgeCommit message (Collapse)AuthorLines
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-224/+224
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
2009-04-20Merged revisions 71734,71738-71739 via svnmerge fromBenjamin Peterson-1/+1
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71734 | benjamin.peterson | 2009-04-18 17:15:26 -0500 (Sat, 18 Apr 2009) | 1 line many more types to initialize (I had to expose some of them) ........ r71738 | benjamin.peterson | 2009-04-18 21:32:42 -0500 (Sat, 18 Apr 2009) | 1 line initialize weakref some weakref types ........ r71739 | benjamin.peterson | 2009-04-18 21:40:43 -0500 (Sat, 18 Apr 2009) | 1 line make errors consistent ........
2008-06-20Issue #3004: Minor fix to slice.indices(). slice(-10).indices(9) nowMark Dickinson-2/+3
returns (0, 0, 1) instead of (0, -1, 1), and slice(None, 10, -1).indices(10) returns (9, 9, -1) instead of (9, 10, -1).
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-9/+9
http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
2008-05-26Renamed PyString to PyBytesChristian Heimes-9/+9
2007-12-19#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes-1/+1
Py_REFCNT. Macros for b/w compatibility are available.
2007-07-21PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis-6/+5
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
2007-04-11SF 1191699: Make slices picklableRaymond Hettinger-0/+10
2006-08-12Patch #1538606, Patch to fix __index__() clipping.Neal Norwitz-1/+1
I modified this patch some by fixing style, some error checking, and adding XXX comments. This patch requires review and some changes are to be expected. I'm checking in now to get the greatest possible review and establish a baseline for moving forward. I don't want this to hold up release if possible.
2006-04-03Allow long integers in PySlice_GetIndices.Martin v. Löwis-3/+3
2006-04-03Use Py_ssize_t in slicesNeal Norwitz-5/+5
2006-03-30Remove unnecessary casts in type object initializers.Georg Brandl-20/+20
2006-03-23Stop duplicating code and handle slice indices consistently and correctlyNeal Norwitz-0/+19
wrt to ssize_t.
2006-02-15Merge ssize_t branch.Martin v. Löwis-6/+7
2005-08-26Disallow keyword arguments for type constructors that don't use them.Georg Brandl-0/+3
(fixes bug #1119418)
2003-09-05SF bug #800796: Difference between hash() and __hash__()Raymond Hettinger-1/+8
slice(5).__hash__() now raises a TypeError.
2002-12-29SF patch #659536: Use PyArg_UnpackTuple where possible.Raymond Hettinger-1/+1
Obtain cleaner coding and a system wide performance boost by using the fast, pre-parsed PyArg_Unpack function instead of PyArg_ParseTuple function which is driven by a format string.
2002-11-06Handle really big steps in extended slices.Michael W. Hudson-5/+2
Fixes a test failure on 64 bit platforms (I hope).
2002-11-05Some days, I think my comment ofMichael W. Hudson-6/+12
/* this is harder to get right than you might think */ angered some God somewhere. After noticing >>> range(5000000)[slice(96360, None, 439)] [] I found that my cute test for the slice being empty failed due to overflow. Fixed, and added simple test (not the above!).
2002-09-12Fix for platforms where int != long.Michael W. Hudson-1/+1
2002-07-19Silly typo. Not sure how that got in.Michael W. Hudson-1/+1
2002-07-19A few days ago, Guido said (in the thread "[Python-Dev] PythonMichael W. Hudson-1/+34
version of PySlice_GetIndicesEx"): > OK. Michael, if you want to check in indices(), go ahead. Then I did what was needed, but didn't check it in. Here it is.
2002-06-14SF patch 568629 by Oren Tirosh: types made callable.Guido van Rossum-1/+31
These built-in functions are replaced by their (now callable) type: slice() buffer() and these types can also be called (but have no built-in named function named after them) classobj (type name used to be "class") code function instance instancemethod (type name used to be "instance method") The module "new" has been replaced with a small backward compatibility placeholder in Python. A large portion of the patch simply removes the new module from various platform-specific build recipes. The following binary Mac project files still have references to it: Mac/Build/PythonCore.mcp Mac/Build/PythonStandSmall.mcp Mac/Build/PythonStandalone.mcp [I've tweaked the code layout and the doc strings here and there, and added a comment to types.py about StringTypes vs. basestring. --Guido]
2002-06-11Fix for problem reported by Neal Norwitz. Tighten up calculation ofMichael W. Hudson-3/+5
slicelength. Include his test case.
2002-06-11This is my nearly two year old patchMichael W. Hudson-0/+53
[ 400998 ] experimental support for extended slicing on lists somewhat spruced up and better tested than it was when I wrote it. Includes docs & tests. The whatsnew section needs expanding, and arrays should support extended slices -- later.
2002-04-12Remove PyMalloc_New and PyMalloc_Del.Neil Schemenauer-2/+2
2002-03-22Use pymalloc if it's enabled.Neil Schemenauer-2/+2
2001-10-30Add values to tp_getattro and tp_flags so that dir(Ellipsis) willGuido van Rossum-14/+20
return the same as dir(None).
2001-09-20Add optional docstrings to member descriptors. For backwardsGuido van Rossum-1/+1
compatibility, this required all places where an array of "struct memberlist" structures was declared that is referenced from a type's tp_members slot to change the type of the structure to PyMemberDef; "struct memberlist" is now only used by old code that still calls PyMember_Get/Set. The code in PyObject_GenericGetAttr/SetAttr now calls the new APIs PyMember_GetOne/SetOne, which take a PyMemberDef argument. As examples, I added actual docstrings to the attributes of a few types: file, complex, instance method, super, and xxsubtype.spamlist. Also converted the symtable to new style getattr.
2001-08-02Merge of descr-branch back into trunk.Tim Peters-35/+35
2001-03-20SF patch #408326 by Robin Thomas: slice objects comparable, notGuido van Rossum-3/+23
hashable This patch changes the behavior of slice objects in the following manner: - Slice objects are now comparable with other slice objects as though they were logically tuples of (start,stop,step). The tuple is not created in the comparison function, but the comparison behavior is logically equivalent. - Slice objects are not hashable. With the above change to being comparable, slice objects now cannot be used as keys in dictionaries. [I've edited the patch for style. Note that this fixes the problem that dict[i:j] seemed to work but was meaningless. --GvR]
2000-12-14Test for NULL returned from PyObject_NEW().Guido van Rossum-0/+3
2000-07-09ANSI-fication of the sources.Fred Drake-19/+7
2000-05-03Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum-3/+2
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.)
1996-10-11Ellipses -> Ellipsis rename (the dictionary really says that it shouldGuido van Rossum-9/+9
be Ellipsis!). Bumped the API version because a linker-visible symbol is affected. Old C code will still compile -- there's a b/w compat macro. Similarly, old Python code will still run, builtin exports both Ellipses and Ellipsis.
1996-07-30repr("...") -> "Ellipses"Guido van Rossum-1/+1
1996-07-30Added sliceobject.cGuido van Rossum-0/+184