HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/pandas/util/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/pandas/util/__pycache__/_depr_module.cpython-36.pyc
3

���h�
�@s2dZddlZddlmZddlZGdd�d�ZdS)z�
This module houses a utility class for mocking deprecated modules.
It is for internal use only and should not be used beyond this purpose.
�N)�Iterablec@sVeZdZdZddd�Zeed�dd�Zed�dd	�ZeZ	ed
�dd�Z
dd
d�ZdS)�_DeprecatedModulea�
    Class for mocking deprecated modules.

    Parameters
    ----------
    deprmod : name of module to be deprecated.
    deprmodto : name of module as a replacement, optional.
                If not given, the __module__ attribute will
                be used when needed.
    removals : objects or methods in module that will no longer be
               accessible once module is removed.
    moved : dict, optional
            dictionary of function name -> new location for moved
            objects
    NcCsD||_||_||_|jdk	r(t|j�|_||_ttt|���|_dS)N)�deprmod�	deprmodto�removals�	frozenset�moved�dir�type�self_dir)�selfrrrr�r
�:/tmp/pip-build-5_djhm0z/pandas/pandas/util/_depr_module.py�__init__s
z_DeprecatedModule.__init__)�returncCs|j�}t|�S)N)�_import_deprmodr	)r�
deprmoduler
r
r�__dir__'sz_DeprecatedModule.__dir__cCs|j�}t|�S)N)r�repr)rrr
r
r�__repr__+sz_DeprecatedModule.__repr__)�namecCs<||jkrtj||�Sy|j|j�}Wn,tk
rR|jdkrB�|j|j�}YnXt||�}|jdk	r�||jkr�t	j
|j�d|�d�tdd�n�|jdk	r�||jkr�t	j
|j�d|�d|j|��tdd�nh|j}|dkr�t	j
|j�d|�d�tdd�n:|dk�r|j
}t	j
|j�d|�d|�d|�d	�tdd�|S)
N�.z7 is deprecated and will be removed in a future version.�)�
stacklevelzG is deprecated and will be removed in a future version.
You can access z as Fz is deprecated. Please use z	 instead.)r�object�__getattribute__rr�ImportErrorr�getattrr�warnings�warn�
FutureWarningr�
__module__)rrr�objrr
r
r�__getattr__1s@






z_DeprecatedModule.__getattr__cCs>|dkr|j}tj��tjdtd�tj|�}|SQRXdS)N�ignore)�category)rr�catch_warnings�filterwarningsr �	importlib�
import_module)r�modrr
r
rrds

z!_DeprecatedModule._import_deprmod)NNN)N)�__name__r!�__qualname__�__doc__rr�strrr�__str__r#rr
r
r
rrs
3r)r-r(Ztypingrrrr
r
r
r�<module>s