mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
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:
parent
c105289ec4
commit
960b9b7a2f
4 changed files with 108 additions and 48 deletions
|
@ -209,6 +209,7 @@ Instead, you can get the same information from the list type:
|
|||
'__setitem__',
|
||||
'__setslice__',
|
||||
'__str__',
|
||||
'__subclasshook__',
|
||||
'append',
|
||||
'count',
|
||||
'extend',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue