HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_dynamicclassattribute.cpython-310.opt-1.pyc
o

�iC&�@sHddlZddlZddlZddlmZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�Z	Gdd�de
�ZGd
d�de�ZGdd�de
�Z
Gdd�de
�ZGdd�de�ZGdd�de
�ZGdd�dejd�ZGdd�dejd�ZGdd�dej�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#ej�Zed$kr�e��dSdS)%�N)�DynamicClassAttributec@�eZdZdS)�PropertyBaseN��__name__�
__module__�__qualname__�r	r	�</usr/local/lib/python3.10/test/test_dynamicclassattribute.pyr	�rc@r)�PropertyGetNrr	r	r	r
rrrc@r)�PropertySetNrr	r	r	r
r
rr
c@r)�PropertyDelNrr	r	r	r
rrrc@s<eZdZdd�Zedd��Zejdd��Zejdd��ZdS)�	BaseClasscC�
d|_dS)N���_spam��selfr	r	r
�__init__�
zBaseClass.__init__cC�|jS)�BaseClass.getterrrr	r	r
�spam�zBaseClass.spamcCs
||_dS�Nr�r�valuer	r	r
r�
cCs|`dSrrrr	r	r
r"sN)rrrrrr�setter�deleterr	r	r	r
rs

rc@s@eZdZejdZejdd��Zejdd��Zejdd��ZdS)�SubClassrcC�
t|j��)�SubClass.getter)rrrr	r	r
r*�
z
SubClass.spamcCr#r)r
rrr	r	r
r/rcCr#r)rrrr	r	r
r3rN)	rrrr�__dict__r�getterr r!r	r	r	r
r"&s


r"c@s$eZdZdZdd�Zeedd�ZdS)�PropertyDocBase�cCrrrrr	r	r
�	_get_spam9�zPropertyDocBase._get_spam�spam spam spam)�docN)rrrrr*rrr	r	r	r
r(7sr(c@�$eZdZejdZejdd��ZdS)�PropertyDocSubrcCr)z*The decorator does not use this doc stringrrr	r	r
r?rzPropertyDocSub.spamN)rrrr(r&rr'r	r	r	r
r/=�
r/c@r.)�PropertySubNewGetterrcC�dS)�
new docstringrr	rr	r	r
rF�zPropertySubNewGetter.spamN)rrrrr&rr'r	r	r	r
r1Dr0r1c@�&eZdZedd��Zejdd��ZdS)�PropertyNewGettercCr2)zoriginal docstringr)r	rr	r	r
rLr4zPropertyNewGetter.spamcCr2)r3�r	rr	r	r
rPr4N)rrrrrr'r	r	r	r
r6K�

r6c@seZdZeejdd���ZdS)� ClassWithAbstractVirtualPropertycC�dSrr	r	r	r	r
�colorVr4z&ClassWithAbstractVirtualProperty.colorN)rrrr�abc�abstractmethodr;r	r	r	r
r9Usr9)�	metaclassc@seZdZejedd���ZdS)� ClassWithPropertyAbstractVirtualcCr:rr	r	r	r	r
r;\r4z&ClassWithPropertyAbstractVirtual.colorN)rrrr<r=rr;r	r	r	r
r?[sr?c@s�eZdZdd�Zdd�Ze�ejj	dkd�dd��Z
e�ejj	dkd�d	d
��Zdd�Ze�ejj	dkd�d
d��Z
dd�Zdd�ZdS)�
PropertyTestscCs�t�}|�|jd�|�|jd�d|_|�|jd�|�|jd�t|d�|�t|d��|�t|d��d|_|�|jd�|�|jd�dS)Nr�
rr�)r�assertEqualrr�delattrZ
assertTrue�hasattr�r�baser	r	r
�!test_property_decorator_baseclassbs
z/PropertyTests.test_property_decorator_baseclasscCs<t�}|�tt|d�|�tt|dd�|�tt|d�dS)Nr)r"�assertRaisesr�getattrr
�setattrrrD�r�subr	r	r
� test_property_decorator_subclassqsz.PropertyTests.test_property_decorator_subclass��)Docstrings are omitted with -O2 and abovecC� t�}|�|jjdjd�dS)Nrr$)r"rC�	__class__r&�__doc__rLr	r	r
�$test_property_decorator_subclass_docx�z2PropertyTests.test_property_decorator_subclass_doccCrQ)Nrr)rrCrRr&rSrFr	r	r
�%test_property_decorator_baseclass_doc~rUz3PropertyTests.test_property_decorator_baseclass_doccCs<t�}t�}|�|jjdjd�|�|jjdjd�dS)Nrr,)r(r/rCrRr&rS)rrGrMr	r	r
�test_property_decorator_doc�sz)PropertyTests.test_property_decorator_doccCsXt�}|�|jd�|�|jjdjd�t�}|�|jd�|�|jjdjd�dS)Nrrr3r7)r1rCrrRr&rSr6)rZnewgettersubZ	newgetterr	r	r
�!test_property_getter_doc_override�sz/PropertyTests.test_property_getter_doc_overridecs�ddgdgddfD]�G�fdd�dt�}|�|jdjt���q	Gd	d
�d
t��|�t��G�fdd�dt�}Wd�dS1sEwYdS)NTFr)��1cs"eZdZdd�Z�e_ee�ZdS)�EPropertyTests.test_property___isabstractmethod__descriptor.<locals>.CcSr:rr	rr	r	r
�foo���IPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C.fooN�rrrr\�__isabstractmethod__rr	)�valr	r
�C�srbr\c@seZdZdd�ZeZdS)zKPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBoolcSst��r)�
ValueErrorrr	r	r
�__bool__�r+zTPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBool.__bool__N)rrrrd�__len__r	r	r	r
�NotBool�srfcs$eZdZdd�Z��e_ee�ZdS)r[cSr:rr	rr	r	r
r\�r]r^Nr_r	)rfr	r
rb�s)�objectZassertIsr&r`�boolrIrc)rrbr	)rfrar
�,test_property___isabstractmethod__descriptor�s"�z:PropertyTests.test_property___isabstractmethod__descriptorcCs�|�tt�|�tt�Gdd�dt�}|�t|�Gdd�dt�}|�t|�Gdd�dt�}|�t��|jWd�n1sCwY|�|�jd�Gdd	�d	t�}|�t��|jWd�n1skwY|�|�jd
�dS)Nc@r)z0PropertyTests.test_abstract_virtual.<locals>.APVNrr	r	r	r
�APV�rrjc@r)z0PropertyTests.test_abstract_virtual.<locals>.AVPNrr	r	r	r
�AVP�rrkc@� eZdZedd��Zdd�ZdS)z2PropertyTests.test_abstract_virtual.<locals>.Okay1cSrr�Z_colorrr	r	r
r;��z8PropertyTests.test_abstract_virtual.<locals>.Okay1.colorcSr)N�cyanrmrr	r	r
r�rz;PropertyTests.test_abstract_virtual.<locals>.Okay1.__init__N�rrrrr;rr	r	r	r
�Okay1��
rqroc@rl)z2PropertyTests.test_abstract_virtual.<locals>.Okay2cSrrrmrr	r	r
r;�rnz8PropertyTests.test_abstract_virtual.<locals>.Okay2.colorcSr)N�magentarmrr	r	r
r�rz;PropertyTests.test_abstract_virtual.<locals>.Okay2.__init__Nrpr	r	r	r
�Okay2�rrrtrs)rI�	TypeErrorr9r?�AttributeErrorr;rC)rrjrkrqrtr	r	r
�test_abstract_virtual�s ��z#PropertyTests.test_abstract_virtualN)rrrrHrN�unittest�skipIf�sys�flags�optimizerTrVrWrXrirwr	r	r	r
r@as$�
�
�
r@c@seZdZdZdS)�PropertySubz+This is a subclass of DynamicClassAttributeN)rrrrSr	r	r	r
r}�sr}c@seZdZdZdZdS)�PropertySubSlotszBThis is a subclass of DynamicClassAttribute that defines __slots__r	N)rrrrS�	__slots__r	r	r	r
r~�sr~c@szeZdZe�eed�d�dd��Ze�ej	j
dkd�dd��Ze�ej	j
dkd�d	d
��Ze�ej	j
dkd�dd��Z
d
S)�PropertySubclassTestsrSz9__doc__ is already present, __slots__ will have no effectcCs0z
Gdd�dt�}Wtd��tyYdSw)Nc@s$eZdZedd��Zedej�dS)zFPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.FoocSr2)z5Trying to copy this docstring will raise an exceptionr)r	rr	r	r
r�r4zKPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spam�
N)rrrr~r�printrSr	r	r	r
�Foo�s
r�zAttributeError not raised)rgrv�	Exception�rr�r	r	r
�#test_slots_docstring_copy_exception�s	��z9PropertySubclassTests.test_slots_docstring_copy_exceptionrOrPcCs(Gdd�dt�}|�|jdjd�dS)Nc@�eZdZedd��ZdS)z6PropertySubclassTests.test_docstring_copy.<locals>.FoocSr2)�.spam wrapped in DynamicClassAttribute subclassr)r	rr	r	r
r�r4z;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spamN�rrrr}rr	r	r	r
r���r�rr��rgrCr&rSr�r	r	r
�test_docstring_copy�s

