Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/test_property.cpython-38.opt-2.pyc
U

>��g#�@sddlZddlZddlmZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de	�Z
Gd
d�de
�ZGdd�de	�ZGdd�de�Z
Gdd�de
�ZGdd�de	�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�dej�Zedk�re��dS) �N)�supportc@seZdZdS)�PropertyBaseN��__name__�
__module__�__qualname__�rr�1/opt/cppython/lib/python3.8/test/test_property.pyrsrc@seZdZdS)�PropertyGetNrrrrr	r
sr
c@seZdZdS)�PropertySetNrrrrr	rsrc@seZdZdS)�PropertyDelNrrrrr	rsrc@s<eZdZdd�Zedd��Zejdd��Zejdd��ZdS)�	BaseClasscCs
d|_dS�N���_spam��selfrrr	�__init__szBaseClass.__init__cCs|jS�Nrrrrr	�spamszBaseClass.spamcCs
||_dSrr�r�valuerrr	rscCs|`dSrrrrrr	r!sN)rrrr�propertyr�setter�deleterrrrr	r
s

r
c@s8eZdZejjdd��Zejdd��Zejdd��ZdS)�SubClasscCst|j��dSr)r
rrrrr	r'sz
SubClass.spamcCst|j��dSr)rrrrrr	r,scCst|j��dSr)rrrrrr	r0sN)rrrr
r�getterrrrrrr	r%s

rc@s$eZdZdZdd�Zeedd�ZdS)�PropertyDocBase�cCs|jSrrrrrr	�	_get_spam6szPropertyDocBase._get_spam�spam spam spam��docN)rrrrr rrrrrr	r4src@seZdZejjdd��ZdS)�PropertyDocSubcCs|jSrrrrrr	r;szPropertyDocSub.spamN)rrrrrrrrrr	r$:sr$c@seZdZejjdd��ZdS)�PropertySubNewGettercCsdSrrrrrr	rAszPropertySubNewGetter.spamN)rrrr
rrrrrr	r%@sr%c@s&eZdZedd��Zejdd��ZdS)�PropertyNewGettercCsdS�Nrrrrrr	rGszPropertyNewGetter.spamcCsdS)N�rrrrr	rKsN)rrrrrrrrrr	r&Fs
r&c@s�eZdZdd�Zdd�Ze�ejj	dkd�dd��Z
e�ejj	dkd�d	d
��Zdd�Ze�ejj	dkd�d
d��Z
dd�Ze�ejj	dkd�dd��Ze�ejj	dkd�dd��Zejdd��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�baserrr	�!test_property_decorator_baseclassQs
z/PropertyTests.test_property_decorator_baseclasscCs<t�}|�tt|d�|�tt|dd�|�tt|d�dS)Nr)r�assertRaisesr
�getattrr�setattrrr-�r�subrrr	� test_property_decorator_subclass`sz.PropertyTests.test_property_decorator_subclass��)Docstrings are omitted with -O2 and abovecCst�}|�|jjjd�dS)NzSubClass.getter)rr,�	__class__r�__doc__r5rrr	�$test_property_decorator_subclass_docgsz2PropertyTests.test_property_decorator_subclass_doccCst�}|�|jjjd�dS)NzBaseClass.getter)r
r,r:rr;r/rrr	�%test_property_decorator_baseclass_docmsz3PropertyTests.test_property_decorator_baseclass_doccCs4t�}t�}|�|jjjd�|�|jjjd�dS)Nr!)rr$r,r:rr;)rr0r6rrr	�test_property_decorator_docssz)PropertyTests.test_property_decorator_doccCsPt�}|�|jd�|�|jjjd�t�}|�|jd�|�|jjjd�dS)Nrz
new docstringr()r%r,rr:r;r&)rZnewgettersubZ	newgetterrrr	�!test_property_getter_doc_overrideysz/PropertyTests.test_property_getter_doc_overridec	s�ddgdgddfD],�G�fdd�dt�}|�|jjt���qGdd	�d	t��|�t��"G�fd
d�dt�}|jjW5QRXdS)NTFr��1cs"eZdZdd�Z�e_ee�ZdS)�EPropertyTests.test_property___isabstractmethod__descriptor.<locals>.CcSsdSrrrrrr	�foo�s�IPropertyTests.test_property___isabstractmethod__descriptor.<locals>.C.fooN�rrrrC�__isabstractmethod__rr)�valrr	�C�srHc@seZdZdd�ZeZdS)zKPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBoolcSs
t��dSr)�
ValueErrorrrrr	�__bool__�szTPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBool.__bool__N)rrrrJ�__len__rrrr	�NotBool�srLcs$eZdZdd�Z��e_ee�ZdS)rBcSsdSrrrrrr	rC�srDNrEr)rLrr	rH�s)�objectZassertIsrCrF�boolr2rI)rrHr)rLrGr	�,test_property___isabstractmethod__descriptor�sz:PropertyTests.test_property___isabstractmethod__descriptorcCs0tdd�}|�|jd�d|_|�|jd�dS)NZbasicr"Zextended)rr,r;)r�prrr	�"test_property_builtin_doc_writable�s
z0PropertyTests.test_property_builtin_doc_writablecCsHGdd�dt�}|�}|�|jjjd�d|jj_|�|jjjd�dS)Nc@seZdZedd��ZdS)zOPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoccSsdS�N�eggsrrrrr	r�szTPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoc.spamN)rrrrrrrrr	�PropertyWritableDoc�srTZEggsZSpam)rMr,r:rr;)rrTr6rrr	�$test_property_decorator_doc_writable�s

