[Zope-CVS] CVS: Products/Transience - TransienceInterfaces.py:1.2
Chris McDonough
chrism@zope.com
Tue, 16 Oct 2001 13:57:58 -0400
Update of /cvs-repository/Products/Transience
In directory cvs.zope.org:/tmp/cvs-serv25482
Modified Files:
TransienceInterfaces.py
Log Message:
Added new_or_existing method to StringKeyedHomogeneousItemContainer. Removed set method from StringKeyedHomogeneousItemContainer.
=== Products/Transience/TransienceInterfaces.py 1.1.1.1 => 1.2 ===
class StringKeyedHomogeneousItemContainer(HomogeneousItemContainer):
- def set(self, k, v):
+ def new(self, k):
"""
- Sets key k to value v. "k" must be a string, and "v" must support
- the homogenous item container's subobject interface; a TypeError
- is raised if either condition is untrue.
+ Creates a new subobject of the type supported by this container
+ with key "k" and returns it.
+
+ If an object already exists in the container with key "k", a
+ KeyError is raised.
+
+ "k" must be a string, else a TypeError is raised.
"""
- def new(self, k):
+ def new_or_existing(self, k):
"""
- Creates a new subobject of the type supported by this container
- with key "k". "k" must be a string else a TypeError is raised.
+ If an object already exists in the container with key "k", it
+ is returned.
+
+ Otherwiser, create a new subobject of the type supported by this
+ container with key "k" and return it.
+
+ "k" must be a string, else a TypeError is raised.
"""
class TransientItemContainer(Interface.Base):