summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Add __getnewargs__ method to classes that need it.Guido van Rossum2003-02-071-0/+4
| | | | (Yes, this is an incompatibility. I'll document it in PEP 307.)
* Fix SF bug #667147, Segmentation fault printing str subclassNeal Norwitz2003-01-131-1/+24
| | | | | | | Fix infinite recursion which occurred when printing an object whose __str__() returned self. Will backport
* Fix for SF bug #642358: only provide a new with a __dict__ orGuido van Rossum2003-01-071-0/+14
| | | | | __weaklist__ descriptor if we added __dict__ or __weaklist__, respectively. With unit test.
* Add a test for a feature added in rev. 2.82 of typeobject.c:Guido van Rossum2003-01-061-0/+53
| | | | | | | | | | | | | | - SLOT1BINFULL() macro: changed this to check for __rop__ overriding __op__, like binary_op1() in abstract.c -- the latter only calls the slot function once if both types use the same slot function, so the slot function must make both calls -- which it already did for the __op__, __rop__ order, but not yet for the __rop__, __op__ order when B.__class__ is a subclass of A.__class__. Also test the refinement added in rev. 2.201 that fixes the problem reported in SF bug #623669. Also test a similar provision in abstract.c's binary_op1().
* Add some print statements in verbose mode to announce that the newestGuido van Rossum2003-01-061-0/+8
| | | | | tests are run. (All tests in this module should have one of these at the top.)
* Disable the rexec test now that rexec is out of grace.Guido van Rossum2003-01-061-0/+2
|
* Whitespace normalization.Tim Peters2002-12-241-5/+5
|
* Add test for SF #658106. Will backport.Neal Norwitz2002-12-241-0/+4
|
* Tighten the tests for assignment to __bases__: disallow empty tuple.Guido van Rossum2002-12-131-0/+8
|
* SF 548651: Fix the METH_CLASS implementation.Tim Peters2002-12-091-4/+4
| | | | | | | Most of these patches are from Thomas Heller, with long lines folded by Tim. The change to test_descr.py is from Guido. See the bug report. Not a bugfix candidate -- METH_CLASS is new in 2.3.
* Nudge getting __module__ and __name__ for new-style classes so thatMichael W. Hudson2002-11-271-1/+9
| | | | | | | the results of *setting* __name__ are not so surprising. If people can suggest more tests, that'd be grand, or is what's there sufficient?
* I don't know why staring at the email to python-checkins made meMichael W. Hudson2002-11-271-0/+2
| | | | | | | see problems with my code that I didn't see before the checkin, but: When a subtype .mro() fails, we need to reset the type whose __bases__ are being changed, too. Fix + test.
* Readjustments to the way we cope with exceptions from subclasses'Michael W. Hudson2002-11-271-2/+79
| | | | | | mro() methods. Now any exception aborts the whole __bases__ change. And more tests.
* I had the inheritance cycle stuff backwards. Oops!Michael W. Hudson2002-11-271-0/+8
|
* The MRO conflict error message depends on dictionary hash order.Guido van Rossum2002-11-271-4/+4
| | | | Avoid depending on this in the test.
* This is my patch:Michael W. Hudson2002-11-261-0/+89
| | | | | | | | | | | | [ 635933 ] make some type attrs writable Plus a couple of extra tests beyond what's up there. It hasn't been as carefully reviewed as it perhaps should, so all readers are encouraged, nay exhorted, to give this a close reading. There are still a couple of oddities related to assigning to __name__, but I intend to solicit python-dev's opinions on these.
* A tweaked version of Jeremy's patch #642489, to produce better errorGuido van Rossum2002-11-251-0/+31
| | | | | messages about MRO conflicts. (Tweaks here: don't print the message, but compare it with an expected string.)
* Remove duplicate testNeal Norwitz2002-11-231-2/+0
|
* Patch #642500 with slight modifications: allow keyword arguments inJust van Rossum2002-11-231-11/+12
| | | | | | | dict() constructor. Example: >>> dict(a=1, b=2) {'a': 1, 'b': 2} >>>
* Fix or disable some tests that were affected by the new C3 MROGuido van Rossum2002-11-141-20/+79
| | | | algorithm, and add some new tests for the C3 algorithm.
* Fix SF # 624982, Potential AV in slot_sq_item, by Greg ChapmanNeal Norwitz2002-10-181-0/+12
| | | | Don't crash when getting value of a property raises an exception
* For some reason (probably cut and paste), __ipow__ for new-styleGuido van Rossum2002-10-151-0/+11
| | | | | | | | | | | | | | classes was called with three arguments. This makes no sense, there's no way to pass in the "modulo" 3rd argument as for __pow__, and classic classes don't do this. [SF bug 620179] I don't want to backport this to 2.2.2, because it could break existing code that has developed a work-around. Code in 2.2.2 that wants to use __ipow__ and wants to be forward compatible with 2.3 should be written like this: def __ipow__(self, exponent, modulo=None): ...
* Code by Inyeol Lee, submitted to SF bug 595350, to implementGuido van Rossum2002-08-231-4/+0
| | | | | the string/unicode method .replace() with a zero-lengt first argument. Inyeol contributed tests for this too.
* Add tests for including __dict__ and/or __weakref__ in __slots__.Guido van Rossum2002-08-131-1/+50
| | | | Add some more rigor to slotmultipleinheritance().
* Add test for SF bug # 575229, multiple inheritance w/ slots dumps coreNeal Norwitz2002-08-131-0/+11
| | | | Fix already checked in by Guido
* Disallow class assignment completely unless both old and new are heapGuido van Rossum2002-08-101-0/+5
| | | | | types. This prevents nonsense like 2.__class__ = bool or True.__class__ = int.
* Test for Neil's fix to correctly invoke __rmul__.Guido van Rossum2002-08-091-0/+16
|
* Add testcase for SF bug 574207 (chained __slots__ dealloc segfault).Guido van Rossum2002-08-061-0/+14
| | | | Fix forthcoming.
* SF patch 588728 (Nathan Srebro).Guido van Rossum2002-08-011-4/+11
| | | | | | | | The __delete__ method wrapper for descriptors was not supported (I added a test, too.) 2.2 bugfix candidate.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* subtype_resurrection(): Removed unused import.Tim Peters2002-07-111-1/+0
|
* subtype_resurrection(): The test suite with -l properly reported theTim Peters2002-07-111-2/+13
| | | | immortal object here as a leak. Made the object mortal again at the end.
* Repaired optimistic comment in new test.Tim Peters2002-07-111-4/+3
|
* Added a test that provokes the hypothesized (in my last checkin comment)Tim Peters2002-07-111-0/+20
| | | | | | | | | | | debug-build failure when an instance of a new-style class is resurrected by a __del__ method -- we simply never had any code that tried this. This is already fixed in 2.3 CVS. In 2.2.1, it blows up via Fatal Python error: GC object already in linked list I'll fix it in 2.2.1 CVS next.
* Fix SF bug 572567: Memory leak in object comparison.Raymond Hettinger2002-06-241-0/+12
|
* SF 569257 -- Name mangle double underscored variable names in __slots__.Raymond Hettinger2002-06-201-0/+18
|
* Patch from SF bug 570483 (Tim Northover).Guido van Rossum2002-06-181-0/+6
| | | | | | In a fresh interpreter, type.mro(tuple) would segfault, because PyType_Ready() isn't called for tuple yet. To fix, call PyType_Ready(type) if type->tp_dict is NULL.
* Test for the bug in recurse_down_subclasses() that I just fixed.Guido van Rossum2002-06-141-0/+10
|
* Hopefully this addresses the remaining issues of SF bugs 459235 andGuido van Rossum2002-06-131-0/+46
| | | | | | 473985. Through a subtle rearrangement of some members in the etype struct (!), mapping methods are now preferred over sequence methods, which is necessary to support str.__getitem__("hello", slice(4)) etc.
* Fix from SF patch 565085: copy._reduction doesn't __setstate__.Guido van Rossum2002-06-061-0/+29
| | | | | | Straightforward fix. Will backport to 2.2. If there's ever a new 2.1 release, this could be backported there too (since it's an issue with anything that's got both a __reduce__ and a __setstate__).
* Address SF bug 519621: slots weren't traversed by GC.Guido van Rossum2002-06-041-0/+51
| | | | | | | | | | | | | | While I was at it, I added a tp_clear handler and changed the tp_dealloc handler to use the clear_slots helper for the tp_clear handler. Also tightened the rules for slot names: they must now be proper identifiers (ignoring the dirty little fact that <ctype.h> is locale sensitive). Also set mp->flags = READONLY for the __weakref__ pseudo-slot. Most of this is a 2.2 bugfix candidate; I'll apply it there myself.
* Test repair now that module.__init__ requires a name and initializesGuido van Rossum2002-06-041-6/+7
| | | | __name__ and __doc__.
* The warning filter was ineffective when this module was invoked as aGuido van Rossum2002-06-031-1/+1
| | | | script.
* Fix for SF bug 551412. When _PyType_Lookup() is called on a typeGuido van Rossum2002-05-241-0/+16
| | | | | | whose tp_mro hasn't been initialized, it would dump core. Fix this by checking for NULL and calling PyType_Ready(). Will fix this in 2.2.1 too.
* Jim Fulton reported a segfault in dir(). A heavily proxied objectGuido van Rossum2002-05-131-0/+20
| | | | | | | | returned a proxy for __class__ whose __bases__ was also a proxy. The merge_class_dict() helper for dir() assumed incorrectly that __bases__ would always be a tuple and used the in-line tuple API on the proxy. I will backport this to 2.2 as well.
* ceval.c/do_raise(): Tighten the test to disallow raising an instance ofTim Peters2002-04-181-0/+26
| | | | | | | | a str subclass. test_descr.py/string_exceptions(): New sub-test. For 2.3 only. Guido doesn't want this backported.
* SF bug 542984.Guido van Rossum2002-04-181-0/+20
| | | | | | | | | | | Change type_get_doc (the get function for __doc__) to look in tp_dict more often, and if it finds a descriptor in tp_dict, to call it (with a NULL instance). This means you can add a __doc__ descriptor to a new-style class that returns instance docs when called on an instance, and class docs when called on a class -- or the same docs in either case, but lazily computed. I'll also check this into the 2.2 maintenance branch.
* SF bug 544647.Guido van Rossum2002-04-161-0/+27
| | | | | | | | | PyNumber_InPlaceMultiply insisted on calling sq_inplace_repeat if it existed, even if nb_inplace_multiply also existed and the arguments weren't right for sq_inplace_repeat. Change this to only use sq_inplace_repeat if nb_inplace_multiply isn't defined. Bugfix candidate.
* Fewer deprecation warnings.Tim Peters2002-04-161-0/+5
|
* SF bug #541883 (Vincent Fiack).Guido van Rossum2002-04-151-0/+6
| | | | | | | A stupid bug in object_set_class(): didn't check for value==NULL before checking its type. Bugfix candidate.