[Python-checkins] python/dist/src/Lib sets.py,1.41,1.42
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
2003年2月13日 19:42:13 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv16656/Lib
Modified Files:
sets.py
Log Message:
SF bug #663701: sets module review
Renamed hook methods to use the double underscore convention.
Index: sets.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** sets.py 9 Feb 2003 06:40:57 -0000 1.41
--- sets.py 14 Feb 2003 03:42:11 -0000 1.42
***************
*** 249,253 ****
return element in self._data
except TypeError:
! transform = getattr(element, "_as_temporarily_immutable", None)
if transform is None:
raise # re-raise the TypeError exception we caught
--- 249,253 ----
return element in self._data
except TypeError:
! transform = getattr(element, "__as_temporarily_immutable__", None)
if transform is None:
raise # re-raise the TypeError exception we caught
***************
*** 326,330 ****
return
except TypeError:
! transform = getattr(element, "_as_immutable", None)
if transform is None:
raise # re-raise the TypeError exception we caught
--- 326,330 ----
return
except TypeError:
! transform = getattr(element, "__as_immutable__", None)
if transform is None:
raise # re-raise the TypeError exception we caught
***************
*** 336,340 ****
data[element] = value
except TypeError:
! transform = getattr(element, "_as_immutable", None)
if transform is None:
raise # re-raise the TypeError exception we caught
--- 336,340 ----
data[element] = value
except TypeError:
! transform = getattr(element, "__as_immutable__", None)
if transform is None:
raise # re-raise the TypeError exception we caught
***************
*** 465,469 ****
self._data[element] = True
except TypeError:
! transform = getattr(element, "_as_immutable", None)
if transform is None:
raise # re-raise the TypeError exception we caught
--- 465,469 ----
self._data[element] = True
except TypeError:
! transform = getattr(element, "__as_immutable__", None)
if transform is None:
raise # re-raise the TypeError exception we caught
***************
*** 478,482 ****
del self._data[element]
except TypeError:
! transform = getattr(element, "_as_temporarily_immutable", None)
if transform is None:
raise # re-raise the TypeError exception we caught
--- 478,482 ----
del self._data[element]
except TypeError:
! transform = getattr(element, "__as_temporarily_immutable__", None)
if transform is None:
raise # re-raise the TypeError exception we caught
***************
*** 497,505 ****
return self._data.popitem()[0]
! def _as_immutable(self):
# Return a copy of self as an immutable set
return ImmutableSet(self)
! def _as_temporarily_immutable(self):
# Return self wrapped in a temporarily immutable set
return _TemporarilyImmutableSet(self)
--- 497,505 ----
return self._data.popitem()[0]
! def __as_immutable__(self):
# Return a copy of self as an immutable set
return ImmutableSet(self)
! def __as_temporarily_immutable__(self):
# Return self wrapped in a temporarily immutable set
return _TemporarilyImmutableSet(self)