ó
o®¸Qc           @   ss   d  Z  d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ e d e f i d e ƒ  6ƒ Z e j GHd	 S(
   sR  
There is a way to put keys of any type in a type's dictionary.
I think this allows various kinds of crashes, but so far I have only
found a convoluted attack of _PyType_Lookup(), which uses the mro of the
type without holding a strong reference to it.  Probably works with
super.__getattribute__() too, which uses the same kind of code.
t   MyKeyc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s
   t  d ƒ S(   Nt   mykey(   t   hash(   t   self(    (    s3   /sys/lib/python2.7/test/crashers/loosing_mro_ref.pyt   __hash__
   s    c         C   sC   t  f t _ g  } x* t d ƒ D] } | j | d  d  f ƒ q Wd S(   Niè  iÿÿÿÿ(   t   Base2t   Xt	   __bases__t   ranget   appendt   None(   R   t   othert   zt   i(    (    s3   /sys/lib/python2.7/test/crashers/loosing_mro_ref.pyt   __cmp__   s
    (   t   __name__t
   __module__R   R   (    (    (    s3   /sys/lib/python2.7/test/crashers/loosing_mro_ref.pyR    	   s   	t   Basec           B   s   e  Z d  Z RS(   s	   from Base(   R   R   R   (    (    (    s3   /sys/lib/python2.7/test/crashers/loosing_mro_ref.pyR      s   R   c           B   s   e  Z d  Z RS(   s
   from Base2(   R   R   R   (    (    (    s3   /sys/lib/python2.7/test/crashers/loosing_mro_ref.pyR      s   R   i   N(   t   __doc__t   objectR    R   R   t   typeR   R   (    (    (    s3   /sys/lib/python2.7/test/crashers/loosing_mro_ref.pyt   <module>   s
   