ó i­:Oc@s^dZyddlmZWn!ek r=ddlmZnXdefd„ƒYZdZdS(s§ ---------- StrictDict ---------- :class:`kitchen.collections.StrictDict` provides a dictionary that treats :class:`str` and :class:`unicode` as distinct key values. iÿÿÿÿ(t defaultdictt StrictDictcBsJeZdZd„Zd„Zd„Zd„ZeZd„Zd„Z RS(sQ Map class that considers :class:`unicode` and :class:`str` different keys Ordinarily when you are dealing with a :class:`dict` keyed on strings you want to have keys that have the same characters end up in the same bucket even if one key is :class:`unicode` and the other is a byte :class:`str`. The normal :class:`dict` type does this for :term:`ASCII` characters (but not for anything outside of the :term:`ASCII` range.) Sometimes, however, you want to keep the two string classes strictly separate, for instance, if you're creating a single table that can map from :class:`unicode` characters to :class:`str` characters and vice versa. This class will help you do that by making all :class:`unicode` keys evaluate to a different key than all :class:`str` keys. .. seealso:: :class:`dict` for documentation on this class's methods. This class implements all the standard :class:`dict` methods. Its treatment of :class:`unicode` and :class:`str` keys as separate is the only difference. cCstj|t|ƒ|fƒS(N(Rt __getitem__trepr(tselftkey((sB/usr/lib/python2.7/site-packages/kitchen/collections/strictdict.pyRBscCs#tj|t|ƒ|f|ƒdS(N(Rt __setitem__R(RRtvalue((sB/usr/lib/python2.7/site-packages/kitchen/collections/strictdict.pyREscCs tj|t|ƒ|fƒdS(N(Rt __delitem__R(RR((sB/usr/lib/python2.7/site-packages/kitchen/collections/strictdict.pyRHsccs'x tj|ƒD]}|dVqWdS(Ni(Rt__iter__(Rti((sB/usr/lib/python2.7/site-packages/kitchen/collections/strictdict.pyR KscCst|jƒƒS(N(tlistR (R((sB/usr/lib/python2.7/site-packages/kitchen/collections/strictdict.pytkeysQscCstj|t|ƒ|fƒS(N(Rt __contains__R(RR((sB/usr/lib/python2.7/site-packages/kitchen/collections/strictdict.pyR Ts( t__name__t __module__t__doc__RRRR titerkeysR R (((sB/usr/lib/python2.7/site-packages/kitchen/collections/strictdict.pyR)s     N(R(Rt collectionsRt ImportErrortkitchen.pycompat25.collectionsRt__all__(((sB/usr/lib/python2.7/site-packages/kitchen/collections/strictdict.pyts  .