File: //opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyo
�
�A�[c           @   sw   d  Z  d d l Z d d l m Z e Z e j d  Z d e f d �  �  YZ	 d e e	 e � f d �  �  YZ
 d g Z d S(	   s�  
A dict subclass for Python 3 that behaves like Python 2's dict
Example use:
>>> from past.builtins import dict
>>> d1 = dict()    # instead of {} for an empty dict
>>> d2 = dict(key1='value1', key2='value2')
The keys, values and items methods now return lists on Python 3.x and there are
methods for iterkeys, itervalues, iteritems, and viewkeys etc.
>>> for d in (d1, d2):
...     assert isinstance(d.keys(), list)
...     assert isinstance(d.values(), list)
...     assert isinstance(d.items(), list)
i����N(   t   with_metaclassi   t   BaseOldDictc           B   s   e  Z d  �  Z RS(   c         C   s
   t  | t � S(   N(   t
   isinstancet
   _builtin_dict(   t   clst   instance(    (    sC   /opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyt   __instancecheck__   s    (   t   __name__t
   __module__R   (    (    (    sC   /opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyR      s   t   olddictc           B   sq   e  Z d  Z e j Z e j Z d �  Z e j Z e j Z	 d �  Z e j
 Z e j
 Z d �  Z
 d �  Z
 d �  Z RS(   s7   
    A backport of the Python 3 dict object to Py2
    c         C   s   t  t t |  � j �  � S(   N(   t   listt   superR	   t   keys(   t   self(    (    sC   /opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyR   (   s    c         C   s   t  t t |  � j �  � S(   N(   R
   R   R	   t   values(   R
   (    (    sC   /opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyR   .   s    c         C   s   t  t t |  � j �  � S(   N(   R
   R   R	   t   items(   R
   (    (    sC   /opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyR   4   s    c         C   s
   | |  k S(   sC   
        D.has_key(k) -> True if D has a key k, else False
        (    (   R
   t   k(    (    sC   /opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyt   has_key7   s    c         C   s
   t  t |  � S(   s;   
        Hook for the past.utils.native() function
        (   R   t   oldbytes(   R
   (    (    sC   /opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyt
   __native__Y   s    (   R   R   t   __doc__R   R   t   iterkeyst   viewkeysR   t
   itervaluest
   viewvaluesR   t	   iteritemst	   viewitemsR   R   (    (    (    sC   /opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyR	   !   s   										"(   R   t   syst
   past.utilsR    t   dictR   t   version_infot   vert   typeR   R	   t   __all__(    (    (    sC   /opt/alt/python27/lib/python2.7/site-packages/past/types/olddict.pyt   <module>   s   
?