ó
ŒwÛjc           @   sÑ  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 m
 Z
 e a d f  d „  ƒ  YZ d f  d „  ƒ  YZ d „  Z d „  Z d	 „  Z d
 f  d „  ƒ  YZ d f  d „  ƒ  YZ e j d d „ ƒ Z d e j f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d  d l	 m Z d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d Z i e d 6Z  d „  Z! e" d  k rÍe! ƒ  n  d S(!   iÿÿÿÿN(   t   test_supportt   Cc           B   s   e  Z d  „  Z RS(   c         C   s   d  S(   N(    (   t   self(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   method   s    (   t   __name__t
   __module__R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR      s   t   Callablec           B   s   e  Z d Z d  „  Z RS(   c         C   s   | |  _  d  S(   N(   t   bar(   R   t   x(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __call__   s    N(   R   R   t   NoneR   R	   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR      s   c          C   s   d „  }  |  S(   Nc           S   s   d  S(   N(    (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   f   t    (    (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   create_function   s    	c           C   s
   t  ƒ  j S(   N(   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   create_bound_method    s    c           C   s   t  j S(   N(   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   create_unbound_method#   s    t   Objectc           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  d  S(   N(   t   arg(   R   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __init__(   s    c         C   s   d |  j  S(   Ns   <Object %r>(   R   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __repr__*   s    c         C   s#   t  | t ƒ r |  j | j k St S(   N(   t
   isinstanceR   R   t   NotImplemented(   R   t   other(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __eq__,   s    c         C   s#   t  | t ƒ r |  j | j k St S(   N(   R   R   R   R   (   R   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __ne__0   s    c         C   s   t  |  j ƒ S(   N(   t   hashR   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __hash__4   s    (   R   R   R   R   R   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   '   s
   				t   RefCyclec           B   s   e  Z d  „  Z RS(   c         C   s   |  |  _  d  S(   N(   t   cycle(   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   8   s    (   R   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   7   s   gü©ñÒMbP?c      	   #   s�   t  j d ƒ } t ‰ ‡  ‡ f d †  } t  j ƒ  �d t j ƒ  } t j d ƒ | j d | ƒ } | j ƒ  z	 d VWd t	 ‰ | j
 ƒ  t j | ƒ XWd QXd S(   sR   
    Ensure GC collections happen in a different thread, at a high frequency.
    t	   threadingc              s(   x! ˆ s# t  j ˆ  ƒ t j ƒ  q Wd  S(   N(   t   timet   sleept   gct   collect(    (   t   periodt   please_stop(    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR!   D   s    	i   t   targetN(   R    t   import_modulet   Falset
   disable_gct   syst   getcheckintervalt   setcheckintervalt   Threadt   startt   Truet   join(   R"   R   R!   t   old_intervalt   t(    (   R"   R#   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   collect_in_thread<   s    
	
t   TestBasec           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   d |  _  d  S(   Ni    (   t   cbcalled(   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   setUpX   s    c         C   s   |  j  d 7_  d  S(   Ni   (   R3   (   R   t   ref(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   callback[   s    (   R   R   R4   R6   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR2   V   s   	t   ReferencesTestCasec           B   s‚  e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e  j! d „  ƒ Z" d „  Z# d  „  Z$ d! „  Z% d" „  Z& d# „  Z' d$ „  Z( d% „  Z) d& „  Z* d' „  Z+ d( „  Z, RS()   c         C   sg   |  j  t ƒ |  j  t ƒ |  j  t ƒ |  j  t ƒ t ƒ  } t j | ƒ } t | ƒ ~ t | ƒ d  S(   N(   t   check_basic_refR   R   R   R   t   weakrefR5   t   repr(   R   t   ot   wr(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_basic_refa   s    	
c         C   s8   |  j  t ƒ |  j  t ƒ |  j  t ƒ |  j  t ƒ d  S(   N(   t   check_basic_callbackR   R   R   R   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_basic_callbackp   s    c         C   sv   t  ƒ  } t j | |  j ƒ } t j | |  j ƒ } ~ |  j | ƒ  d ƒ |  j | ƒ  d ƒ |  j |  j d d ƒ d  S(   Ns$   expected reference to be invalidatedi   s-   callback not called the right number of times(   R   R9   R5   R6   t   assertIsNonet   assertEqualR3   (   R   R;   t   ref1t   ref2(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_multiple_callbacksv   s    	c         C   sC   |  d „ } t  ƒ  } t j | | ƒ |  _ t j | | ƒ } ~ d  S(   Nc         S   s   | j  ƒ  d  S(   N(   R5   (   t   objectR   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR6   ‹   s    (   R   R9   R5   (   R   R6   t   cRB   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_multiple_selfref_callbacks€   s
    	c         C   s)   t  ƒ  } |  j t t j | d d  ƒd  S(   NR6   (   R   t   assertRaisest	   TypeErrorR9   R5   R
   (   R   RF   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_constructor_kwargs’   s    	c         C   s­   t  ƒ  } d | _ t j | |  j ƒ } t j | |  j ƒ } ~ d „  } |  j t j | | ƒ |  j t j | | ƒ |  j t j t t j t  ƒ  ƒ ƒ |  j |  j	 d ƒ d  S(   Ni   c         S   s   |  j  d  S(   N(   R   (   t   proxy(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   check�   s    i   (
   R   R   R9   RK   R6   RH   t   ReferenceErrort   boolRA   R3   (   R   R;   RB   RC   RL   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_proxy_ref–   s    			"c         C   sK   | ƒ  } t  j | ƒ } |  j | ƒ  d ƒ | ƒ  } |  j | | d ƒ d  S(   Ns,   weak reference to live object should be lives-   <ref>() should return original object if live(   R9   R5   t   assertIsNotNonet   assertIs(   R   t   factoryR;   R5   t   o2(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR8   ¥   s    		c         C   sW   d |  _  | ƒ  } t j | |  j ƒ } ~ |  j |  j  d d ƒ |  j | ƒ  d ƒ d  S(   Ni    i   s(   callback did not properly set 'cbcalled's3   ref2 should be dead after deleting object reference(   R3   R9   R5   R6   RA   R@   (   R   RR   R;   R5   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR>   ®   s    		c         C   sÑ   t  ƒ  } t j | ƒ } t j | ƒ } t j | ƒ } |  j | | d ƒ t  ƒ  } t j | ƒ } t j | ƒ } t j | ƒ } |  j | | d ƒ |  j t j | ƒ d d ƒ ~ |  j t j | ƒ d d ƒ d  S(   Ns1   reference object w/out callback should be re-usedi   s   wrong weak ref count for objecti   s4   wrong weak ref count for object after deleting proxy(   R   R9   R5   RK   RQ   RA   t   getweakrefcount(   R   R;   RB   RK   RC   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_ref_reuse¸   s"    		c         C   sM   t  ƒ  } t j | ƒ } t j | ƒ } t j | ƒ } |  j | | d ƒ d  S(   Ns4   proxy object w/out callback should have been re-used(   R   R9   RK   R5   RQ   (   R   R;   t   proxy1R5   t   proxy2(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_proxy_reuseÎ   s    	c      
   C   sÚ  t  ƒ  } |  j | t j | ƒ ƒ t j ƒ  } t j | ƒ } |  j | d ƒ | j d ƒ |  j t | ƒ d ƒ |  j	 | d ƒ t
 j ƒ  � d d g | (Wd  QX|  j t | ƒ d ƒ |  j t | ƒ d ƒ |  j d | d ƒ d | d <|  j | d d ƒ |  j | d d ƒ t j | ƒ } t j | ƒ } |  j | | ƒ t j t d	 ƒ ƒ } t j | ƒ } t
 j ƒ  �e |  j | | ƒ |  j | d | d ƒ |  j | d  | d  ƒ |  j | d d !| d d !ƒ Wd  QXd  S(
   Ns(   proxy for empty UserList should be falsei   i   s+   proxy for non-empty UserList should be truei   i   s,   proxy didn't support __contains__() properlyi   i
   (   R   t   check_proxyR9   RK   t   UserListt   assertFalset   appendRA   t   lent
   assertTrueR    t   check_py3k_warningst   assertInt   range(   R   R;   t   Lt   pt   L2t   p2t   L3t   p3(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_basic_proxyÖ   s4    	
c         C   sa   d t  f d „  ƒ  Y} | ƒ  } |  j d t t j | ƒ ƒ ƒ |  j t t j | ƒ ƒ d ƒ d  S(   NR   c           B   s   e  Z d  „  Z d „  Z RS(   c         S   s   d S(   Nt   string(    (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __str__÷   s    c         S   s   d S(   Nu   unicode(    (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __unicode__ù   s    (   R   R   Rj   Rk   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   ö   s   	Rk   u   unicode(   RE   R`   t   dirR9   RK   RA   t   unicode(   R   R   t   instance(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_proxy_unicodeô   s    	c         C   sH   d d d „  ƒ  Y} | ƒ  } t  j | ƒ } |  j t j | ƒ d ƒ d  S(   NR   c           B   s   e  Z d  „  Z RS(   c         S   s   d S(   Ni
   (    (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt	   __index__  s    (   R   R   Rp   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR      s   i
   (    (   R9   RK   RA   t   operatort   index(   R   R   R;   Rc   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_proxy_indexÿ   s    	c         C   s]   d d d „  ƒ  Y} | ƒ  } t  j | ƒ } |  j | d d ƒ | d } |  j | d ƒ d  S(   NR   c           B   s   e  Z d  „  Z d „  Z RS(   c         S   s   d S(   Ni*   (    (   R   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __floordiv__	  s    c         S   s   d S(   Ni   (    (   R   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __ifloordiv__  s    (   R   R   Rt   Ru   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR     s   	i   i*   i   (    (   R9   RK   RA   (   R   R   R;   Rc   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_proxy_div  s    	
c         C   s   |  j  t j ƒ d  S(   N(   t   check_shared_without_callbackR9   R5   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt    test_shared_ref_without_callback  s    c         C   s   |  j  t j ƒ d  S(   N(   Rw   R9   RK   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt"   test_shared_proxy_without_callback  s    c         C   sÚ   t  d ƒ } | | d  ƒ } | | d  ƒ } |  j | | d ƒ ~ ~ | | ƒ } | | d  ƒ } |  j | | d ƒ ~ ~ | | ƒ } | | ƒ } |  j | | d ƒ ~ ~ | | d  ƒ } | | ƒ } |  j | | d ƒ d  S(   Ni   s%   both callbacks were None in the C APIs&   callbacks were NULL, None in the C APIs%   both callbacks were NULL in the C APIs&   callbacks were None, NULL in the C API(   R   R
   RQ   (   R   t   makerefR;   t   p1Re   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRw   !  s     c         C   s´   t  ƒ  } t j | ƒ } |  j | | ƒ |  j t | ƒ t j d ƒ | d ƒ |  j | j d d ƒ | d d ƒ |  j | j d d ƒ |  j	 t
 | ƒ |  j	 t
 | d d d ƒ d  S(	   Ns   proxy is not of callable types	   twinkies!s1   call through proxy not passed through to originalR   s   Splat.i   i   i   (   R   R9   RK   RY   RQ   t   typet   CallableProxyTypeRA   R   RH   RI   (   R   R;   RB   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_callable_proxy3  s    	
c         C   s¾   d | _  |  j | j  d d ƒ d | _  |  j | j  d d ƒ | `  |  j t | d ƒ d ƒ d | _  |  j | j  d d ƒ d | _  |  j | j  d d ƒ | `  |  j t | d ƒ d	 ƒ d  S(
   Ni   s)   proxy does not reflect attribute additioni   s-   proxy does not reflect attribute modificationt   foos(   proxy does not reflect attribute removals4   object does not reflect attribute addition via proxys8   object does not reflect attribute modification via proxys3   object does not reflect attribute removal via proxy(   R   RA   R[   t   hasattr(   R   R;   RK   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRY   H  s$    				c         C   sI   d d d „  ƒ  Y} | ƒ  } t  j | ƒ } | d =|  j | j d ƒ d  S(   Nt   Fooc           B   s   e  Z d Z d  „  Z RS(   c         S   s   | |  _  d  S(   N(   t   result(   R   t   accessor(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __delitem__a  s    N(   R   R   R
   R‚   R„   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR�   _  s   i    (    (   R9   RK   RA   R‚   (   R   R�   t   gR   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_proxy_deletion]  s
    	c         C   sH   d t  f d „  ƒ  Y} | ƒ  } |  j t t j | ƒ ƒ t | ƒ ƒ d  S(   Nt   Listc           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR‡   j  s    (   t   listRA   RN   R9   RK   (   R   R‡   t   lyst(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_proxy_boolh  s    	c         C   sÑ   t  ƒ  } t j | ƒ } t j | |  j ƒ } |  j t j | ƒ d d ƒ t j | ƒ } t j | |  j ƒ } |  j t j | ƒ d d ƒ ~ ~ ~ ~ |  j t j | ƒ d d ƒ |  j t j d ƒ d d ƒ d  S(   Ni   s*   got wrong number of weak reference objectsi   i    sA   weak reference objects not unlinked from referent when discarded.i   s2   got wrong number of weak reference objects for int(   R   R9   R5   R6   RA   RT   RK   (   R   R;   RB   RC   RV   RW   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_getweakrefcountn  s    	c         C   sé   t  ƒ  } t j | |  j ƒ } t j | |  j ƒ } ~ |  j t j | ƒ | g d ƒ t  ƒ  } t j | |  j ƒ } t j | |  j ƒ } ~ |  j t j | ƒ | g d ƒ ~ |  j t j | ƒ g  d ƒ |  j t j d ƒ g  d ƒ d  S(   Ns   list of refs does not matchs   list of refs not clearedi   s#   list of refs does not match for int(   R   R9   R5   R6   RA   t   getweakrefs(   R   R;   RB   RC   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_getweakrefsƒ  s"    		c         C   s]   d t  f d „  ƒ  Y} | d ƒ } t j | ƒ } |  j | d d ƒ |  j d | d ƒ d  S(   Nt   Fc           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRŽ   ›  s   g       @g      ð?g      @(   t   floatR9   RK   RA   (   R   RŽ   R   Rc   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_newstyle_number_opsš  s
    c            sœ   d t  f d „  ƒ  Y‰  i  ‰ ‡ f d †  ‰ ‡  ‡ ‡ f d †  } y | ƒ  Wn ˆ  k
 r^ n X|  j d ƒ y | ƒ  Wn ˆ  k
 rŠ n X|  j d ƒ d  S(   Nt
   BogusErrorc           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR‘   ¥  s   c            s   ˆ  |  =d  S(   N(    (   t   k(   t   data(    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   remove¨  s    c             s)   d „  }  d  ˆ t j |  ˆ ƒ <ˆ  ‚ d  S(   Nc           S   s   d S(   N(    (    (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   <lambda>«  R   (   R
   R9   R5   (   R   (   R‘   R“   R”   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   encapsulateª  s    	s   exception not properly restored(   t	   Exceptiont   fail(   R   R–   (    (   R‘   R“   R”   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_callbacks_protected¢  s    c            s›   d d  l  ‰  d t f d „  ƒ  Y} | ƒ  } t j | ‡  f d †  ƒ } ~ ~ | ƒ  } | ƒ  | _ t j | j ‡  f d †  ƒ } | ƒ  } | | _ ~ ~ d  S(   NiÿÿÿÿR   c           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   È  s   c            s
   ˆ  j  ƒ  S(   N(   R!   (   t   ignore(   R    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR•   Ì  R   c            s
   ˆ  j  ƒ  S(   N(   R!   (   Rš   (   R    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR•   Ô  R   (   R    RE   R9   R5   t   it   c1(   R   R   RF   R<   Rœ   t   c2(    (   R    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_sf_bug_840829»  s    					c         C   sy   d d  l  } d t f d „  ƒ  Y} d t f d „  ƒ  Y} | ƒ  } | | _ t j | | j ƒ | _ ~ ~ ~ | j ƒ  d  S(   Niÿÿÿÿt   Jc           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRŸ   æ  s   t   IIc           B   s   e  Z d  „  Z RS(   c         S   s   |  j  d  S(   N(   RŸ   (   R   Rš   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt	   acallbackê  s    (   R   R   R¡   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR    é  s   (   R    RE   RŸ   R9   R5   R¡   R<   R!   (   R   R    RŸ   R    t   I(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_callback_in_cycle_1ã  s    			c         C   sv   d d  l  } d t f d „  ƒ  Y} d d d „  ƒ  Y} | ƒ  } | | _ t j | | j ƒ | _ ~ ~ ~ | j ƒ  d  S(   NiÿÿÿÿRŸ   c           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRŸ     s   R    c           B   s   e  Z d  „  Z RS(   c         S   s   |  j  d  S(   N(   RŸ   (   R   Rš   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR¡     s    (   R   R   R¡   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR      s   (    (   R    RE   RŸ   R9   R5   R¡   R<   R!   (   R   R    RŸ   R    R¢   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_callback_in_cycle_2  s    			c         C   sp   d d  l  } d d d „  ƒ  Y} | ƒ  | ƒ  } } | | _ | | _ t j | | j ƒ | _ ~ ~ | j ƒ  d  S(   NiÿÿÿÿR   c           B   s   e  Z d  „  Z RS(   c         S   s   |  j  |  j |  j d  S(   N(   t   meRœ   R<   (   R   Rš   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   cb2  s    (   R   R   R¦   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   1  s   (    (   R    R¥   Rœ   R9   R5   R¦   R<   R!   (   R   R    R   Rœ   R�   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_callback_in_cycle_3(  s    		c         C   sŒ   d d  l  } d t f d „  ƒ  Y} d d d „  ƒ  Y} | ƒ  | ƒ  } } | | _ | | _ t j | | j ƒ | _ ~ ~ ~ ~ | j ƒ  d  S(   NiÿÿÿÿR   c           B   s   e  Z d  „  Z RS(   c         S   s   |  j  |  j |  j d  S(   N(   R¥   Rœ   R<   (   R   Rš   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR¦   K  s    (   R   R   R¦   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   J  s   t   Dc           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR¨   P  s   (    (	   R    RE   R¥   Rœ   R9   R5   R¦   R<   R!   (   R   R    R   R¨   Rœ   R�   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_callback_in_cycle_4@  s    			c            s  d d  l  } g  ‰  d t f ‡  f d †  ƒ  Y} | d ƒ | d ƒ } } | | _ | | _ t j | | j ƒ | _ t j | | j ƒ | _ ‡  f d †  } t j | | ƒ } ~ ~ ~ |  j ˆ  g  ƒ | j ƒ  |  j ˆ  d g ƒ |  j | ƒ  d  ƒ ˆ  2| j ƒ  |  j ˆ  g  ƒ d  S(   NiÿÿÿÿR   c              s    e  Z d  „  Z ‡  f d †  Z RS(   c         S   s   | |  _  d  S(   N(   t	   attribute(   R   t   value(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   k  s    c            s   ˆ  j  |  j ƒ d  S(   N(   R\   RF   (   R   Rš   (   t   alist(    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR¡   n  s    (   R   R   R   R¡   (    (   R¬   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   j  s   	i   i   c            s   ˆ  j  d ƒ d  S(   Ns   C went away(   R\   (   Rš   (   R¬   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   C_went_awayw  s    s   C went away(
   R    RE   RF   R9   R5   R¡   R<   RA   R!   R
   (   R   R    R   Rœ   R�   R­   R<   (    (   R¬   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt#   test_callback_in_cycle_resurrection\  s$    			

c            s+  d d  l  } g  ‰  ‡  f d †  } d t f ‡  f d †  ƒ  Y} | ƒ  | ƒ  } } | | _ | | _ | j } t j | | ƒ | _ t j | | j ƒ | _ t j | | ƒ } |  j | ƒ  | ƒ ~ ~ ~ ~ |  j ˆ  g  ƒ | j	 ƒ  |  j ˆ  d g ƒ |  j | ƒ  d  ƒ ˆ  2| j	 ƒ  |  j ˆ  g  ƒ d  S(   Niÿÿÿÿc            s   ˆ  j  d ƒ d  S(   Ns   safe_callback called(   R\   (   Rš   (   R¬   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   safe_callback�  s    R   c              s   e  Z ‡  f d  †  Z RS(   c            s   ˆ  j  d ƒ d  S(   Ns	   cb called(   R\   (   R   Rš   (   R¬   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR¦   ”  s    (   R   R   R¦   (    (   R¬   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   “  s   s   safe_callback called(   R    RE   R   R¦   R9   R5   R<   RQ   RA   R!   R
   (   R   R    R¯   R   RF   t   dR6   t   external_wr(    (   R¬   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_callbacks_on_callback‹  s(    				

c         C   s   |  j  t j ƒ d  S(   N(   t   check_gc_during_creationR9   R5   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_gc_during_ref_creation±  s    c         C   s   |  j  t j ƒ d  S(   N(   R³   R9   RK   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_gc_during_proxy_creation´  s    c         C   s¡   t  j ƒ  } t  j d d d ƒ t  j ƒ  d d d „  ƒ  Y} d „  } | ƒ  } | ƒ  } | | _ | | ƒ | _ z | ƒ  } t j | | ƒ Wd  t  j | Œ  Xd  S(   Ni   t   Ac           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR¶   »  s   c          W   s   d  S(   N(    (   t   args(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR6   ¾  s    (    (   R    t   get_thresholdt   set_thresholdR!   t   aR<   R9   R5   (   R   Rz   t
   thresholdsR¶   R6   t
   referencedRº   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR³   ·  s    
					c         C   s#   d t  f d „  ƒ  Y} | ƒ  } d  S(   Nt   Targetc           B   s   e  Z d  „  Z RS(   c         S   s   t  j |  ƒ a d  S(   N(   R9   R5   t   ref_from_del(   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   __del__Ö  s    (   R   R   R¿   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR½   Õ  s   (   RE   (   R   R½   t   w(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_ref_created_during_delÐ  s    c         C   s?   t  j t ƒ } |  j t | j d d d d d ƒ t j ƒ  d  S(   Ni    (   R9   R5   R—   RH   RI   R   R    R!   (   R   t   r(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt	   test_initÜ  s    "c         C   sÙ   d t  f d „  ƒ  Y} d d d „  ƒ  Y} g  } t j t ƒ t j | | j ƒ } d  } t j ƒ  |  j | ƒ  d  ƒ |  j | | g ƒ t j | | j ƒ } d  } t j ƒ  |  j | ƒ  d  ƒ |  j | | | g ƒ d  S(   NR¶   c           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR¶   ç  s   t   Bc           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRÄ   é  s   (    (	   RE   R9   R5   t   intR\   R
   R    R!   RA   (   R   R¶   RÄ   t   lRº   t   b(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_classesä  s    

c   	      C   sš  t  d ƒ } t  d ƒ } t  d ƒ } t j | ƒ } t j | ƒ } t j | ƒ } t j | ƒ } |  j | | k ƒ |  j | | k ƒ |  j | | k ƒ |  j | | k ƒ |  j | | k ƒ |  j | | k ƒ ~ ~ ~ t j ƒ  x* | | | f D] } |  j | ƒ  d  ƒ qõ W|  j | | k ƒ |  j | | k ƒ |  j | | k ƒ |  j | | k ƒ |  j	 | | k | | k ƒ |  j	 | | k | | k	 ƒ d  S(   Ni   i   (
   R   R9   R5   R^   R[   R    R!   RQ   R
   RA   (	   R   R   t   yt   zRº   RÇ   RF   R°   RÂ   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_equalityø  s.    	
c         C   s•   t  d ƒ } t  d ƒ } t j | ƒ } t j | ƒ } |  j t | ƒ t d ƒ ƒ ~ ~ t j ƒ  |  j t | ƒ t d ƒ ƒ |  j t t | ƒ d  S(   Ni*   (	   R   R9   R5   RA   R   R    R!   RH   RI   (   R   R   RÉ   Rº   RÇ   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_hashing  s    
c         C   sn   d t  f d „  ƒ  Y} t j ƒ  } | d  ƒ } } x( t d ƒ D] } | | ƒ | | <} q? W~ t j ƒ  d  S(   NR   c           B   s   e  Z d  „  Z RS(   c            sA   | s
 d  St  j |  ƒ ‰  ‡  f d †  } t  j | | ƒ |  _ d  S(   Nc            s   ˆ  ƒ  } d  S(   N(    (   t   wparentR;   (   t   wself(    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR¦   2  s    (   R9   R5   RÍ   (   R   t   parentR¦   (    (   RÎ   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   .  s
    (   R   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   -  s   id   (   RE   R9   t   WeakKeyDictionaryR
   Ra   R    R!   (   R   R   R°   t   rootRF   t   n(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_trashcan_16602(  s    	(-   R   R   R=   R?   RD   RG   RJ   RO   R8   R>   RU   RX   Rh   Ro   Rs   Rv   Rx   Ry   Rw   R~   RY   R†   RŠ   R‹   R�   R�   R™   Rž   R£   R¤   R§   R©   R    t   requires_type_collectingR®   R²   R´   Rµ   R³   RÁ   RÃ   RÈ   RË   RÌ   RÓ   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR7   _   sR   			
						
																		(	(			/	&							!	t   SubclassableWeakrefTestCasec           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c            sš   d t  j f ‡  f d †  ƒ  Y‰  t d ƒ } ˆ  | d d ƒ} |  j | ƒ  | ƒ |  j | j ƒ |  j | j d ƒ ~ |  j | ƒ  ƒ |  j | j ƒ d  S(   Nt   MyRefc              s,   e  Z d d  ‡  f d † Z ‡  f d †  Z RS(   i*   c            s&   | |  _  t ˆ  |  ƒ j | | ƒ d  S(   N(   R«   t   superR   (   R   t   obR6   R«   (   RÖ   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   B  s    	c            s   t  |  _ t ˆ  |  ƒ j ƒ  S(   N(   R-   t   calledR×   R	   (   R   (   RÖ   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR	   E  s    	N(   R   R   R
   R   R	   (    (   RÖ   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRÖ   A  s   R   R«   i   (	   R9   R5   R   RQ   R^   RÙ   RA   R«   R@   (   R   R;   t   mr(    (   RÖ   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_subclass_refs@  s    c         C   s  d t  j f d „  ƒ  Y} t d ƒ } | | ƒ } t  j | ƒ } |  j | | ƒ |  j t  j | ƒ | | g ƒ |  j t  j | ƒ d ƒ | | ƒ } |  j t  j | ƒ d ƒ t  j | ƒ } |  j t | ƒ d ƒ |  j | | d ƒ |  j	 | | d ƒ |  j	 | | d ƒ d  S(   NRÖ   c           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRÖ   R  s   i*   i   i   i    i   (
   R9   R5   R   t   assertIsNotRA   RŒ   RT   R]   RQ   R`   (   R   RÖ   R;   t   r1t   r2t   r3t   refs(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt-   test_subclass_refs_dont_replace_standard_refsQ  s    c         C   s†   d t  j f d „  ƒ  Y} t d ƒ } | | t ƒ } | | t ƒ } |  j | | ƒ t  j | ƒ } |  j | | ƒ |  j | | ƒ d  S(   NRÖ   c           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRÖ   c  s   i*   (   R9   R5   R   t   idt   strRÜ   RŒ   R`   (   R   RÖ   R;   RÝ   RÞ   Rà   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt*   test_subclass_refs_dont_conflate_callbacksb  s    c         C   s�   d t  j f d „  ƒ  Y} t d ƒ } | | d  d d ƒ } |  j | j d ƒ |  j | j d ƒ |  j | j ƒ  d ƒ |  j t	 | d ƒ ƒ d  S(   NRÖ   c           B   s)   e  Z d Z d „  Z d „  Z d „  Z RS(   t   slot1t   slot2c         S   s   t  j j |  | | ƒ S(   N(   R9   R5   t   __new__(   R|   RØ   R6   Rå   Ræ   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRç   p  s    c         S   s   | |  _  | |  _ d  S(   N(   Rå   Ræ   (   R   RØ   R6   Rå   Ræ   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   r  s    	c         S   s   |  j  |  j S(   N(   Rå   Ræ   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   methu  s    (   Rå   Ræ   (   R   R   t	   __slots__Rç   R   Rè   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRÖ   n  s   		i*   t   abct   deft   abcdeft   __dict__(
   R9   R5   R   R
   RA   Rå   Ræ   Rè   R[   R€   (   R   RÖ   R;   RÂ   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_subclass_refs_with_slotsm  s    	c            s»   d t  j f d „  ƒ  Y} ‡  f d †  } t ƒ  } | | | ƒ } | | _ ~ ~ ˆ  j ˆ  j d ƒ t ƒ  } | | | ƒ } | | | ƒ } | | _ | | _ ~ ~ ~ ˆ  j ˆ  j d ƒ d  S(   NRÖ   c           B   s   e  Z RS(    (   R   R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRÖ   …  s   c            s   ˆ  j  d 7_  d  S(   Ni   (   R3   (   RÀ   (   R   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR6   Š  s    i    (   R9   R5   R   R;   RA   R3   RÂ   (   R   RÖ   R6   R;   RÝ   RÞ   (    (   R   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_subclass_refs_with_cycle~  s"    					(   R   R   RÛ   Rá   Rä   Rî   Rï   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRÕ   >  s
   				t   MappingTestCasec           B   sR  e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d  „  Z" d! „  Z# d" „  Z$ d# „  Z% d$ „  Z& RS(%   i
   c   
         sØ   d } g  t  | ƒ D] } t ƒ  ^ q } | ‡  f d †  t | ƒ Dƒ ƒ } | j ƒ  } y t | ƒ Wn t k
 rw n X~ t j ƒ  t | ƒ } t	 | ƒ ~ t j ƒ  t | ƒ }	 |  j
 | d ƒ |  j
 |	 d ƒ d  S(   Ni   c         3   s$   |  ] \ } } ˆ  | | ƒ Vq d  S(   N(    (   t   .0R›   R;   (   t   cons(    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pys	   <genexpr>¬  s    i    (   Ra   R   t	   enumeratet	   iteritemst   nextt   StopIterationR    R!   R]   Rˆ   RA   (
   R   t	   dict_typeRò   t   NR›   t   itemst   dctt   itt   n1t   n2(    (   Rò   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   check_len_cycles©  s"    ""


c         C   s   |  j  t j d „  ƒ d  S(   Nc         S   s
   | |  f S(   N(    (   RÒ   R’   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR•   Ã  R   (   Rþ   R9   RÐ   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_keyed_len_cyclesÂ  s    c         C   s   |  j  t j d „  ƒ d  S(   Nc         S   s
   |  | f S(   N(    (   RÒ   R’   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR•   Æ  R   (   Rþ   R9   t   WeakValueDictionary(   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_valued_len_cyclesÅ  s    c            s'  |  j  t j t j ƒ  Œ xt d d ƒ D]ö } d } t j d ƒ t j | | | ƒ g  t | ƒ D] } t ƒ  ^ qb } | ‡  f d †  | Dƒ ƒ } ~ | j ƒ  } y t | ƒ Wn t	 k
 rÃ n Xt
 | ƒ }	 ~ t
 | ƒ }
 |  j |	 d ƒ |  j |	 | ƒ |  j |
 d ƒ |  j |
 |	 ƒ q) Wd  S(   Ni   id   i   i    c         3   s   |  ] } ˆ  | ƒ Vq d  S(   N(    (   Rñ   R;   (   Rò   (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pys	   <genexpr>Ð  s    (   t
   addCleanupR    R¹   R¸   Ra   R!   R   Rô   Rõ   Rö   R]   t   assertGreaterEqualt   assertLessEqual(   R   R÷   Rò   t   thRø   R›   Rù   Rú   Rû   Rü   Rý   (    (   Rò   s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   check_len_raceÈ  s(    "c         C   s   |  j  t j d „  ƒ d  S(   Nc         S   s
   |  d f S(   Ni   (    (   R’   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR•   á  R   (   R  R9   RÐ   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_keyed_len_raceà  s    c         C   s   |  j  t j d „  ƒ d  S(   Nc         S   s
   d |  f S(   Ni   (    (   R’   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR•   ä  R   (   R  R9   R   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_valued_len_raceã  s    c         C   sP  |  j  ƒ  \ } } xH | D]@ } |  j t j | ƒ d d | ƒ |  j | | | j d ƒ q W| j ƒ  } | j ƒ  j ƒ  } | j ƒ  | j ƒ  |  j | | d ƒ ~ ~ |  j t	 | ƒ |  j
 ƒ | d =|  j t	 | ƒ |  j
 d d ƒ ~ ~ |  j t	 | ƒ d d ƒ t j ƒ  } |  j t | j d ƒ t ƒ  | d <|  j t | j d ƒ d  S(	   Ni   s&   wrong number of weak references to %r!s#   wrong object returned by weak dict!s/   cloning of weak-valued dictionary did not work!i    s/   deleting object did not cause dictionary updates0   deleting the values did not clear the dictionaryi   (   t   make_weak_valued_dictRA   R9   RT   RQ   R   Rù   t   copyt   sortR]   t   COUNTR   RH   t   KeyErrort   __getitem__R   (   R   t   dictt   objectsR;   t   items1t   items2(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_valuesæ  s0    

c         C   s9  |  j  ƒ  \ } } xH | D]@ } |  j t j | ƒ d d | ƒ |  j | j | | d ƒ q W| j ƒ  } | j ƒ  j ƒ  } |  j t | ƒ t | ƒ d ƒ ~ ~ |  j t	 | ƒ |  j
 ƒ | d =|  j t	 | ƒ |  j
 d d ƒ ~ ~ |  j t	 | ƒ d d ƒ t d ƒ } d	 | | <|  j | | ƒ |  j d
 | ƒ d  S(   Ni   s&   wrong number of weak references to %r!s#   wrong object returned by weak dict!s.   cloning of weak-keyed dictionary did not work!i    s/   deleting object did not cause dictionary updates.   deleting the keys did not clear the dictionaryi*   s$   What is the meaning of the universe?i"   (   t   make_weak_keyed_dictRA   R9   RT   RQ   R   Rù   R
  t   setR]   R  R   R`   t   assertNotIn(   R   R  R  R;   R  R  (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_keys  s,    
c         C   sY  |  j  ƒ  \ } } |  j | ƒ | j ƒ  } |  j t | ƒ t | ƒ ƒ t | ƒ } xK | D]C } | ƒ  } |  j | | ƒ |  j | j | | ƒ | j | ƒ qZ W|  j t | ƒ d ƒ t | ƒ } |  j t t | j	 ƒ  ƒ ƒ t | ƒ ƒ xQ | j	 ƒ  D]C } | ƒ  } |  j | | ƒ |  j | j | | ƒ | j | ƒ qø W|  j t | ƒ d ƒ d  S(   Ni    (
   R  t   check_iterst   keyrefsRA   R]   Rˆ   R`   R   R”   t   iterkeyrefs(   R   R  R  Rà   t   objects2R<   RØ   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_keyed_iters   s&    	(	c         C   ss  |  j  ƒ  \ } } |  j | ƒ | j ƒ  } |  j t | ƒ t | ƒ ƒ t | ƒ } xX | D]P } | ƒ  } |  j | | | j ƒ |  j | j | | j j ƒ | j | ƒ qZ W|  j t | ƒ d ƒ t | ƒ } |  j t t | j ƒ  ƒ ƒ t | ƒ ƒ x^ | j ƒ  D]P } | ƒ  } |  j | | | j ƒ |  j | j | | j j ƒ | j | ƒ qW|  j t | ƒ d ƒ d  S(   Ni    (	   R	  R  t	   valuerefsRA   R]   Rˆ   R   R”   t   itervaluerefs(   R   R  R  Rà   R  R<   RØ   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_valued_iters9  s&    	(	c         C   s"  | j  ƒ  } x! | j ƒ  D] } | j | ƒ q W|  j t | ƒ d d ƒ | j ƒ  } x | D] } | j | ƒ q\ W|  j t | ƒ d d ƒ | j ƒ  } x! | j ƒ  D] } | j | ƒ q¥ W|  j t | ƒ d d ƒ | j ƒ  } x! | j ƒ  D] } | j | ƒ qî W|  j t | ƒ d d ƒ d  S(   Ni    s#   iteritems() did not touch all itemss!   __iter__() did not touch all keyss!   iterkeys() did not touch all keyss%   itervalues() did not touch all values(	   Rù   Rô   R”   RA   R]   t   keyst   iterkeyst   valuest
   itervalues(   R   R  Rù   t   itemR   R’   R"  t   v(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR  R  s"    c         C   s’   t  | ƒ } t t | | ƒ ƒ  ƒ } t | ƒ | d =t j ƒ  |  j t  t | ƒ ƒ t  | ƒ t  | ƒ d g ƒ ~ |  j t  | ƒ | d ƒ d  S(   Niÿÿÿÿi   (	   R]   t   itert   getattrRõ   R    R!   R`   Rˆ   RA   (   R   R  R  t	   iter_nameRÒ   Rû   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt"   check_weak_destroy_while_iteratingl  s    

2c         C   sc  | ƒ  �  \ } } |  j  | | k ƒ Wd  QX| ƒ  �# \ } } |  j t | j | ƒ Wd  QX|  j  | | k ƒ | ƒ  �# \ } } |  j t | j | ƒ Wd  QX|  j  | | k ƒ | ƒ  � \ } } | | | <Wd  QX|  j | | | ƒ t j | ƒ } | ƒ  � \ } } | j | ƒ Wd  QX|  j | | ƒ | ƒ  � \ } } | j ƒ  Wd  QX|  j t	 | ƒ d ƒ d  S(   Ni    (
   R[   RH   R  R„   t   popRA   R
  t   updatet   clearR]   (   R   R  t   testcontextR’   R%  t   ddict(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt-   check_weak_destroy_and_mutate_while_iteratingy  s$    c            sŸ   |  j  ƒ  \ ‰  ‰ |  j ˆ  ˆ d ƒ |  j ˆ  ˆ d ƒ |  j ˆ  ˆ d ƒ |  j ˆ  ˆ d ƒ |  j  ƒ  \ ‰  ‰ t j ‡  ‡ f d †  ƒ } |  j ˆ  | ƒ d  S(   NR!  Rô   R#  R  c          3   sb   zJ t  ˆ  j ƒ  ƒ }  t |  ƒ ˆ j ƒ  j } t j ƒ  t | ƒ | f VWd  d  }  t j ƒ  Xd  S(   N(	   R&  Rô   Rõ   R*  R   R    R!   R   R
   (   Rû   R%  (   R  R  (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR-  š  s    

(   R  R)  t
   contextlibt   contextmanagerR/  (   R   R-  (    (   R  R  s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt&   test_weak_keys_destroy_while_iterating’  s    c            sŸ   |  j  ƒ  \ ‰  ‰ |  j ˆ  ˆ d ƒ |  j ˆ  ˆ d ƒ |  j ˆ  ˆ d ƒ |  j ˆ  ˆ d ƒ |  j  ƒ  \ ‰  ‰ t j ‡  ‡ f d †  ƒ } |  j ˆ  | ƒ d  S(   NR!  Rô   R#  R  c          3   sb   zJ t  ˆ  j ƒ  ƒ }  t |  ƒ ˆ j ƒ  j } t j ƒ  | t | ƒ f VWd  d  }  t j ƒ  Xd  S(   N(	   R&  Rô   Rõ   R*  R   R    R!   R   R
   (   Rû   R’   (   R  R  (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR-  °  s    

(   R	  R)  R0  R1  R/  (   R   R-  (    (   R  R  s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt(   test_weak_values_destroy_while_iterating¨  s    c         C   s:   t  d ƒ } t j i d | 6ƒ } |  j | | d ƒ d  S(   Ni   il  (   R   R9   RÐ   RA   (   R   R;   R  (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt#   test_make_weak_keyed_dict_from_dict¾  s    c         C   sI   t  d ƒ } t j i d | 6ƒ } t j | ƒ } |  j | | d ƒ d  S(   Ni   il  (   R   R9   RÐ   RA   (   R   R;   R  t   dict2(    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt.   test_make_weak_keyed_dict_from_weak_keyed_dictÃ  s    c         C   sL   t  j ƒ  } t t t |  j ƒ ƒ } x | D] } | j | | <q+ W| | f S(   N(   R9   RÐ   t   mapR   Ra   R  R   (   R   R  R  R;   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR  É  s
    c         C   s²   |  j  t t j j ƒ |  j  t t j i  i  ƒ |  j  t t j d d ƒ t d ƒ } xW d D]O } t j i | | 6�  } |  j t | j ƒ  ƒ | g ƒ |  j | | | ƒ q[ Wd  S(   Ni   R   R   t   iterable(    (    (   R   R   R8  (	   RH   RI   R9   R   R   R   RA   Rˆ   R   (   R   R;   t   kwR°   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_make_weak_valued_dict_miscÐ  s    c         C   sL   t  j ƒ  } t t t |  j ƒ ƒ } x | D] } | | | j <q+ W| | f S(   N(   R9   R   R7  R   Ra   R  R   (   R   R  R  R;   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR	  Ü  s
    c   	      C   så   | ƒ  } | | | <| | | <|  j  t | ƒ d ƒ | j ƒ  \ } } |  j  t | ƒ d ƒ | | k rz |  j | | ƒ n |  j | | ƒ | j ƒ  \ } } |  j  t | ƒ d ƒ | | k rÑ |  j | | ƒ n |  j | | ƒ d  S(   Ni   i   i    (   RA   R]   t   popitemRQ   (	   R   t   klasst   key1t   value1t   key2t   value2t   weakdictR’   R%  (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   check_popitemã  s    	

c         C   s&   |  j  t j d t ƒ  d t ƒ  ƒ d  S(   NR=  R?  (   RB  R9   R   R   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_valued_dict_popitemõ  s    c         C   s&   |  j  t j t ƒ  d t ƒ  d ƒ d  S(   Ns   value 1s   value 2(   RB  R9   RÐ   R   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_keyed_dict_popitemù  s    c         C   sÞ   |  j  | | d ƒ | ƒ  } | j | | ƒ } |  j | | ƒ |  j | | ƒ |  j | j | ƒ | ƒ |  j | | | ƒ | j | | ƒ } |  j | | ƒ |  j | | ƒ |  j | j | ƒ | ƒ |  j | | | ƒ d  S(   Ns9   invalid test -- value parameters must be distinct objects(   RÜ   t
   setdefaultRQ   R`   t   get(   R   R<  t   keyR>  R@  RA  R;   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   check_setdefaultý  s    	c         C   s#   |  j  t j d t ƒ  t ƒ  ƒ d  S(   NRG  (   RH  R9   R   R   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt    test_weak_valued_dict_setdefault  s    c         C   s    |  j  t j t ƒ  d d ƒ d  S(   Ns   value 1s   value 2(   RH  R9   RÐ   R   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_keyed_dict_setdefault  s    c         C   sý   | ƒ  } | j  | ƒ |  j t | ƒ t | ƒ ƒ xc | j ƒ  D]U } |  j | | d ƒ | j | ƒ } |  j | | | ƒ |  j | | j | ƒ ƒ q? Wx^ | j ƒ  D]P } |  j | | d ƒ | | } |  j | | | ƒ |  j | | j | ƒ ƒ q¥ Wd  S(   Ns(   mysterious new key appeared in weak dicts%   original key disappeared in weak dict(   R+  RA   R]   R   R`   RF  RQ   (   R   R<  R  RA  R’   R%  (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   check_update  s    	
c         C   s  |  j  t j i t ƒ  d 6t ƒ  d 6t ƒ  t ƒ  6ƒ |  j t t j j ƒ t j ƒ  } |  j t | j i  i  ƒ |  j t | j d d	 ƒ |  j t | j	 ƒ  ƒ g  ƒ t
 d ƒ } xa d
 D]Y } t j ƒ  } | j i | | 6�  |  j t | j	 ƒ  ƒ | g ƒ |  j | | | ƒ q· Wd  S(   Ni   Rº   i   R   R  R   R8  (    (    (   R   R  R   R8  (   RK  R9   R   R   RH   RI   R+  RA   Rˆ   R   R   (   R   R°   R;   R9  (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_valued_dict_update+  s    (c         C   s5   |  j  t j i d t ƒ  6d t ƒ  6d t ƒ  6ƒ d  S(   Ni   i   i   (   RK  R9   RÐ   R   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_keyed_dict_update<  s    c         C   sˆ   t  j ƒ  } t d ƒ } t d ƒ } d | | <d | | <|  j t | ƒ d ƒ | | =|  j t | ƒ d ƒ |  j | j ƒ  | g ƒ d  S(   Nt   1t   2t	   somethingi   i   (   R9   RÐ   R   RA   R]   R   (   R   R°   t   o1RS   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_keyed_delitem@  s    

c         C   sŽ   t  j ƒ  } t d ƒ } t d ƒ } | | d <| | d <|  j t | ƒ d ƒ | d =|  j t | ƒ d ƒ |  j | j ƒ  d | f g ƒ d  S(   NRN  RO  RP  s   something elsei   i   (   R9   R   R   RA   R]   Rù   (   R   R°   RQ  RS   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_valued_delitemK  s    

c         C   s�   t  j ƒ  } t d ƒ } |  j t | j | ƒ |  j t | j | ƒ |  j t | j d ƒ |  j t | j d ƒ |  j t | j d d ƒ d  S(   NRN  i   (	   R9   RÐ   R   RH   R  R„   R  RI   t   __setitem__(   R   R°   R;   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_weak_keyed_bad_delitemV  s    c            så   t  j ƒ  } t ‰  d t f ‡  ‡ f d †  ƒ  Y} g  t d ƒ D] } | | ƒ ^ q> ‰ x ˆ D] } | j | | <q] W~ | j ƒ  ‰ ˆ j ƒ  t ‰  d } x ˆ D] } | d 7} | | =q  W|  j	 t
 | ƒ d ƒ |  j	 | d ƒ d  S(   NR   c              s,   e  Z d  „  Z d „  Z ‡  ‡ f d †  Z RS(   c         S   s   | |  _  d  S(   N(   R«   (   R   R›   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   m  s    c         S   s   t  |  j ƒ S(   N(   R   R«   (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   o  s    c            s    ˆ  r ˆ d =n  |  j  | j  k S(   Niÿÿÿÿ(   R«   (   R   R   (   t   mutatet   objs(    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   q  s    
(   R   R   R   R   R   (    (   RV  RW  (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR   l  s   		i   i    i   i   (   R9   RÐ   R&   RE   Ra   R«   R   t   reverseR-   RA   R]   (   R   R°   R   R›   R;   t   count(    (   RV  RW  s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt!   test_weak_keyed_cascading_deletesd  s     %
	
c         C   s_   t  j ƒ  } t ƒ  �D x< t d ƒ D]. } | j d t ƒ  ƒ } |  j | d  ƒ ~ q# WWd  QXd  S(   NiPÃ  i
   (   R9   R   R1   Ra   RE  R   RÜ   R
   (   R   R°   R›   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt$   test_threaded_weak_valued_setdefault‘  s    
c         C   sf   t  j ƒ  } t ƒ  �K xC t d ƒ D]5 } t ƒ  | d <| j d d ƒ } |  j | d  ƒ q# WWd  QXd  S(   NiPÃ  i
   (   R9   R   R1   Ra   R   R*  RÜ   R
   (   R   R°   R›   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   test_threaded_weak_valued_pop™  s    
c         C   sf   t  j ƒ  } t ƒ  �K xC t d ƒ D]5 } t ƒ  } | | d <|  j t | ƒ d ƒ d  } q# WWd  QXd  S(   Ni@ i
   i   (   R9   R   R1   Ra   R   RA   R]   R
   (   R   R°   R›   R;   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt%   test_threaded_weak_valued_consistency¡  s    
	
('   R   R   R  Rþ   Rÿ   R  R  R  R  R  R  R  R  R  R)  R/  R2  R3  R4  R6  R  R:  R	  RB  RC  RD  RH  RI  RJ  RK  RL  RM  RR  RS  RU  RZ  R[  R\  R]  (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRð   ¥  sJ   																																	-		(   t   mapping_testst   WeakValueDictionaryTestCasec           B   sM   e  Z d  Z i e d ƒ d 6e d ƒ d 6e d ƒ d 6Z e j Z d „  Z RS(   s?   Check that WeakValueDictionary conforms to the mapping protocoli   R=  i   R?  i   t   key3c         C   s   |  j  j ƒ  S(   N(   t!   _WeakValueDictionaryTestCase__refR
  (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt
   _reference´  s    (	   R   R   t   __doc__R   Ra  R9   R   t	   type2testRb  (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyR_  °  s   -	t   WeakKeyDictionaryTestCasec           B   sM   e  Z d  Z i d e d ƒ 6d e d ƒ 6d e d ƒ 6Z e j Z d „  Z RS(   s=   Check that WeakKeyDictionary conforms to the mapping protocoli   R=  i   R?  i   R`  c         C   s   |  j  j ƒ  S(   N(   t   _WeakKeyDictionaryTestCase__refR
  (   R   (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRb  »  s    (	   R   R   Rc  R   Rf  R9   RÐ   Rd  Rb  (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyRe  ·  s   -	sÀ   Doctest for examples in the library reference: weakref.rst

>>> import weakref
>>> class Dict(dict):
...     pass
...
>>> obj = Dict(red=1, green=2, blue=3)   # this object is weak referencable
>>> r = weakref.ref(obj)
>>> print r() is obj
True

>>> import weakref
>>> class Object:
...     pass
...
>>> o = Object()
>>> r = weakref.ref(o)
>>> o2 = r()
>>> o is o2
True
>>> del o, o2
>>> print r()
None

>>> import weakref
>>> class ExtendedRef(weakref.ref):
...     def __init__(self, ob, callback=None, **annotations):
...         super(ExtendedRef, self).__init__(ob, callback)
...         self.__counter = 0
...         for k, v in annotations.iteritems():
...             setattr(self, k, v)
...     def __call__(self):
...         '''Return a pair containing the referent and the number of
...         times the reference has been called.
...         '''
...         ob = super(ExtendedRef, self).__call__()
...         if ob is not None:
...             self.__counter += 1
...             ob = (ob, self.__counter)
...         return ob
...
>>> class A:   # not in docs from here, just testing the ExtendedRef
...     pass
...
>>> a = A()
>>> r = ExtendedRef(a, foo=1, bar="baz")
>>> r.foo
1
>>> r.bar
'baz'
>>> r()[1]
1
>>> r()[1]
2
>>> r()[0] is a
True


>>> import weakref
>>> _id2obj_dict = weakref.WeakValueDictionary()
>>> def remember(obj):
...     oid = id(obj)
...     _id2obj_dict[oid] = obj
...     return oid
...
>>> def id2obj(oid):
...     return _id2obj_dict[oid]
...
>>> a = A()             # from here, just testing
>>> a_id = remember(a)
>>> id2obj(a_id) is a
True
>>> del a
>>> try:
...     id2obj(a_id)
... except KeyError:
...     print 'OK'
... else:
...     print 'WeakValueDictionary error'
OK

t
   libreftestc           C   s1   t  j t t t t t ƒ t  j t j	 t
 ƒ d  S(   N(   R    t   run_unittestR7   Rð   R_  Re  RÕ   t   run_doctestR(   t   modulesR   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt	   test_main  s    t   __main__(#   R    R(   t   unittestRZ   R9   Rq   R0  R
  R   t   testR    R
   R¾   R   R   R   R   R   R   R   R1  R1   t   TestCaseR2   R7   RÕ   Rð   R^  t   BasicTestMappingProtocolR_  Re  Rg  t   __test__Rk  R   (    (    (    s‡   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_weakref.pyt   <module>   sF   				ÿ ÿ ágÿ ÿ X	