summaryrefslogtreecommitdiffstats
path: root/Modules/operator.c
Commit message (Collapse)AuthorAgeFilesLines
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-4/+4
| | | | | | | 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.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-4/+4
|
* #1506171: added operator.methodcaller().Georg Brandl2008-02-231-0/+138
|
* #1826: allow dotted attribute paths in operator.attrgetter.Georg Brandl2008-02-231-3/+48
|
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-4/+2
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Patch #1654417: make operator.{get,set,del}slice use the full rangeGeorg Brandl2007-03-061-13/+11
| | | | of Py_ssize_t.
* Patch #1538606, Patch to fix __index__() clipping.Neal Norwitz2006-08-121-10/+2
| | | | | | | 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.
* Fix more ssize_t problems.Martin v. Löwis2006-04-221-2/+8
|
* Use Py_VISIT in all tp_traverse methods, instead of traversing manually orThomas Wouters2006-04-151-4/+2
| | | | | | | | 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
* Checking in the code for PEP 357.Guido van Rossum2006-03-071-0/+15
| | | | | | This was mostly written by Travis Oliphant. I've inspected it all; Neal Norwitz and MvL have also looked at it (in an earlier incarnation).
* Use Py_ssize_t for counts and sizes.Martin v. Löwis2006-02-161-6/+6
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* adding in-place operators to the operator module.Armin Rigo2005-12-291-1/+41
|
* two missing PyDoc_STR().Armin Rigo2005-12-291-2/+2
|
* Disallow keyword arguments for type constructors that don't use them.Georg Brandl2005-08-261-0/+6
| | | | (fixes bug #1119418)
* operator.itemgetter() and operator.attrgetter() now support extractionRaymond Hettinger2005-03-091-14/+72
| | | | | of multiple fields. This provides direct support for sorting by multiple keys.
* Fix typos.Raymond Hettinger2003-12-041-2/+2
|
* As discussed on python-dev, added two extractor functions to theRaymond Hettinger2003-12-011-2/+225
| | | | operator module.
* SF patch #670423: Add missing identity tests to operator.cRaymond Hettinger2003-01-181-0/+24
|
* SF patch 660559: Use METH_O and METH_NOARGS where possibleRaymond Hettinger2003-01-031-17/+19
| | | | | Simplify code and speed access by using PyArg_UnpackTuple, METH_O and METH_NOARGS in three modules that can benefit from it.
* SF patch #659536: Use PyArg_UnpackTuple where possible.Raymond Hettinger2002-12-291-9/+9
| | | | | | | 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.
* Added __pow__(a,b) to the operator module. Completes the pattern ofRaymond Hettinger2002-08-191-0/+10
| | | | | | all operators having a counterpart in the operator module. Closes SF bug #577513.
* Allow more docstrings to be removed during compilation in some modulesNeal Norwitz2002-08-131-2/+2
|
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-6/+6
|
* Removed old Digital Creations copyright/license notices (withGuido van Rossum2002-04-041-59/+0
| | | | | permission from Paul Everitt). Also removed a few other references to Digital Creations and changed the remaining ones to Zope Corporation.
* Add the 'bool' type and its values 'False' and 'True', as described inGuido van Rossum2002-04-031-7/+13
| | | | | | | | | | | | | PEP 285. Everything described in the PEP is here, and there is even some documentation. I had to fix 12 unit tests; all but one of these were printing Boolean outcomes that changed from 0/1 to False/True. (The exception is test_unicode.py, which did a type(x) == type(y) style comparison. I could've fixed that with a single line using issubtype(x, type(y)), but instead chose to be explicit about those places where a bool is expected. Still to do: perhaps more documentation; change standard library modules to return False/True from predicates.
* Add wrappers around the rich-comparison operations.Fred Drake2001-08-091-1/+22
| | | | | | | This closes SF patch #428320. Add wrappers to expose "floor" and "true" division. This closes SF feature request #449093.
* Add invert() and __invert__() as aliases for inv()/__inv__().Fred Drake2000-09-171-11/+16
| | | | | | | | Add contains() as alias for __contains__(). Make PyArg_ParseTuple() formats include the function name. Based on patch by Denis S. Otkidach <ods@users.sourceforge.net>, this closes SourceForge patch #101390.
* Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters2000-07-211-1/+1
| | | | | | | | | | | | | | | | | | 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 ;)
* Pretensions of the 20th century... remove old-style preprocessorFred Drake2000-07-081-6/+0
| | | | hackery (/**/), leaving only new-style preprocessor hackery (##).
* ANSI-fy the sources.Fred Drake2000-07-081-19/+16
|
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* Add an alias (and preferred name) "contains" for "sequenceIncludes".Guido van Rossum1998-05-221-47/+34
| | | | | | | | Rationalized the doc strings. Also simplify the module initialization -- we don't need a __version__ which is set to "$Rev" :-) and we don't need a fatal error when the initialization fails.
* PySequence_In() -> PySequence_Contains().Guido van Rossum1998-05-221-1/+1
|
* Add not_ and __not__.Guido van Rossum1998-04-091-0/+2
|
* #Plug small memory leaks in constructors.Guido van Rossum1997-09-031-2/+3
|
* Some long variables should have been int to match the 'i' format specifier.Guido van Rossum1997-08-281-3/+3
|
* Tabification changes only; the module was already newly named.Barry Warsaw1996-12-181-32/+37
|
* Correct typo -- repeat implements *, not +.Guido van Rossum1996-12-051-1/+1
|
* Get rid of unused local variable.Guido van Rossum1996-08-211-1/+1
|
* Added delslice and delitem.Guido van Rossum1996-08-211-32/+47
| | | | | | Renamed and, or to and_, or_. Renamed all internal identifiers so as not to start with '__' (which is a compiler privilege); remove AIX hack.
* Made it palatable for K&R preprocessors. The spam macros don't haveGuido van Rossum1996-08-191-46/+53
| | | | | to work as hard (but "stringizing" is still used, so we test the newly introduced HAVE_OLD_CPP config define).
* Added hack to get it to compile on AIX.Guido van Rossum1996-08-081-0/+5
|
* Operators like __add__Guido van Rossum1996-07-301-0/+242