summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* SF patch #729395: Dictionary tuningRaymond Hettinger2003-05-071-2/+2
| | | | | Adjust resize argument for dict.update() and dict.copy(). Extends the previous change to dict.__setitem__().
* SF bug #692959: new.function ignores keyword argumentsRaymond Hettinger2003-05-061-1/+4
|
* SF patch #729395: Dictionary tuningRaymond Hettinger2003-05-051-10/+16
| | | | | | | | | | * Increase dictionary growth rate resulting in more sparse dictionaries, fewer lookup collisions, increased memory use, and better cache performance. For dicts with over 50k entries, keep the current growth rate in case an application is suffering from tight memory constraints. * Set the most common case (no resize) to fall-through the test.
* Add notes from python-dev about readonly dictionaries.Raymond Hettinger2003-05-051-0/+21
|
* SF patch 730594: assert from longobject.c, line 1215.Tim Peters2003-05-051-4/+4
| | | | | | | | Some version of gcc in the "RTEMS port running on the Coldfire (m5200) processor" generates bad code for a loop in long_from_binary_base(), comparing the wrong half of an int to a short. The patch changes the decl of the short temp to be an int temp instead. This "simplifies" the code enough that gcc no longer blows it.
* * Note how dummy entry re-use benefits use cases with interspersed deletesRaymond Hettinger2003-05-041-1/+11
| | | | | | | and adds. * Note that dictionary iteration is negatively impacted by additional sparseness.
* Somewhere along the way, the softspace attr of file objects became read-Tim Peters2003-05-041-1/+2
| | | | only. Repaired, and added new tests to test_file.py.
* Patch #708604: Check more function results. Will backport to 2.2.Martin v. Löwis2003-05-031-1/+8
|
* Add a reference to dictnotes.txt. It does no good if you don't know it'sRaymond Hettinger2003-05-031-0/+6
| | | | there or where to find it.
* Research notes and explorations for optimizing Python dictionaries.Raymond Hettinger2003-05-021-0/+189
|
* Silence compiler warnings in VC 7.Jeremy Hylton2003-05-011-2/+2
|
* Squashed new compiler wngs about trying to compare pointers toTim Peters2003-04-242-2/+2
| | | | functions with different signatures.
* SF bug 665835: filter() treatment of str and tuple inconsistentRaymond Hettinger2003-04-242-0/+4
| | | | | | | | As a side issue on this bug, it was noted that list and tuple iterators used macros to directly access containers and would not recognize __getitem__ overrides. If the method is overridden, the patch returns a generic sequence iterator which calls the __getitem__ method; otherwise, it returns a high custom iterator with direct access to container elements.
* Improve the message about metatype/metaclass conflicts.Guido van Rossum2003-04-231-1/+4
|
* Add a useful docstring to enumerate.Jeremy Hylton2003-04-211-1/+6
|
* - bool() called without arguments now returns False rather thanGuido van Rossum2003-04-191-2/+2
| | | | | | | raising an exception. This is consistent with calling the constructors for the other builtin types -- called without argument they all return the false value of that type. (SF patch #724135) Thanks to Alex Martelli.
* _Py_PrintReferenceAddresses(): also print the type name. In real useTim Peters2003-04-181-1/+2
| | | | | | | | | I'm finding some pretty baffling output, like reprs consisting entirely of three left parens. At least this will let us know what type the object is (it's not str -- there's no quote character in the repr). New tool combinerefs.py, to combine the two output blocks produced via PYTHONDUMPREFS.
* _Py_PrintReferences(): Changed to print object address at start of eachTim Peters2003-04-171-1/+16
| | | | | | | | | | | | | | | new line. New pvt API function _Py_PrintReferenceAddresses(): Prints only the addresses and refcnts of the live objects. This is always safe to call, because it has no dependence on Python's C API. Py_Finalize(): If envar PYTHONDUMPREFS is set, call (the new) _Py_PrintReferenceAddresses() right before dumping final pymalloc stats. We can't print the reprs of the objects here because too much of the interpreter has been shut down. You need to correlate the addresses displayed here with the object reprs printed by the earlier PYTHONDUMPREFS call to _Py_PrintReferences().
* SF # 595026: support for masks in getargs.c.Thomas Heller2003-04-172-0/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New functions: unsigned long PyInt_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); unsigned long PyLong_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *); New and changed format codes: b unsigned char 0..UCHAR_MAX B unsigned char none ** h unsigned short 0..USHRT_MAX H unsigned short none ** i int INT_MIN..INT_MAX I * unsigned int 0..UINT_MAX l long LONG_MIN..LONG_MAX k * unsigned long none L long long LLONG_MIN..LLONG_MAX K * unsigned long long none Notes: * New format codes. ** Changed from previous "range-and-a-half" to "none"; the range-and-a-half checking wasn't particularly useful. New test test_getargs2.py, to verify all this.
* - The repr() of a weakref object now shows the __name__ attribute ofGuido van Rossum2003-04-161-6/+15
| | | | | | | the referenced object, if it has one. Also use %p to format pointers consistently, and use <weakproxy ...> in proxy_repr(), to match the type name.
* Sigh. The crucial change was still missing from the previousGuido van Rossum2003-04-161-1/+1
| | | | checkin. :-(
* - super() no longer ignores data descriptors, except __class__. SeeGuido van Rossum2003-04-161-4/+10
| | | | | the thread started at http://mail.python.org/pipermail/python-dev/2003-April/034338.html
* Fix three (!) object leaks in the code for assignment to __bases__.Guido van Rossum2003-04-151-1/+3
|
* Ouch, it's Carlo Verre, not Verre Carlo.Guido van Rossum2003-04-151-1/+1
|
* - pythunrun.c, Py_Finalize(): move the call to _Py_PrintReferences()Guido van Rossum2003-04-151-1/+1
| | | | | | | | | | | | | | | | | | | even farther down, to just before the call to _PyObject_DebugMallocStats(). This required the following changes: - pystate.c, PyThreadState_GetDict(): changed not to raise an exception or issue a fatal error when no current thread state is available, but simply return NULL without raising an exception (ever). - object.c, Py_ReprEnter(): when PyThreadState_GetDict() returns NULL, don't raise an exception but return 0. This means that when printing a container that's recursive, printing will go on and on and on. But that shouldn't happen in the case we care about (see first bullet). - Updated Misc/NEWS and Doc/api/init.tex to reflect changes to PyThreadState_GetDict() definition.
* Close off the "Verre Carlo hack" as discussed on python-dev.Guido van Rossum2003-04-141-0/+22
|
* super_getattro(): kill some dead code; explain a mystery.Guido van Rossum2003-04-141-18/+4
|
* - list.insert(i, x) now interprets negative i as it would beGuido van Rossum2003-04-141-2/+5
| | | | | | interpreted by slicing, so negative values count from the end of the list. This was the only place where such an interpretation was not placed on a list index.
* Attempt to make all the various string *strip methods the same.Neal Norwitz2003-04-102-18/+18
| | | | | | | | | | | * Doc - add doc for when functions were added * UserString * string object methods * string module functions 'chars' is used for the last parameter everywhere. These changes will be backported, since part of the changes have already been made, but they were inconsistent.
* Missing DECREF.Jeremy Hylton2003-04-091-0/+1
|
* Make it possible to call instancemethod() with 2 arguments.Guido van Rossum2003-04-091-2/+2
|
* Reformat a few docstrings that caused line wraps in help() output.Guido van Rossum2003-04-092-12/+12
|
* property_traverse() should also traverse into prop_doc -- there's noGuido van Rossum2003-04-091-0/+1
| | | | | typecheck that guarantees it's a string, and BTW string subclasses could hide references.
* Make staticmethods and classmethods participate in GC.Jeremy Hylton2003-04-081-8/+45
| | | | | | | | | | If a class was defined inside a function, used a static or class method, and used super() inside the method body, it would be caught in an uncollectable cycle. (Simplified version: The static/class method object would point to a function object with a closure that referred to the class.) Bugfix candidate.
* New private API function _PyInstance_Lookup. gc will use this to figureTim Peters2003-04-071-0/+21
| | | | out whether __del__ exists, without executing any Python-level code.
* SF bug #699934: Obscure error messageRaymond Hettinger2003-04-061-4/+2
| | | | | mwh pointed out that the error message did not make sense if obtained by rearranging the bases.
* Change formatchar(), so that u"%c" % 0xffffffff now raisesWalter Dörwald2003-04-021-2/+2
| | | | | an OverflowError instead of a TypeError to be consistent with "%c" % 256. See SF patch #710127.
* Fix PyString_Format() so that '%c' % u'a' returns u'a'Walter Dörwald2003-03-311-0/+7
| | | | | | | | instead of raising a TypeError. (From SF patch #710127) Add tests to verify this is fixed. Add various tests for '%c' % int.
* Rename LONG_LONG to PY_LONG_LONG. Fixes #710285.Martin v. Löwis2003-03-291-22/+22
|
* Refactoring: rename update_these_slots() into update_subclasses() andGuido van Rossum2003-03-241-47/+68
| | | | | generalize to take a callback function and a void * data argument. This might come in handy later... :-)
* Typo in comment.Tim Peters2003-03-231-1/+1
|
* Improved new Py_TRACE_REFS gimmicks.Tim Peters2003-03-232-18/+37
| | | | | | | | | | | Arranged that all the objects exposed by __builtin__ appear in the list of all objects. I basically peed away two days tracking down a mystery leak in sys.gettotalrefcount() in a ZODB app (== tons of code), because the object leaking the references didn't appear in the sys.getobjects(0) list. The object happened to be False. Now False is in the list, along with other popular & previously missing leak candidates (like None). Alas, we still don't have a choke point covering *all* Python objects, so the list of all objects may still be incomplete.
* slot_sq_contains(): This leaked a reference to the result of callingTim Peters2003-03-231-11/+12
| | | | | | __contains__(). Bugfix candidate.
* Refactored some of the Py_TRACE_REFS code. New private API functionTim Peters2003-03-232-10/+26
| | | | | | | _Py_AddToAllObjects() that simply inserts an object at the front of the doubly-linked list of all objects. Changed PyType_Ready() (the closest thing we've got to a choke point for type objects) to call that.
* Oops! Used a wrong preprocessor symbol.Tim Peters2003-03-231-1/+1
|
* When Py_TRACE_REFS is defined, a list of all live objects is maintained inTim Peters2003-03-231-2/+15
| | | | | | | | | | | a doubly-linked list, exposed by sys.getobjects(). Unfortunately, it's not really all live objects, and it seems my fate to bump into programs where sys.gettotalrefcount() keeps going up but where the reference leaks aren't accounted for by anything in the list of all objects. This patch helps a little: if COUNT_ALLOCS is also defined, from now on type objects will also appear in this list, provided at least one object of a type has been allocated.
* _PyFloat_Pack4(): Removed needless call of floor().Tim Peters2003-03-211-1/+1
|
* New private API functions _PyFloat_{Pack,Unpack}(4,8}. This is aTim Peters2003-03-201-0/+313
| | | | | refactoring to get all the duplicates of this delicate code out of the cPickle and struct modules.
* Renamed PyObject_GenericGetIter to PyObject_SelfIterRaymond Hettinger2003-03-177-8/+8
| | | | | | to more accurately describe what the function does. Suggested by Thomas Wouters.
* Created PyObject_GenericGetIter().Raymond Hettinger2003-03-177-51/+14
| | | | Factors out the common case of returning self.