[Zope-Checkins] CVS: Zope3/lib/python/Zope/I18n/tests - testITranslationService.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/I18n/tests
In directory cvs.zope.org:/tmp/cvs-serv14206/I18n/tests

Modified Files:
      Tag: Zope-3x-branch
	testITranslationService.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/I18n/tests/testITranslationService.py 1.1.2.2 => 1.1.2.3 ===
 from Zope.I18n.ITranslationService import ITranslationService
 from Zope.I18n.IInterpolationVariable import IInterpolationVariable
+from types import StringType
 
 
 class TestITranslationService(unittest.TestCase):
@@ -144,7 +145,7 @@
         result = []
         text = []
         for elem in t:
-            if type(elem) is type(''):
+            if isinstance(elem, StringType):
                 text.append(elem)
             else: