summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* - SF patch 751998 fixes an unwanted side effect of the previous fixGuido van Rossum2003-06-131-5/+13
| | | | for SF bug 742860 (the next item).
* Fixed a comment.Brett Cannon2003-06-111-1/+1
|
* Warn about creating global variables by __setattr__ that shadow builtinNeil Schemenauer2003-06-091-1/+66
| | | | | names. Unfortunately, this is not bulletproof since the module dictionary can be modified directly.
* Fix SF #749831, copy raises SystemError when getstate raises exceptionNeal Norwitz2003-06-081-0/+2
|
* Fix for SF 742911. We now clear the weakrefs *before* calling __del__Guido van Rossum2003-05-291-11/+12
| | | | or emptying __dict__, just as we do for classic classes.
* Add notes on use cases with paired accesses to the same key.Raymond Hettinger2003-05-281-5/+30
|
* * Beefed-up testsRaymond Hettinger2003-05-281-13/+42
| | | | | * Allow tuple re-use * Call tp_iternext directly
* SF bug 705231: Assertion failed, python aborts.Tim Peters2003-05-241-6/+38
| | | | | | | float_pow(): Don't let the platform pow() raise -1.0 to an integer power anymore; at least glibc gets it wrong in some cases. Note that math.pow() will continue to deliver wrong (but platform-native) results in such cases.
* PyType_Ready(): Complain if the type is a base type, and gc'able, andTim Peters2003-05-211-1/+31
| | | | | | | | | | | | | | | | | | tp_free is NULL or PyObject_Del at the end. Because it's a base type it must call tp_free in its dealloc function, and because it's gc'able it must not call PyObject_Del. inherit_slots(): Don't inherit tp_free unless the type and its base agree about whether they're gc'able. If the type is gc'able and the base is not, and the base uses the default PyObject_Del for its tp_free, give the type PyObject_GC_Del for its tp_free (the appropriate default for a gc'able type). cPickle.c: The Pickler and Unpickler types claim to be base classes and gc'able, but their dealloc functions didn't call tp_free. Repaired that. Also call PyType_Ready() on these typeobjects, so that the correct (PyObject_GC_Del) default memory-freeing function gets plugged into these types' tp_free slots.
* SF bug #604716: faster [None]*n or []*nRaymond Hettinger2003-05-211-0/+12
| | | | Fulfilled request to special case repetitions of lists of length 0 or 1.
* Fixing the previous patch to have the changes be to the proper docstrings.Brett Cannon2003-05-201-8/+8
|
* Fix docstrings for __(get|set|del)slice__ to mention that negative indices ↵Brett Cannon2003-05-201-3/+9
| | | | are not supported.
* Only encode Unicode objects when printing them raw.Martin v. Löwis2003-05-181-1/+2
|
* Consider \U-escapes in raw-unicode-escape. Fixes #444514.Martin v. Löwis2003-05-181-3/+42
|
* Removed the out of date and no-longer-referenced xxobject.c exampleJim Fulton2003-05-161-108/+0
| | | | | type implementation. Note that this same example lives in Modules/xxmodule.c. (It is just as out of date there.)
* Patch #734231: Update RiscOS support. In particular, correctMartin v. Löwis2003-05-101-1/+1
| | | | riscospath.extsep, and use os.extsep throughout.
* Patch #612627: Add encoding attribute to file objects, and determineMartin v. Löwis2003-05-101-1/+41
| | | | the terminal encoding on Windows and Unix.
* SF bug #730296: Unexpected Changes in list IteratorRaymond Hettinger2003-05-072-4/+0
| | | | | | | | | | | | Reverted a Py2.3b1 change to iterator in subclasses of list and tuple. They had been changed to use __getitem__ whenever it had been overriden in the subclass. This caused some usabilty and performance problems. Also, it was inconsistent with the rest of python where many container methods access the underlying object directly without first checking for an overridden getter. Users needing a change in iterator behavior should override it directly.
* 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
|