�z)PropertySubclassTests.test_docstring_copycs�Gdd�dt����}|�|jd�d|_|�|jd�|��jdjd�G�fdd�d��}|�}|�|jd�d	|_|�|jd
�|�|jdjd�dS)Nc@s.eZdZdd�Zedd��Zejdd��ZdS)zOPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FoocSr)Nr)rrr	r	r
r�s
zXPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.__init__cSr)r�rrr	r	r
r�rzTPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.spamcSs
||_dS)zthis docstring is ignoredNrrr	r	r
r�r%N)rrrrr}rr r	r	r	r
r��s
r�r)rOrr�c�$eZdZ�jdZejdd��ZdS)zRPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSubrcSs
d|_dS)zanother ignored docstring�eggsNrrr	r	r
rr%zWPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spamN)rrrr&rr r	�r�r	r
�FooSubr0r��r�)rgrCrr&rS)rr\r�Zfoosubr	r�r
�,test_property_setter_copies_getter_docstring�s$

�
�zBPropertySubclassTests.test_property_setter_copies_getter_docstringcs`Gdd�dt�}|�|jdjd�Gdd�dt��G�fdd�d��}|�|jdjd�dS)	Nc@r5)zIPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FoocSr2�za docstringr)r	rr	r	r
rr4zNPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spamcSr2��a new docstringrOr	rr	r	r
rr4N)rrrr}rr'r	r	r	r
r�r8r�rr�c@r�)zMPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasecSr2r�r	rr	r	r
rr4zRPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBase.spamNr�r	r	r	r
�FooBaser�r�cr�)zJPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2rcSr2r�r	rr	r	r
r#r4zOPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spamN)rrrr&rr'r	�r�r	r
�Foo2!r0r�r�)rr�r�r	r�r
�&test_property_new_getter_new_docstrings
	z<PropertySubclassTests.test_property_new_getter_new_docstringN)rrrrxryrEr~r�rzr{r|r�r�r�r	r	r	r
r��s"�

�

�
 �r��__main__)r<rzrx�typesrr�rrr
rrgrr"r(r/r1r6�ABCMetar9r?ZTestCaser@r}r~r�r�mainr	r	r	r
�<module>s.
g\