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-1.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)�BaseClass.getterrrrrr	�spamszBaseClass.spamcCs
||_dS�Nr�r�valuerrr	rscCs|`dSrrrrrr	r!sN)rrrr�propertyr�setter�deleterrrrr	r
s

r
c@s8eZdZejjdd��Zejdd��Zejdd��ZdS)�SubClasscCst|j��dS)�SubClass.getterN)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|jS)z*The decorator does not use this doc stringrrrrr	r;szPropertyDocSub.spamN)rrrrrrrrrr	r%:sr%c@seZdZejjdd��ZdS)�PropertySubNewGettercCsdS)�
new docstringrrrrrr	rAszPropertySubNewGetter.spamN)rrrr
rrrrrr	r&@sr&c@s&eZdZedd��Zejdd��ZdS)�PropertyNewGettercCsdS)zoriginal docstringr rrrrr	rGszPropertyNewGetter.spamcCsdS)r'�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)Nr)rr-�	__class__r�__doc__r6rrr	�$test_property_decorator_subclass_docgsz2PropertyTests.test_property_decorator_subclass_doccCst�}|�|jjjd�dS)Nr)r
r-r;rr<r0rrr	�%test_property_decorator_baseclass_docmsz3PropertyTests.test_property_decorator_baseclass_doccCs4t�}t�}|�|jjjd�|�|jjjd�dS)Nr")rr%r-r;rr<)rr1r7rrr	�test_property_decorator_docssz)PropertyTests.test_property_decorator_doccCsPt�}|�|jd�|�|jjjd�t�}|�|jd�|�|jjjd�dS)Nrr'r))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�rrrrD�__isabstractmethod__rr)�valrr	�C�srIc@seZdZdd�ZeZdS)zKPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBoolcSs
t��dSr)�
ValueErrorrrrr	�__bool__�szTPropertyTests.test_property___isabstractmethod__descriptor.<locals>.NotBool.__bool__N)rrrrK�__len__rrrr	�NotBool�srMcs$eZdZdd�Z��e_ee�ZdS)rCcSsdSrrrrrr	rD�srENrFr)rMrr	rI�s)�objectZassertIsrDrG�boolr3rJ)rrIr)rMrHr	�,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)�Eggs�eggsrrrrr	r�szTPropertyTests.test_property_decorator_doc_writable.<locals>.PropertyWritableDoc.spamN)rrrrrrrrr	�PropertyWritableDoc�srUrSZSpam)rNr-r;rr<)rrUr7rrr	�$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)rrWZ	fake_propZrefs_before�irrr	�test_refleaks_in___init__�sz'PropertyTests.test_refleaks_in___init__N)rrrr2r8�unittest�skipIfr\�flags�optimizer=r>r?r@rPrRrVrZ
refcount_testr_rrrr	r*Ps4�
�
�
�
�

r*c@seZdZdZdS)�PropertySubzThis is a subclass of propertyN)rrrr<rrrr	rd�srdc@seZdZdZdZdS)�PropertySubSlotsz5This is a subclass of property that defines __slots__rN)rrrr<�	__slots__rrrr	re�srec@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>.FoocSsdS)z5Trying to copy this docstring will raise an exceptionr rrrrr	r�szKPropertySubclassTests.test_slots_docstring_copy_exception.<locals>.Foo.spamN)rrrrerrrrr	�Foo�srhzAttributeError not raised)rN�AttributeError�	Exception�rrhrrr	�#test_slots_docstring_copy_exception�s
z9PropertySubclassTests.test_slots_docstring_copy_exceptionr9r:cCs$Gdd�dt�}|�|jjd�dS)Nc@seZdZedd��ZdS)z6PropertySubclassTests.test_docstring_copy.<locals>.FoocSsdS)�!spam wrapped in property subclassr rrrrr	r�sz;PropertySubclassTests.test_docstring_copy.<locals>.Foo.spamN�rrrrdrrrrr	rh�srhrm�rNr-rr<rkrrr	�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|_dS)Nr rrrrr	r��zXPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.__init__cSs|jS)rmrrrrr	r�szTPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.Foo.spamcSs
||_dS)zthis docstring is ignoredNrrrrr	r�sN)rrrrrdrrrrrr	rh�s

rhr r9rmcseZdZ�jjdd��ZdS)zRPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSubcSs
d|_dS)zanother ignored docstringrTNrrrrr	r�szWPropertySubclassTests.test_property_setter_copies_getter_docstring.<locals>.FooSub.spamN)rrrrrr�rhrr	�FooSub�srs�rTro)rrDrsZfoosubrrrr	�,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>.FoocSsdS�za docstringr rrrrr	rszNPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo.spamcSsdS��a new docstringr9rrrrr	rsN)rrrrdrrrrrr	rhs
rhrxc@seZdZedd��ZdS)zMPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBasecSsdSrvrrrrr	r
szRPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.FooBase.spamNrnrrrr	�FooBasesrycseZdZ�jjdd��ZdS)zJPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2cSsdSrwrrrrr	rszOPropertySubclassTests.test_property_new_getter_new_docstring.<locals>.Foo2.spamN)rrrrrr�ryrr	�Foo2sr{ro)rrhr{rrzr	�&test_property_new_getter_new_docstring�s
	z<PropertySubclassTests.test_property_new_getter_new_docstringN)rrrrlr`rar\rbrcrprur|rrrr	rg�s�

�
�rg�__main__)r\r`�testrrjrr
rrrNr
rrr%r&r(ZTestCaser*rrdrergr�mainrrrr	�<module>s$
lW


F1le Man4ger