]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT,
authorJeffrey Yasskin <jyasskin@gmail.com>
Thu, 28 Feb 2008 04:45:36 +0000 (04:45 +0000)
committerJeffrey Yasskin <jyasskin@gmail.com>
Thu, 28 Feb 2008 04:45:36 +0000 (04:45 +0000)
commit960b9b7a2f6e9b4f0e6b692d604c53b3fd2f5d1c
tree9f0cc6bac83e4c2607c6bea64249932fc5353859
parentc105289ec4e22f5d53f3e5872ad6a49da8a33b6d
Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT,
which forbids constructing types that have it set. The effect is to speed

  ./python.exe -m timeit -s 'import abc' -s 'class Foo(object): __metaclass__ = abc.ABCMeta' 'Foo()'

up from 2.5us to 0.201us. This fixes issue 1762.
Include/object.h
Lib/abc.py
Lib/test/test_descrtut.py
Objects/typeobject.c