z2PropertyTests.test_property_decorator_doc_writablecCsXt�td�}tdddd�}|�}td�D]}|�dddd�q(|j|�|ddd	�dS)
N�gettotalrefcount�fget�fset�fdelr#�drr*)Zdelta)rZ
get_attribute�sysr�rangerZassertAlmostEqual)rrVZ	fake_propZrefs_before�irrr	�test_refleaks_in___init__�sz'PropertyTests.test_refleaks_in___init__N)rrrr1r7�unittest�skipIfr[�flags�optimizer<r=r>r?rOrQrUrZ
refcount_testr^rrrr	r)Ps4�
�
�
�
�

r)c@seZdZdS)�PropertySubNrrrrr	rc�srcc@seZdZdZdS)�PropertySubSlotsrN)rrr�	__slots__rrrr	rd�srdc@sheZdZdd�Ze�ejjdkd�dd��Z	e�ejjdkd�dd��Z
e�ejjdkd�d	d
��ZdS)�PropertySubclassTestscCs6zGdd�dt�}Wntk
r(Yn
Xtd��dS)Nc@seZdZedd��ZdS)zFPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.FoocSsdSr'rrrrr	r�szKPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spamN)rrrrdrrrrr	�Foo�srgzAttributeError not raised)rM�AttributeError�	Exception�rrgrrr	�#test_slots_docstring_copy_exception�s
z9PropertySubclassTests.test_slots_docstring_copy_exceptionr8r9cCs$Gdd�dt�}|�|jjd�dS)Nc@seZdZedd��ZdS)z6PropertySubclassTests.test_docstring_copy.<locals>.FoocSsdSr'rrrrr	r�sz;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spamN�rrrrcrrrrr	rg�srg�!spam wrapped in property subclass�rMr,rr;rjrrr	�test_docstring_copy�s
�z)PropertySubclassTests.test_docstring_copycs�Gdd�dt����}|�|jd�d|_|�|jd�|��jjd�G�fdd�d��}|�}|�|jd�d|_|�|jd	�|�|jjd�dS)
Nc@s.eZdZdd�Zedd��Zejdd��ZdS)zOPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FoocSs
d|_dSr'rrrrr	r��zXPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.__init__cSs|jSrrrrrr	r�szTPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.spamcSs
||_dSrrrrrr	r�sN)rrrrrcrrrrrr	rg�s

rgrr8rmcseZdZ�jjdd��ZdS)zRPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSubcSs
d|_dSrRrrrrr	r�szWPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spamN)rrrrrr�rgrr	�FooSub�srr�rSrn)rrCrrZfoosubrrqr	�,test_property_setter_copies_getter_docstring�s$
��zBPropertySubclassTests.test_property_setter_copies_getter_docstringcsXGdd�dt�}|�|jjd�Gdd�dt��G�fdd�d��}|�|jjd�dS)Nc@s&eZdZedd��Zejdd��ZdS)zIPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FoocSsdSr'rrrrr	rszNPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spamcSsdS�Nr8rrrrr	rsN)rrrrcrrrrrr	rgs
rgza new docstringc@seZdZedd��ZdS)zMPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasecSsdSr'rrrrr	r
szRPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBase.spamNrlrrrr	�FooBasesrvcseZdZ�jjdd��ZdS)zJPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2cSsdSrurrrrr	rszOPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spamN)rrrrrr�rvrr	�Foo2srxrn)rrgrxrrwr	�&test_property_new_getter_new_docstring�s
	z<PropertySubclassTests.test_property_new_getter_new_docstringN)rrrrkr_r`r[rarbrortryrrrr	rf�s�

�
�rf�__main__)r[r_�testrrirr
rrrMr
rrr$r%r&ZTestCaser)rrcrdrfr�mainrrrr	�<module>s$
lW


F1le Man4ger