summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
Commit message (Collapse)AuthorAgeFilesLines
* allow any number to be returned from __length_hint__ (closes #15354)Benjamin Peterson2012-07-151-1/+1
|
* Make an error message more understandable and consistent with other error ↵Raymond Hettinger2011-11-201-1/+1
| | | | messages.
* Issue #9869: Make long() and PyNumber_Long return something of typeMark Dickinson2010-09-261-1/+8
| | | | | | | long for a class whose __long__ method returns a plain int. This fixes an interpreter crash (due to long_subtype_new assuming PyNumber_Long returns a long) when initializing an instance of a long subclass from an object whose __long__ method returns a plain int.
* Merged revisions 84391 via svnmerge fromAntoine Pitrou2010-09-011-9/+9
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84391 | antoine.pitrou | 2010-09-01 14:58:21 +0200 (mer., 01 sept. 2010) | 5 lines Issue #3101: Helper functions _add_one_to_C() and _add_one_to_F() become _Py_add_one_to_C() and _Py_add_one_to_F(), respectively. ........
* _PyObject_LookupSpecial returns a new referenceBenjamin Peterson2010-06-051-0/+1
|
* remove PyType_Ready call; float should be initialized in interpreter startupBenjamin Peterson2010-06-051-6/+1
|
* properly lookup the __format__ special methodBenjamin Peterson2010-06-051-21/+11
|
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-2248/+2248
|
* Pull a NULL pointer check up to cover more cases in the function.Brett Cannon2010-05-041-2/+4
| | | | Found using Clang's static analyzer.
* Issue 7994: Make object.__format__ with a non-empty format string a ↵Eric Smith2010-04-021-11/+36
| | | | PendingDecprecationWarning. Still need to remove uses of this from various tests.
* substitute PyDict_Check() for PyObject_IsInstanceBenjamin Peterson2009-12-101-1/+1
|
* handle errors from _PyObject_LookupSpecial when __get__ failsBenjamin Peterson2009-05-251-2/+11
|
* completely ignore old-style stuff for type checking overloadingBenjamin Peterson2009-05-161-52/+30
|
* deal with old-style classes in issubclass and isinstanceBenjamin Peterson2009-05-161-2/+2
|
* properly lookup __instancecheck__ and __subclasscheck__Benjamin Peterson2009-05-161-13/+25
|
* clear error state properlyBenjamin Peterson2009-05-091-0/+1
|
* ignore AttributeErrors for classic classesBenjamin Peterson2009-05-091-1/+2
|
* ignore classic classesBenjamin Peterson2009-05-091-0/+2
|
* convert some more special methods to use _PyObject_LookupSpecialBenjamin Peterson2009-05-091-13/+8
|
* "not subscriptable" should be a bit more understandable than "unsubscriptable".Georg Brandl2009-04-181-1/+1
|
* Issue #2396: backport the memoryview object.Antoine Pitrou2009-04-021-2/+2
|
* Issue #5341: Fix a variety of spelling errors.Mark Dickinson2009-02-211-1/+1
|
* Remove redundant assignment in _PyObject_LengthHintMark Dickinson2009-02-081-1/+1
|
* Validate that __length_hint__ returns a usable result.Raymond Hettinger2009-02-031-1/+1
|
* Issue 1242657: list(obj) can swallow KeyboardInterrupt.Raymond Hettinger2009-02-021-14/+19
|
* Fixed compile error on windows.Hirokazu Yamamoto2009-01-251-1/+1
|
* fix building the core with --disable-unicodeBenjamin Peterson2009-01-251-0/+14
| | | | | I changed some bytearray methods to use strings instead of unicode like bytes_repr Also, bytearray.fromhex() can take strings as well as unicode
* #3720: Interpreter crashes when an evil iterator removes its own next function.Amaury Forgeot d'Arc2009-01-121-1/+0
| | | | | | Now the slot is filled with a function that always raises. Will not backport: extensions compiled with 2.6.x would not run on 2.6.0.
* Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as toAntoine Pitrou2008-08-261-80/+91
| | | | | | | | | | match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__ mechanism. In the process, fix a bug where isinstance() and issubclass(), when given a tuple of classes as second argument, were looking up __instancecheck__ / __subclasscheck__ on the tuple rather than on each type object. Reviewed by Benjamin Peterson and Raymond Hettinger.
* Fix memory leak: Always DECREF obj in PyBuffer_Release.Martin v. Löwis2008-08-141-5/+3
|
* Make obj an owned reference in Py_buffer; this checkinMartin v. Löwis2008-08-141-1/+4
| | | | was missing from the patch for #3139.
* Issue #3139: Make buffer-interface thread-safe wrt. PyArg_ParseTuple,Martin v. Löwis2008-08-121-20/+22
| | | | | | | by denying s# to parse objects that have a releasebuffer procedure, and introducing s*. More module might need to get converted to use s*.
* Correct grammar.Skip Montanaro2008-07-071-1/+1
|
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-22/+22
| | | | | | | 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.
* Remove locking part of new buffer protocol.Travis E. Oliphant2008-06-061-6/+0
|
* Renamed PyString to PyBytesChristian Heimes2008-05-261-22/+22
|
* Prevent namespace pollution, add static for internal functionsNeal Norwitz2008-04-151-2/+2
|
* Remove unnecessary traceback save/restore pair.Raymond Hettinger2008-03-191-4/+2
|
* Fix compiler warning.Raymond Hettinger2008-03-191-1/+1
|
* Speed-up isinstance() for one easy case.Raymond Hettinger2008-03-181-0/+5
|
* Finish backporting new buffer API to Python 2.6. Left to do: memoryview ↵Travis E. Oliphant2008-03-181-0/+369
| | | | object and structmodule. But, these need to be finished in Python 3.0 first. No objects support the new buffer API in Python 2.6 as of yet, and except for the memoryview object, I don't think they will.
* Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith2008-02-171-0/+132
| | | | | | | | | | | | | | | Highlights: - Adding PyObject_Format. - Adding string.Format class. - Adding __format__ for str, unicode, int, long, float, datetime. - Adding builtin format. - Adding ''.format and u''.format. - str/unicode fixups for formatters. The files in Objects/stringlib that implement PEP 3101 (stringdefs.h, unicodedefs.h, formatter.h, string_format.h) are identical in trunk and py3k. Any changes from here on should be made to trunk, and changes will propogate to py3k).
* In PyNumber_ToBase, changed from an assert to returning an error when ↵Eric Smith2008-02-151-1/+5
| | | | PyObject_Index() returns something other than an int or long. It should never be possible to trigger this, as PyObject_Index checks to make sure it returns an int or long.
* Use a static and interned string for __subclasscheck__ and __instancecheck__ ↵Christian Heimes2008-02-141-2/+16
| | | | as suggested by Thomas Heller in #2115
* Added PyNumber_ToBase and supporting routines _PyInt_Format andEric Smith2008-02-101-0/+19
| | | | | | | | | | | | | | | | | _PyLong_Format. In longobject.c, changed long_format to _PyLong_Format. In intobject.c, changed uses of PyOS_snprintf to _PyInt_Format instead. _PyLong_Format is similar to py3k's routine of the same name, except it has 2 additional parameters: addL and newstyle. addL was existing in long_format, and controls adding the trailing "L". This is unneeded in py3k. newstyle is used to control whether octal prepends "0" (the pre-2.6 style), or "0o" (the 3.0 sytle). PyNumber_ToBase is needed for PEP 3127 (Integer Literal Support and Syntax) and PEP 3101 (Advanced String Formatting). This changeset does not need merging into py3k.
* Make int() and long() fall back to __trunc__(). See issue 2002.Jeffrey Yasskin2008-02-041-0/+94
|
* static PyObject* variables should use PyString_InternFromString() instead of ↵Christian Heimes2008-01-281-2/+2
| | | | PyObject_FromString() to store a python string in a function level static var.
* Fix Issue 1045.Raymond Hettinger2007-12-061-30/+38
| | | | | Factor-out common calling code by simplifying the length_hint API. Speed-up the function by caching the PyObject_String for the attribute lookup.
* merge -r59315:59316 from py3k: Fix issue #1553: An errornous __length_hint__ ↵Christian Heimes2007-12-051-2/+3
| | | | can make list() raise a SystemError
* Properly indent two lines. (Spotted because it caused merge conflicts in theThomas Wouters2007-09-181-2/+2
| | | | py3k branch ;)