summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Repair refcounting on error return from type_set_bases.Michael W. Hudson2003-08-071-3/+6
| | | | Include a test case that failed for one of my efforts to repair this.
* Remove code that tried to warn about shadowing builtin names after aNeil Schemenauer2003-07-161-66/+1
| | | | module had been compiled. It gives too many spurious warnings.
* Remove stray comments.Jeremy Hylton2003-07-161-1/+0
|
* Remove unnecessary check in tests for slots allowed.Jeremy Hylton2003-07-161-1/+1
| | | | | | | The !PyType_Check(base) check snuck in as part of rev 2.215, but was unrelated to the SF patch that is mentioned in the checkin comment. The test is currently unnecessary because base is set to the return value of best_bases(), which returns a type or NULL.
* Remove proxy_print(), since that caused an inconsistency betweenFred Drake2003-07-141-10/+2
| | | | | "print repr(proxy(a))" and "proxy(a)" at an interactive prompt. Closes SF bug #722763.
* Add whitespace.Jeremy Hylton2003-07-111-3/+3
|
* Support 'mbcs' as a 'built-in' encoding, so the C API can use it withoutMark Hammond2003-07-011-0/+19
| | | | | defering to the encodings package. As described in [ 763111 ] mbcs encoding should skip encodings package
* Fix SF 762891: "del p[key]" on proxy object raises SystemError()Raymond Hettinger2003-06-301-1/+5
|
* SF patch 703666: Several objects don't decref tmp on failure in subtype_newRaymond Hettinger2003-06-284-4/+13
| | | | | | Submitted By: Christopher A. Craig Fillin some missing decrefs.
* Require that __nonzero__() return a bool or exactly an int.Jeremy Hylton2003-06-271-6/+2
|
* Check return type of __nonzero__() method.Jeremy Hylton2003-06-271-1/+13
| | | | | | The language reference says you must return an int or a bool. This fix limits the scope of SF bug 759227 (infinite recursion) to subclasses of int.
* Whitespace normalization.Walter Dörwald2003-06-251-3/+3
|
* Fix whitespace.Walter Dörwald2003-06-181-1/+1
|
* SF bug #753451: classmethod abuse --> SystemErrorRaymond Hettinger2003-06-181-0/+6
| | | | | | Check the argument to classmethod for callability. Backport candidate.
* Fix typo in comment.Walter Dörwald2003-06-171-1/+1
|
* Use _PyEval_SliceIndex to handle list.index() calls withWalter Dörwald2003-06-171-1/+3
| | | | huge start and stop arguments. Add tests.
* Whitespace normalization.Walter Dörwald2003-06-171-6/+6
|
* Fix sloppy index() implementation:Guido van Rossum2003-06-171-2/+12
| | | | | - don't use min() and max() - interpret negative start/stop argument like negative slice indices
* SF #754014: list.index() should accept optional start, end argumentsRaymond Hettinger2003-06-171-5/+10
| | | | Also, modified UserList.index() to match and expanded the related tests.
* - 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.