cpython/Include
Neal Norwitz ee3a1b5244 Variation of patch # 1624059 to speed up checking if an object is a subclass
of some of the common builtin types.

Use a bit in tp_flags for each common builtin type.  Check the bit
to determine if any instance is a subclass of these common types.
The check avoids a function call and O(n) search of the base classes.
The check is done in the various Py*_Check macros rather than calling
PyType_IsSubtype().

All the bits are set in tp_flags when the type is declared
in the Objects/*object.c files because PyType_Ready() is not called
for all the types.  Should PyType_Ready() be called for all types?
If so and the change is made, the changes to the Objects/*object.c files
can be reverted (remove setting the tp_flags).  Objects/typeobject.c
would also have to be modified to add conditions
for Py*_CheckExact() in addition to each the PyType_IsSubtype check.
2007-02-25 19:44:48 +00:00
..
Python-ast.h Modify Parser/asdl_c.py so that the __version__ number for Python/Python-ast.c 2007-02-12 03:51:02 +00:00
Python.h Patch #1495999: Part two of Windows CE changes. 2006-06-10 12:23:46 +00:00
abstract.h Patch #1580872: Remove duplicate declaration of PyCallable_Check. 2006-10-22 10:46:18 +00:00
asdl.h Introduce asdl_int_seq, to hold cmpop_ty. 2006-04-13 12:29:43 +00:00
ast.h
bitset.h
boolobject.h
bufferobject.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
cStringIO.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
cellobject.h
ceval.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
classobject.h
cobject.h
code.h with and as are now keywords. There are some generated files I can't recreate. 2006-09-06 06:28:06 +00:00
codecs.h Patch #1436130: codecs.lookup() now returns a CodecInfo object (a subclass 2006-03-15 11:35:15 +00:00
compile.h Don't abbreviate ABS, use long name ABSOLUTE. 2006-04-03 06:26:32 +00:00
complexobject.h
datetime.h
descrobject.h
dictobject.h Variation of patch # 1624059 to speed up checking if an object is a subclass 2007-02-25 19:44:48 +00:00
enumobject.h
errcode.h
eval.h
fileobject.h
floatobject.h
frameobject.h Get rid of f_restricted too. Doc the other 4 ints that were already removed 2006-06-12 02:11:18 +00:00
funcobject.h
genobject.h Don't set gi_frame to Py_None, use NULL instead, eliminating some insane 2006-04-12 19:07:15 +00:00
graminit.h PEP 343 -- the with-statement. 2006-02-27 22:32:47 +00:00
grammar.h
import.h SF #1542693: Remove semi-colon at end of PyImport_ImportModuleEx macro 2006-08-19 04:25:29 +00:00
intobject.h Variation of patch # 1624059 to speed up checking if an object is a subclass 2007-02-25 19:44:48 +00:00
intrcheck.h
iterobject.h
listobject.h Variation of patch # 1624059 to speed up checking if an object is a subclass 2007-02-25 19:44:48 +00:00
longintrepr.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
longobject.h Variation of patch # 1624059 to speed up checking if an object is a subclass 2007-02-25 19:44:48 +00:00
marshal.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
metagrammar.h
methodobject.h
modsupport.h Add check for the PyArg_ParseTuple format, and declare 2006-10-19 10:58:46 +00:00
moduleobject.h
node.h Patch #1440601: Add col_offset attribute to AST nodes. 2006-03-01 22:49:05 +00:00
object.h Variation of patch # 1624059 to speed up checking if an object is a subclass 2007-02-25 19:44:48 +00:00
objimpl.h frame_traverse(): Use the standard Py_VISIT macro. 2006-04-15 03:22:46 +00:00
opcode.h PEP 343 -- the with-statement. 2006-02-27 22:32:47 +00:00
osdefs.h Define MAXPATHLEN to be at least PATH_MAX, if that's defined. Python uses 2006-04-25 15:29:46 +00:00
parsetok.h with and as are now keywords. There are some generated files I can't recreate. 2006-09-06 06:28:06 +00:00
patchlevel.h Set version to 2.6a0, seems more consistent. 2006-08-18 05:41:46 +00:00
pgen.h
pgenheaders.h
py_curses.h
pyarena.h Added words about what PyArena_Malloc() does. 2006-03-02 21:14:45 +00:00
pydebug.h
pyerrors.h Variation of patch # 1624059 to speed up checking if an object is a subclass 2007-02-25 19:44:48 +00:00
pyexpat.h Upgrade pyexpat to expat 2.0.0 (http://python.org/sf/1462338). 2006-06-19 23:21:25 +00:00
pyfpe.h
pygetopt.h
pymactoolbox.h
pymem.h Years in the making. 2006-03-26 23:27:58 +00:00
pyport.h Add check for the PyArg_ParseTuple format, and declare 2006-10-19 10:58:46 +00:00
pystate.h After approval from Anthony, merge the tim-current_frames 2006-07-10 21:08:24 +00:00
pystrtod.h Merge ssize_t branch. 2006-02-15 17:27:45 +00:00
pythonrun.h Don't abbreviate ABS, use long name ABSOLUTE. 2006-04-03 06:26:32 +00:00
pythread.h Patch #1454481: Make thread stack size runtime tunable. 2006-06-13 15:04:24 +00:00
rangeobject.h
setobject.h Use Py_ssize_t 2006-06-19 05:40:44 +00:00
sliceobject.h Stop duplicating code and handle slice indices consistently and correctly 2006-03-23 06:03:08 +00:00
stringobject.h Variation of patch # 1624059 to speed up checking if an object is a subclass 2007-02-25 19:44:48 +00:00
structmember.h Allow for ssize_t field offsets. 2006-02-16 14:23:19 +00:00
structseq.h
symtable.h Patch #1346214: correctly optimize away "if 0"-style stmts 2006-06-04 21:56:52 +00:00
sysmodule.h
timefuncs.h
token.h
traceback.h
tupleobject.h Variation of patch # 1624059 to speed up checking if an object is a subclass 2007-02-25 19:44:48 +00:00
ucnhash.h Avoid forward-declaring the methods array. 2006-03-10 11:20:04 +00:00
unicodeobject.h Variation of patch # 1624059 to speed up checking if an object is a subclass 2007-02-25 19:44:48 +00:00
weakrefobject.h _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long. 2006-08-02 06:14:22 +00:00