[Zope-Checkins] CVS: Zope3/lib/python/Zope/ContextWrapper - ContainmentIterator.py:1.1.2.3

Martijn Pieters mj@zope.com
Wed, 13 Feb 2002 00:03:38 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/ContextWrapper
In directory cvs.zope.org:/tmp/cvs-serv14206/ContextWrapper

Modified Files:
      Tag: Zope-3x-branch
	ContainmentIterator.py 
Log Message:
Optimizations and code style updates:

  - Use isinstance on type checks

  - Test UnicodeType and StringType through StringTypes

  - Remove use of the string module

  - Use startswith and endswith instead of slices.

  - Fix weird tests where isinstance suffices.


=== Zope3/lib/python/Zope/ContextWrapper/ContainmentIterator.py 1.1.2.2 => 1.1.2.3 ===
     def next(self):
         ob = self._ob
-        if type(ob) is not Wrapper:
+        if not isinstance(ob, Wrapper):
             raise StopIteration
 
         ob = getinnercontext(ob)