[Zope3-checkins] CVS: Zope3/src/zope/app/event - subs.py:1.21
Jeremy Hylton
cvs-admin at zope.org
Tue Nov 4 22:08:54 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/event
In directory cvs.zope.org:/tmp/cvs-serv25892/app/event
Modified Files:
subs.py
Log Message:
Remove code that isn't needed now that we require Python 2.3.
Cases include future statements for generators, special case
definitions of builtins like basestring and enumerate, a few uses of
types that are unnecessary.
=== Zope3/src/zope/app/event/subs.py 1.20 => 1.21 ===
--- Zope3/src/zope/app/event/subs.py:1.20 Mon Nov 3 16:37:59 2003
+++ Zope3/src/zope/app/event/subs.py Tue Nov 4 22:08:20 2003
@@ -16,14 +16,11 @@
$Id$
"""
-from __future__ import generators
from zope.exceptions import NotFoundError
from persistence import Persistent
from zodb.btrees.OOBTree import OOBTree
from zodb.btrees.IOBTree import IOBTree
-from types import StringTypes
-
from zope.proxy import removeAllProxies
from zope.app.traversing import getPath
@@ -35,21 +32,12 @@
from zope.app.services.servicenames import HubIds
from zope.app.services.type import PersistentTypeRegistry
from cPickle import dumps, PicklingError
-import logging
from zope.interface import implements
from zope.app.container.contained import Contained
-__metaclass__ = type
+import logging
-try:
- enumerate # python 2.3
-except NameError:
- def enumerate(collection):
- 'Generates an indexed series: (0,coll[0]), (1,coll[1]) ...'
- count = 0
- for item in collection:
- yield count, item
- count += 1
+__metaclass__ = type
class Subscribable(Persistent, Contained):
"""A local mix-in"""
@@ -501,7 +489,7 @@
except NotFoundError:
path = getPath(wrappedobj)
cleanobj = removeAllProxies(wrappedobj)
- elif isinstance(clean_reference, StringTypes):
+ elif isinstance(clean_reference, basestring):
reftype = unicode
path = canonicalPath(clean_reference)
try:
More information about the Zope3-Checkins
mailing list