I couldn't help myself. Such a beautiful thing had to be spread, and it was *easy* to put it in 3.0 because types are simpler. A patch is here:
http://bugs.python.org/issue1568 If users are going to be encouraged to subclass from the ABC hierarchy for new container and numeric types, they'll likely want something like this. Both pybench and pystones are faster (pystones because its classes are now instances of type), and those exercise attribute lookups on classes with MROs no larger than 2. The pybench scores are good in general (with all lookups very good), except SpecialClassAttribute, which spends half its time doing class attribute assignments. Another surprise is TryRaiseExcept - why should that be faster? I found updating caches from setattr to be faster than invalidating entries. (It could easily go back to invalidating all entries for a type if that's preferred.) Adding extra TPFLAGS was unnecessary. It still assumes attribute names are interned (it doesn't have to but it's a little faster this way), but AFAIK this could only affect computed names. Neil _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com