o
    e                     @   s   d Z ddlZddlZddlZddlZddlZejd dkZejd dkZerAe	fZ
efZefZe	ZeZdd Zdd Zd	d
 ZdS efZ
eefZeejfZeZe	Zdd Zdd Zdd
 ZdS )zN
This module provides string converting tools and compatibility on py2 vs py3
    N      c                 C   4   t | tr| jddS t | tr| S t| jddS z
        convert source type idata to bytes string

        :type idata: any valid python type
        :param idata: source data
        :return : bytes string
        utf-8encoding)
isinstancestrencodebytesZidata r   ?D:\Projects\ConvertPro\env\Lib\site-packages\baidubce/compat.pyconvert_to_bytes!   s
   
	
r   c                 C      t | S )z
        convert source data to str string on py3

        :type idata:any valid python type
        :param idata:source data
        :return :uniocde string on py3
        )convert_to_unicoder   r   r   r   convert_to_string3      r   c                 C   ,   t | tr| jddS t | tr| S t| S z
        convert source type idata to unicode string

        :type idata: any valid python type
        :param idata: source data
        :return : unicode  string
        r   r   )r	   r   decoder
   r   r   r   r   r   =   s
   
	
r   c                 C   r   r   )r	   unicoder   r
   r   r   r   r   r   V   s
   

c                 C   r   )z
        convert source data to str string on py2

        :type idata:any valid python type
        :param idata:source data
        :return :bytes string on py2
        )r   r   r   r   r   r   f   r   c                 C   r   r   )r	   r
   r   r   r   r   r   r   r   p   s
   

)__doc__	functools	itertoolsoperatorsystypesversion_infoPY2PY3r
   string_typesintinteger_typestypeclass_types	text_typer   binary_typer   r   r   
basestringlongZ	ClassTyper   r   r   r   r   <module>   s2   


