Change hasattr to has_key in DT_String.py String::__call__

Bug #143213 reported by Ken Brush
2
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Low
Unassigned

Bug Description

the mapping object is always a dictionary, has_key is much faster than hasattr in this case. This patch improves performance, slightly.

Tags: bugday
Revision history for this message
Ken Brush (shiruken) wrote :
Tres Seaver (tseaver)
Changed in zope2:
status: New → Triaged
tags: added: bugday
removed: bug+solution zope
Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

I believe some assumptions here are wrong. The fact that "taintWrapper" is looked for at all insinuates that the mapping object may be a REQUEST object, which has the method "taintWrapper". Since it is a method, lookup via "hasattr" is correct.

Changed in zope2:
status: Triaged → Invalid
assignee: nobody → Jens Vagelpohl (jens-dataflake)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.