o
    ZhN                     @   s@   d dl Z d dlmZ d dlmZ d dlmZ G dd deZdS )    N)Path)Union)
TextLoaderc                       s.   e Zd ZdZdeeef f fddZ  ZS )PythonLoaderzFLoad `Python` files, respecting any non-default encoding if specified.	file_pathc                    sN   t |d}t|j\}}W d   n1 sw   Y  t j||d dS )ziInitialize with a file path.

        Args:
            file_path: The path to the file to load.
        rbN)r   encoding)opentokenizedetect_encodingreadlinesuper__init__)selfr   fr   _	__class__ b/var/www/html/lang_env/lib/python3.10/site-packages/langchain_community/document_loaders/python.pyr      s   zPythonLoader.__init__)	__name__
__module____qualname____doc__r   strr   r   __classcell__r   r   r   r   r      s    "r   )r
   pathlibr   typingr   Z)langchain_community.document_loaders.textr   r   r   r   r   r   <module>   s
    