[Zope3-checkins] CVS: Zope3/src/zope/interface/common - __init__.py:1.1.2.1 mapping.py:1.1.2.1

Jim Fulton jim@zope.com
Mon, 23 Dec 2002 14:32:57 -0500


Update of /cvs-repository/Zope3/src/zope/interface/common
In directory cvs.zope.org:/tmp/cvs-serv19908/zope/interface/common

Added Files:
      Tag: NameGeddon-branch
	__init__.py mapping.py 
Log Message:
Initial renaming before debugging

=== Added File Zope3/src/zope/interface/common/__init__.py ===
#
# This file is necessary to make this directory a package.


=== Added File Zope3/src/zope/interface/common/mapping.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
# 
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
# 
##############################################################################
"""
$Id: mapping.py,v 1.1.2.1 2002/12/23 19:32:55 jim Exp $
"""

from zope.interface import Interface

class IReadMapping(Interface):
    """Basic mapping interface
    """

    def __getitem__(key):
        """Get a value for a key

        A KeyError is raised if there is no value for the key.
        """

    def get(key, default=None):
        """Get a value for a key

        The default is returned if there is no value for the key.
        """

    def __contains__(key):
        """Tell if a key exists in the mapping
        """

class IEnumerableMapping(IReadMapping):
    """Mapping objects whose items can be enumerated
    """

    def keys():
        """Return the keys of the mapping object
        """

    def values():
        """Return the values of the mapping object
        """

    def items():
        """Return the items of the mapping object
        """

    def __len__():
        """Return the number of items
        """