File: //lib/python3.9/site-packages/zipp/__pycache__/__init__.cpython-39.pyc
a
��f:. � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
mZ ddlm
Z
dgZdd� Zd d
� ZejZdd� ZG d
d� d�ZG dd� deej�ZG dd� de�Zddd�ZG dd� d�ZdS )z�
A Path-like interface for zipfiles.
This codebase is shared between zipfile.Path in the stdlib
and zipp in PyPI. See
https://github.com/python/importlib_metadata/wiki/Development-Methodology
for more detail.
� N� )�
text_encoding)�
Translator�Pathc C s t �t| �dd�S )a2
Given a path with elements separated by
posixpath.sep, generate all parents of that path.
>>> list(_parents('b/d'))
['b']
>>> list(_parents('/b/d/'))
['/b']
>>> list(_parents('b/d/f/'))
['b/d', 'b']
>>> list(_parents('b'))
[]
>>> list(_parents(''))
[]
r N)� itertools�islice� _ancestry)�path� r
�1/usr/lib/python3.9/site-packages/zipp/__init__.py�_parents s r c c s2 | � tj�} | � tj�r.| V t�| �\} }qdS )a�
Given a path with elements separated by
posixpath.sep, generate all elements of that path.
>>> list(_ancestry('b/d'))
['b/d', 'b']
>>> list(_ancestry('/b/d/'))
['/b/d', '/b']
>>> list(_ancestry('b/d/f/'))
['b/d/f', 'b/d', 'b']
>>> list(_ancestry('b'))
['b']
>>> list(_ancestry(''))
[]
Multiple separators are treated like a single.
>>> list(_ancestry('//b//d///f//'))
['//b//d///f', '//b//d', '//b']
N)�rstrip� posixpath�sep�split)r �tailr
r
r r . s r c C s t �t|�j| �S )zZ
Return items in minuend not in subtrahend, retaining order
with O(1) lookup.
)r �filterfalse�set�__contains__)ZminuendZ
subtrahendr
r
r �_differenceM s r c s4 e Zd ZdZ� fdd�Zdd� Z� fdd�Z� ZS )�InitializedStatez?
Mix-in to save the initialization state for pickling.
c s"