[Patches] [ python-Patches-1624059 ] fast subclasses of builtin types

SourceForge.net noreply at sourceforge.net
Fri Dec 29 07:04:12 CET 2006


Patches item #1624059, was opened at 2006-12-28 22:01
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1624059&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.6
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: Guido van Rossum (gvanrossum)
Summary: fast subclasses of builtin types

Initial Comment:
This is similar to a patch posted on python-dev a few months ago (or more).  I modified it to also handle subclassing exceptions which should speed up exception handling a bit.  (This was proposed by Guido based on the original patch.)  I also dropped an extra bit that was going to indicate if it was a builtin type or a subclass of a builtin type.

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2006-12-28 22:04

Message:
Logged In: YES 
user_id=33168
Originator: YES

I forgot to mention this patch works by using unused bits in tp_flags. 
This saves a function call when checking for a subclass of a builtin type.

There's one funky thing about this patch, the change to
Objects/exceptions.c.  I didn't investigate why this was necessary, or more
likely I did why when I added it and forgot.  I know that without adding
BASE_EXC_SUBCLASS to tp_flags, test_exceptions fails.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1624059&group_id=5470


More information about the Patches mailing list