summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_abc.py
Commit message (Collapse)AuthorAgeFilesLines
* python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patchFedora Python maintainers2020-09-291-2/+8
| | | | | | | | 00128 # 2.7.1 (in r84230) added a test to test_abc which fails if python is configured with COUNT_ALLOCS, which is the case for our debug build (the COUNT_ALLOCS instrumentation keeps "C" alive). Not yet sent upstream
* [2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var (GH-3927)Victor Stinner2017-10-171-0/+1
| | | | | | | | | | | | | | | | bpo-31692, bpo-19527: * Add a new PYTHONSHOWALLOCCOUNT environment variable, similar to the Python 3 "-X showalloccount" option * When Python is compiled with COUNT_ALLOCS, the new PYTHONSHOWALLOCCOUNT environment variable now has to be set to dump allocation counts into stderr on shutdown. Moreover, allocations statistics are now dumped into stderr rather than stdout. * Add @test.support.requires_type_collecting decorator: skip test if COUNT_ALLOCS is defined * Fix tests for COUNT_ALLOCS: decorate some methods with @requires_type_collecting * test_sys.test_objecttypes(): update object type when COUNT_ALLOCS is defined
* Merged revisions 87952-87954 via svnmerge fromBenjamin Peterson2011-01-121-7/+0
| | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87952 | benjamin.peterson | 2011-01-12 09:24:27 -0600 (Wed, 12 Jan 2011) | 1 line move this test to test_descr; it's not abc specific ........ r87953 | benjamin.peterson | 2011-01-12 09:25:02 -0600 (Wed, 12 Jan 2011) | 1 line oops, wrong class ........ r87954 | benjamin.peterson | 2011-01-12 09:34:01 -0600 (Wed, 12 Jan 2011) | 1 line don't segfault on deleting __abstractmethods__ #10892 ........
* Merged revisions 85154 via svnmerge fromBenjamin Peterson2010-10-021-0/+7
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85154 | benjamin.peterson | 2010-10-01 19:03:31 -0500 (Fri, 01 Oct 2010) | 1 line type.__abstractmethods__ should raise an AttributeError #10006 ........
* Use weakrefs to hold onto classes #2521.Benjamin Peterson2010-08-211-1/+17
| | | | This also causes the _weakref module to be built into the core.
* Merged revisions 84125 via svnmerge fromBenjamin Peterson2010-08-171-18/+18
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84125 | benjamin.peterson | 2010-08-16 20:07:53 -0500 (Mon, 16 Aug 2010) | 1 line use assertTrue/assertFalse ........
* raise a clear TypeError when trying to register a non-classBenjamin Peterson2010-01-271-0/+6
|
* use assert[Not]IsInstance where appropriateEzio Melotti2010-01-241-12/+12
|
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-26/+26
|
* Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as toAntoine Pitrou2008-08-261-0/+23
| | | | | | | | | | 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.
* Make isinstance(OldstyleClass, NewstyleClass) return False instead of raisingJeffrey Yasskin2008-03-171-0/+11
| | | | an exception. Issue reported by Joseph Armbruster.
* Since abc._Abstract was replaces by a new type flags the regression test ↵Christian Heimes2008-03-031-0/+5
| | | | suite fails. I've added a new function inspect.isabstract(). Is the mmethod fine or should I check if object is a instance of type or subclass of object, too?
* Patch #2167 from calvin: Remove unused importsChristian Heimes2008-02-231-1/+0
|
* Working on issue #1762: BroughtJeffrey Yasskin2008-02-131-0/+10
| | | | | | | | ./python.exe -m timeit -s 'from fractions import Fraction; f = Fraction(3, 2)' 'isinstance(3, Fraction); isinstance(f, Fraction)' from 12.3 usec/loop to 3.44 usec/loop and ./python.exe -m timeit -s 'from fractions import Fraction' 'Fraction(3, 2)' from 48.8 usec to 23.6 usec by avoiding genexps and sets in __instancecheck__ and inlining the common case from __subclasscheck__.
* Fix issue 1747: allow classic classes to be checked for being subclasses ofJeffrey Yasskin2008-01-071-4/+11
| | | | ABCs.
* Backport of _abccoll.py by Benjamin Arangueren, issue 1383.Guido van Rossum2007-11-221-0/+14
| | | | With some changes of my own thrown in (e.g. backport of r58107).
* Patch # 1026 by Benjamin Aranguren (with Alex Martelli):Guido van Rossum2007-09-101-0/+142
Backport abc.py and isinstance/issubclass overloading to 2.6. I had to backport test_typechecks.py myself, and make one small change to abc.py to avoid duplicate work when x.__class__ and type(x) are the same.