B
    [                 @   sR   d Z ddlmZmZ ddlmZ ddlZeddddd	d
 Zdd Zdd Z	dS )zL
This module adds several functions for interactive source code inspection.
    )print_functiondivision)
deprecatedNz*?? in IPython/Jupyter or inspect.getsourcei9:  z1.3)Z
useinsteadZissueZdeprecated_since_versionc             C   s$   t dt|   t t|  dS )z3
    Prints the source code of a given object.
    zIn file: %sN)printinspectZgetsourcefileZ	getsource)object r   5lib/python3.7/site-packages/sympy/utilities/source.pysource
   s    r
   c             C   sP   t | trLt| \}}|dkrLtt|i i dg|} t| sLtd||f | S )z
    Convert a string version of a class name to the object.

    For example, get_class('sympy.core.Basic') will return
    class Basic located in module sympy.core
     *z'%s.%s' is not a callable.)
isinstancestrget_mod_funcgetattr
__import__callableAttributeError)Zlookup_viewmod_nameZ	func_namer   r   r	   	get_class   s    
r   c             C   s6   |  d}|dkr| dfS | d| | |d d fS )a  
    splits the string path to a class into a string path to the module
    and the name of the class. For example:

        >>> from sympy.utilities.source import get_mod_func
        >>> get_mod_func('sympy.core.basic.Basic')
        ('sympy.core.basic', 'Basic')

    .r   N   )rfind)callbackdotr   r   r	   r   %   s    

r   )
__doc__Z
__future__r   r   Zsympy.core.decoratorsr   r   r
   r   r   r   r   r   r	   <module>   s   	