← Back
Editing: newopen.cpython-38.pyc
U ,�]* � @ s d Z eZG dd� de�ZdS )z� A substitute for the Python 3 open() function. Note that io.open() is more complete but maybe slower. Even so, the completeness may be a better default. TODO: compare these c @ sD e Zd ZdZddd�Zdd� Zdd d �Zdd� Zd d� Zdd� Z dS )�newopenztWrapper providing key part of Python 3 open() interface. From IPython's py3compat.py module. License: BSD. �r�utf-8c C s t ||�| _|| _d S �N)� _builtin_open�f�enc)�self�fname�mode�encoding� r �6/usr/lib/python3/dist-packages/future/types/newopen.py�__init__ s znewopen.__init__c C s | j �|�| j��S r )r �write�encoder )r �sr r r r s z newopen.write���c C s | j �|��| j�S r )r �read�decoder )r �sizer r r r s znewopen.readc C s | j �� S r �r �close�r r r r r s z newopen.closec C s | S r r r r r r � __enter__ s znewopen.__enter__c C s | j �� d S r r )r �etype�value� tracebackr r r �__exit__ s znewopen.__exit__N)r r )r ) �__name__� __module__�__qualname__�__doc__r r r r r r r r r r r s r N)r! �openr �objectr r r r r �<module> s
Save File
Cancel