
    /hhC&                         S SK r S SKrS SKrS SKJr   " S S\5      r " S S\5      r " S S\5      r " S	 S
\5      r	 " S S\
5      r " S S\5      r " S S\
5      r " S S\5      r " S S\5      r " S S\
5      r " S S\ R"                  S9r " S S\ R"                  S9r " S S\R(                  5      r " S S\5      r " S  S!\5      r " S" S#\R(                  5      r\S$:X  a  \R4                  " 5         gg)%    N)DynamicClassAttributec                       \ rS rSrSrg)PropertyBase	    N__name__
__module____qualname____firstlineno____static_attributes__r       H/opt/python-3.13.8/usr/lib/python3.13/test/test_dynamicclassattribute.pyr   r   	       r   r   c                       \ rS rSrSrg)PropertyGet   r   Nr   r   r   r   r   r      r   r   r   c                       \ rS rSrSrg)PropertySet   r   Nr   r   r   r   r   r      r   r   r   c                       \ rS rSrSrg)PropertyDel   r   Nr   r   r   r   r   r      r   r   r   c                   r    \ rS rSrS r\S 5       r\R                  S 5       r\R                  S 5       rSr	g)	BaseClass   c                     SU l         g N   _spamselfs    r   __init__BaseClass.__init__   s	    
r   c                     U R                   $ Nr    r"   s    r   spamBaseClass.spam        zzr   c                     Xl         g r'   r    r#   values     r   r(   r)      s    
r   c                     U ? g r'   r    r"   s    r   r(   r)   "   s    Jr   r    N)
r	   r
   r   r   r$   r   r(   setterdeleterr   r   r   r   r   r      sK       
[[  
\\ r   r   c                       \ rS rSr\R
                  S   r\R                  S 5       r\R                  S 5       r\R                  S 5       rSr
g)SubClass&   r(   c                 ,    [        U R                  5      er'   )r   r!   r"   s    r   r(   SubClass.spam*   s     $**%%r   c                 ,    [        U R                  5      er'   )r   r!   r,   s     r   r(   r5   /       $**%%r   c                 ,    [        U R                  5      er'   )r   r!   r"   s    r   r(   r5   3   r7   r   r   N)r	   r
   r   r   r   __dict__r(   getterr/   r0   r   r   r   r   r2   r2   &   sX    f%D	[[& & 
[[& & 
\\& &r   r2   c                   ,    \ rS rSrSrS r\" \SS9rSrg)PropertyDocBase7      c                     U R                   $ r'   r    r"   s    r   	_get_spamPropertyDocBase._get_spam9   s    zzr   spam spam spam)docr   N)	r	   r
   r   r   r!   r@   r   r(   r   r   r   r   r<   r<   7   s    E 0@ADr   r<   c                   V    \ rS rSr\R
                  S   r\R                  S 5       rSrg)PropertyDocSub=   r(   c                     U R                   $ r'   r    r"   s    r   r(   PropertyDocSub.spam?   r*   r   r   N)	r	   r
   r   r   r<   r9   r(   r:   r   r   r   r   rE   rE   =   s(    ##F+D	[[ r   rE   c                   V    \ rS rSr\R
                  S   r\R                  S 5       rSrg)PropertySubNewGetterD   r(   c                     gr   r   r"   s    r   r(   PropertySubNewGetter.spamF        r   r   N)	r	   r
   r   r   r   r9   r(   r:   r   r   r   r   rJ   rJ   D   s(    f%D	[[ r   rJ   c                   H    \ rS rSr\S 5       r\R                  S 5       rSrg)PropertyNewGetterK   c                     gNr>   r   r"   s    r   r(   PropertyNewGetter.spamL   rN   r   c                     g)N   r   r"   s    r   r(   rT   P   rN   r   r   N)r	   r
   r   r   r   r(   r:   r   r   r   r   rP   rP   K   s,      
[[ r   rP   c                   B    \ rS rSr\\R                  S 5       5       rSrg) ClassWithAbstractVirtualPropertyU   c                      g r'   r   r   r   r   color&ClassWithAbstractVirtualProperty.colorV        	r   r   N)	r	   r
   r   r   r   abcabstractmethodr[   r   r   r   r   rX   rX   U   s"      r   rX   )	metaclassc                   B    \ rS rSr\R
                  \S 5       5       rSrg) ClassWithPropertyAbstractVirtual[   c                      g r'   r   r   r   r   r[   &ClassWithPropertyAbstractVirtual.color\   r]   r   r   N)	r	   r
   r   r   r^   r_   r   r[   r   r   r   r   rb   rb   [   s"      r   rb   c                   R   \ rS rSrS rS r\R                  " \R                  R                  S:  S5      S 5       r\R                  " \R                  R                  S:  S5      S 5       rS r\R                  " \R                  R                  S:  S5      S	 5       rS
 rS rSrg)PropertyTestsa   c                    [        5       nU R                  UR                  S5        U R                  UR                  S5        SUl        U R                  UR                  S5        U R                  UR                  S5        [	        US5        U R                  [        US5      (       + 5        U R                  [        US5      (       + 5        SUl        U R                  UR                  S5        U R                  UR                  S5        g )Nr   
   r(   r!      )r   assertEqualr(   r!   delattr
assertTruehasattrr#   bases     r   !test_property_decorator_baseclass/PropertyTests.test_property_decorator_baseclassb   s    {A&Q'	B'R(fGD&112GD'223	B'R(r   c                     [        5       nU R                  [        [        US5        U R                  [        [
        USS 5        U R                  [        [        US5        g )Nr(   )r2   assertRaisesr   getattrr   setattrr   rm   r#   subs     r    test_property_decorator_subclass.PropertyTests.test_property_decorator_subclassq   sG    j+wV<+wVTB+wV<r      )Docstrings are omitted with -O2 and abovec                 ~    [        5       nU R                  UR                  R                  S   R                  S5        g )Nr(   zSubClass.getter)r2   rl   	__class__r9   __doc__rx   s     r   $test_property_decorator_subclass_doc2PropertyTests.test_property_decorator_subclass_docx   s1     j//7??ARSr   c                 ~    [        5       nU R                  UR                  R                  S   R                  S5        g )Nr(   zBaseClass.getter)r   rl   r   r9   r   rp   s     r   %test_property_decorator_baseclass_doc3PropertyTests.test_property_decorator_baseclass_doc~   s1     {008@@BTUr   c                     [        5       n[        5       nU R                  UR                  R                  S   R
                  S5        U R                  UR                  R                  S   R
                  S5        g )Nr(   rB   )r<   rE   rl   r   r9   r   )r#   rq   ry   s      r   test_property_decorator_doc)PropertyTests.test_property_decorator_doc   s^     008@@BRS//7??AQRr   c                 h   [        5       nU R                  UR                  S5        U R                  UR                  R                  S   R
                  S5        [        5       nU R                  UR                  S5        U R                  UR                  R                  S   R
                  S5        g )Nr   r(   znew docstringrV   )rJ   rl   r(   r   r9   r   rP   )r#   newgettersub	newgetters      r   !test_property_getter_doc_override/PropertyTests.test_property_getter_doc_override   s     ,-**A.//88@HH/Z%'	+,,55f=EEWr   c                 P  ^^ SS/ S/SS4 HG  m " U4S jS[         5      nU R                  UR                  S   R                  [	        T5      5        MI      " S	 S
[         5      mU R                  [        5          " U4S jS[         5      nS S S 5        g ! , (       d  f       g = f)NTFr>    1c                   <   > \ rS rSrS r Y \l        \" \5      rSrg)EPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C   c                     g r'   r   r"   s    r   fooIPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C.foo       r   r   Nr	   r
   r   r   r   __isabstractmethod__r   r   )vals   r   Cr      s    +.(+C0r   r   r   c                       \ rS rSrS r\rSrg)KPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBool   c                     [        5       er'   )
ValueErrorr"   s    r   __bool__TPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBool.__bool__   s
     l"r   r   N)r	   r
   r   r   r   __len__r   r   r   r   NotBoolr      s    #Gr   r   c                   F   > \ rS rSrS r Y " 5       \l        \" \5      rSrg)r      c                     g r'   r   r"   s    r   r   r      r   r   r   Nr   )r   s   r   r   r      s    +29(+C0r   )objectassertIsr9   r   boolru   r   )r#   r   r   r   s     @@r   ,test_property___isabstractmethod__descriptor:PropertyTests.test_property___isabstractmethod__descriptor   s    %aS"c2C1F 1
 MM!**U+@@$s)L 3	f 	 z*1F 1 +**s   ;B
B%c                    U R                  [        [        5        U R                  [        [        5         " S S[        5      nU R                  [        U5         " S S[        5      nU R                  [        U5         " S S[        5      nU R                  [        5         UR
                    S S S 5        U R                  U" 5       R
                  S5         " S S	[        5      nU R                  [        5         UR
                    S S S 5        U R                  U" 5       R
                  S
5        g ! , (       d  f       N= f! , (       d  f       NA= f)Nc                       \ rS rSrSrg)0PropertyTests.test_abstract_virtual.<locals>.APV   r   Nr   r   r   r   APVr          r   r   c                       \ rS rSrSrg)0PropertyTests.test_abstract_virtual.<locals>.AVP   r   Nr   r   r   r   AVPr      r   r   r   c                   *    \ rS rSr\S 5       rS rSrg)2PropertyTests.test_abstract_virtual.<locals>.Okay1   c                     U R                   $ r'   _colorr"   s    r   r[   8PropertyTests.test_abstract_virtual.<locals>.Okay1.color       {{"r   c                     SU l         g )Ncyanr   r"   s    r   r$   ;PropertyTests.test_abstract_virtual.<locals>.Okay1.__init__   s	    $r   r   Nr	   r
   r   r   r   r[   r$   r   r   r   r   Okay1r      s    "# ##%r   r   r   c                   *    \ rS rSr\S 5       rS rSrg)2PropertyTests.test_abstract_virtual.<locals>.Okay2   c                     U R                   $ r'   r   r"   s    r   r[   8PropertyTests.test_abstract_virtual.<locals>.Okay2.color   r   r   c                     SU l         g )Nmagentar   r"   s    r   r$   ;PropertyTests.test_abstract_virtual.<locals>.Okay2.__init__   s	    'r   r   Nr   r   r   r   Okay2r      s    "# ##(r   r   r   )ru   	TypeErrorrX   rb   AttributeErrorr[   rl   )r#   r   r   r   r   s        r   test_abstract_virtual#PropertyTests.test_abstract_virtual   s    )%EF)%EF	2 	)S)	2 	)S)	%4 	% ~.KK //	(4 	( ~.KK /	2 /. /.s   #D4=E4
E
Er   N)r	   r
   r   r   rr   rz   unittestskipIfsysflagsoptimizer   r   r   r   r   r   r   r   r   r   rg   rg   a   s    )= __SYY''1,@BTBT __SYY''1,@BVBVS __SYY''1,@BXBX1,3r   rg   c                       \ rS rSrSrg)PropertySub   r   Nr   r   r   r   r   r      s     r   r   c                       \ rS rSrSrSrg)PropertySubSlots   r   N)r	   r
   r   r   	__slots__r   r   r   r   r   r      s    Ir   r   c                   t   \ rS rSr\R
                  " \" \S5      S5      S 5       r\R
                  " \	R                  R                  S:  S5      S 5       r\R
                  " \	R                  R                  S:  S5      S 5       r\R
                  " \	R                  R                  S:  S5      S	 5       rS
rg)PropertySubclassTests   r   z9__doc__ is already present, __slots__ will have no effectc                 X      " S S[         5      n[        S5      e! [         a     g f = f)Nc                   J    \ rS rSr\S 5       r\" S\R                  5        Srg)FPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo   c                     grS   r   r"   s    r   r(   KPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spam   s     r   
r   N)	r	   r
   r   r   r   r(   printr   r   r   r   r   Foor      s$    ! " d4<<(r   r   zAttributeError not raised)r   	Exceptionr   r#   r   s     r   #test_slots_docstring_copy_exception9PropertySubclassTests.test_slots_docstring_copy_exception   s5    
	9)f ) 788  		s    
))r|   r}   c                 t     " S S[         5      nU R                  UR                  S   R                  S5        g )Nc                   $    \ rS rSr\S 5       rSrg)6PropertySubclassTests.test_docstring_copy.<locals>.Foo   c                     grS   r   r"   s    r   r(   ;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spam        r   r   Nr	   r
   r   r   r   r(   r   r   r   r   r   r           r   r   r(   .spam wrapped in DynamicClassAttribute subclassr   rl   r9   r   r   s     r   test_docstring_copy)PropertySubclassTests.test_docstring_copy   s3    	& 	
 	LL ((<	>r   c                   ^  " S S[         5      mT" 5       nU R                  UR                  S5        SUl        U R                  UR                  S5        U R                  TR                  S   R                  S5         " U4S jST5      nU" 5       nU R                  UR                  S5        S	Ul        U R                  UR                  S
5        U R                  UR                  S   R                  S5        g )Nc                   N    \ rS rSrS r\S 5       r\R                  S 5       rSrg)OPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo   c                     SU l         g rS   r    r"   s    r   r$   XPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.__init__   s    Q
r   c                     U R                   $ r'   r    r"   s    r   r(   TPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.spam   s     zz!r   c                     Xl         g r'   r    r,   s     r   r(   r     s	     #
r   r    N)	r	   r
   r   r   r$   r   r(   r/   r   r   r   r   r   r      s/    ." " [[# #r   r   r>   r|   r(   r   c                   Z   > \ rS rSr Y R                  S   r\R                  S 5       rSrg)RPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub   r(   c                     SU l         g )Neggsr    r,   s     r   r(   WPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spam  s     $
r   r    N)r	   r
   r   r   r9   r(   r/   r   )r   s   r   FooSubr     s'    <<'D[[$ $r   r	     r  )r   rl   r(   r9   r   )r#   r   r	  foosubr   s       @r   ,test_property_setter_copies_getter_docstringBPropertySubclassTests.test_property_setter_copies_getter_docstring   s    		#& 		# e1%1%LL ((<	>	$S 	$ a(f-OOF#++<	>r   c                   ^  " S S[         5      nU R                  UR                  S   R                  S5         " S S[         5      m " U4S jST5      nU R                  UR                  S   R                  S5        g )	Nc                   H    \ rS rSr\S 5       r\R                  S 5       rSrg)IPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Fooi  c                     grS   r   r"   s    r   r(   NPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spam  r   r   c                     gNr|   r   r"   s    r   r(   r    r   r   r   N)r	   r
   r   r   r   r(   r:   r   r   r   r   r   r    s,      [[ r   r   r(   za new docstringc                   $    \ rS rSr\S 5       rSrg)MPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasei  c                     grS   r   r"   s    r   r(   RPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBase.spam  r   r   r   Nr   r   r   r   FooBaser    r   r   r  c                   Z   > \ rS rSr Y R                  S   r\R                  S 5       rSrg)JPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2i!  r(   c                     gr  r   r"   s    r   r(   OPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spam#  r   r   r   N)r	   r
   r   r   r9   r(   r:   r   )r  s   r   Foo2r  !  s)    ##F+D[[ r   r  r   )r#   r   r  r  s      @r   &test_property_new_getter_new_docstring<PropertySubclassTests.test_property_new_getter_new_docstring  sk    	& 	 	f-557HI	f 	
	7 	 	f-557HIr   r   N)r	   r
   r   r   r   r   ro   r   r   r   r   r   r   r  r  r   r   r   r   r   r      s    __W-y9GI9I9 __SYY''1,@B>B> __SYY''1,@B>B>@ __SYY''1,@BJBJr   r   __main__)r^   r   r   typesr   r   r   r   r   r   r   r   r2   r<   rE   rJ   rP   ABCMetarX   rb   TestCaserg   r   r   r   r	   mainr   r   r   <module>r&     s    
  '	9 		, 		, 		, 	 "&y &"Bf B_ 9    c3H%% c3N6' 6, XJH-- XJx zMMO r   