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.
This commit is contained in:
Jeffrey Yasskin 2008-02-28 04:45:36 +00:00
parent c105289ec4
commit 960b9b7a2f
4 changed files with 108 additions and 48 deletions

View file

@ -209,6 +209,7 @@ Instead, you can get the same information from the list type:
'__setitem__',
'__setslice__',
'__str__',
'__subclasshook__',
'append',
'count',
'extend',