Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/utils/__pycache__/dir2.cpython-39.pyc
Ðазад
a o�h� � @ s0 d Z ddlZddlZdd� Zdd� Zdd� ZdS ) z:A fancy version of Python's builtin :func:`dir` function. � Nc C s$ zt | |� W dS Y dS 0 dS )zfIn recent versions of Python, hasattr() only catches AttributeError. This catches all errors. TFN)�getattr)�obj�attr� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/utils/dir2.py�safe_hasattr s r c C s\ zt t| ��}W n ty( t � }Y n0 t| d�rF|t t| j��O }dd� |D �}t|�S )av dir2(obj) -> list of strings Extended version of the Python builtin dir(), which does a few extra checks. This version is guaranteed to return only a list of true strings, whereas dir() returns anything that objects inject into themselves, even if they are later not really valid for attribute access (many extension libraries have such bugs). � __class__c S s g | ]}t |t�r|�qS r )� isinstance�str)�.0�wr r r � <listcomp>2 � zdir2.<locals>.<listcomp>)�set�dir� Exceptionr r �sorted)r �wordsr r r �dir2 s r c C s� zt | dd�}W n ty$ Y dS 0 |dur2dS zt | |d�}W n tyV Y dS 0 t�| �rrt|tj�srdS t|�r~|S dS )aE Like getattr, but with a few extra sanity checks: - If obj is a class, ignore everything except class methods - Check if obj is a proxy that claims to have all attributes - Catch attribute access failing with any exception - Check that the attribute is a callable object Returns the method or None. Z(_ipython_canary_method_should_not_exist_N)r r �inspect�isclassr �types� MethodType�callable)r �nameZcanary�mr r r �get_real_method6 s r )�__doc__r r r r r r r r r �<module> s
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка