On 8/15/06, Neal Norwitz <[EMAIL PROTECTED]> wrote:
> I was playing around with a little patch to avoid that penalty.  It
> doesn't take any additional memory, just a handful of bits we aren't
> using. :-)
>
> For the more common builtin types, it stores whether it's a subclass
> in tp_flags, so there's no function call necessary and it's a constant
> time operation.  It was faster when doing simple stuff.  Haven't
> thought much whether this is really worthwhile or not.

I like it! I wonder if you should use another bit for "inherits from
BaseException". That would make catching and raising exceptions a bit
faster. It applies cleanly to py3k -- perhaps you should just check it
in there? +1 from me!

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to