| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/IPython/utils/__pycache__/ |
Upload File : |
�
}�e� � �* � d Z ddlZddlZd� Zd� Zd� Zy)z:A fancy version of Python's builtin :func:`dir` function.
� Nc �, � t | |� y# Y yxY w)zfIn recent versions of Python, hasattr() only catches AttributeError.
This catches all errors.
TF)�getattr)�obj�attrs �4/usr/lib/python3/dist-packages/IPython/utils/dir2.py�safe_hasattrr s � ����T������s � �c � � t t | � � }t | d� r!|t t | j � � z }|D �cg c] }t |t � s�|�� }}t |� S # t $ r
t � }Y �mw xY wc c}w )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__)�set�dir� Exceptionr r
�
isinstance�str�sorted)r �words�ws r �dir2r s| � ���C��H�
��
�C��%�
��S����'�(�(��
�4�1��A�s�!3�Q�4�E�4��%�=��� � ������
5s �A. �B�B�.B�Bc � � t | dd� }|�y t | |d� }t j | � rt |t
j � syt |� r|S y# t $ r Y yw xY w# t $ r Y yw xY w)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.
�(_ipython_canary_method_should_not_exist_N)r r
�inspect�isclassr �types�
MethodType�callable)r �name�canary�ms r �get_real_methodr 6 s� � ����H�$�O�� �����C��t�$�� ���s��J�q�%�2B�2B�$C����{�����% � ���� � ���s"