+
    ^|iP	                    Z    R t ^ RIHt ^ RIt^ RIt^ RIHtHt R R ltR R lt	R R	 lt
R# )
z9A fancy version of Python's builtin :func:`dir` function.)annotationsN)AnyCallablec               $    V ^8  d   QhRRRRRR/# )   objobjectattrstrreturnbool )formats   "4/usr/lib/python3/dist-packages/IPython/utils/dir2.py__annotate__r      s!      f C D     c                .     \        W4       R#     R# ; i)z^In recent versions of Python, hasattr() only catches AttributeError.
This catches all errors.
TF)getattr)r   r	   s   &&r   safe_hasattrr      s    s    c                    V ^8  d   QhRRRR/# )r   r   r   r   z	list[str]r   )r   s   "r   r   r      s      f  r   c                B    \        \        V 4      4      p\        V R4      '       d&   V\        \        V P                  4      4      ,          pV Uu. uF  p\        V\        4      '       g   K  VNK  	  pp\        V4      #   \         d    \        4       p Li ; iu upi )aZ  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   
isinstancer
   sorted)r   wordsws   &  r   dir2r      s    CH
 C%%S'((
 41As!3QQE4%=   5s   B B.BBBc               $    V ^8  d   QhRRRRRR/# )r   r   r   namer
   r   zCallable[..., Any] | Noner   )r   s   "r   r   r   8   s"       s /H r   c                2    \        V RR4      pTe   R#  \        YR4      p\        P                  ! T 4      '       d#   \	        T\
        P                  4      '       g   R# \        T4      '       d   T# R#   \         d     R# i ; i  \         d     R# i ; i)a-  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   r!   canaryms   &&  r   get_real_methodr+   8   s    H$O Ct$ sJq%2B2B$C$C{{%    s"   A5 B 5BBBB)__doc__
__future__r   r$   r&   typingr   r   r   r   r+   r   r   r   <module>r/      s%    ?
 #    >r   