Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/jaraco/collections/__pycache__/__init__.cpython-39.pyc
Ðазад
a t�hh � @ sl d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dlm Z mZmZ d dl mZmZmZmZmZmZmZ d dlZer�d dlmZ d dlmZ d dlmZ eded �Zned�Zed �Zed�Zeee ee j f Z!dd d�dd�Z"G dd� dej#j�Z$G dd� de$�Z%dd� Z&G dd� deeef �Z'dd� Z(e(dfdd�Z)G dd� de*�Z+G d d!� d!e+�Z,G d"d#� d#�Z-G d$d%� d%�Z.d&d'� Z/G d(d)� d)e*�Z0G d*d+� d+e1ej#j2�Z3G d,d-� d-e*�Z4G d.d/� d/ej#jej#j5�Z6G d0d1� d1e.e4�Z7G d2d3� d3�Z8G d4d5� d5ej9�Z:G d6d7� d7�Z;G d8d9� d9�Z<d:d;� Z=G d<d=� d=ej>�Z?G d>d?� d?�Z@G d@dA� dAe'�ZAdS )B� )�annotationsN)� Container�Iterable�Mapping)� TYPE_CHECKING�Any�Callable�Dict�TypeVar�Union�overload)�_SupportsComparison)�SupportsKeysAndGetItem)�Self�_RangeMapKT)�bound�_T�_VT� _Matchabler )�obj�returnc C s8 t | tj�r| jS t | t�s4t | t�s.t| �} | j} | S �N)� isinstance�re�Pattern� fullmatchr r �set�__contains__)r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/jaraco/collections/__init__.py� _dispatch! s r c @ s@ e Zd ZdZddd�dd�Zdd� Zd d � Zdd� Zd d� ZdS )� ProjectionaT Project a set of keys over a mapping >>> sample = {'a': 1, 'b': 2, 'c': 3} >>> prj = Projection(['a', 'c', 'd'], sample) >>> dict(prj) {'a': 1, 'c': 3} Projection also accepts an iterable or callable or pattern. >>> iter_prj = Projection(iter('acd'), sample) >>> call_prj = Projection(lambda k: ord(k) in (97, 99, 100), sample) >>> pat_prj = Projection(re.compile(r'[acd]'), sample) >>> prj == iter_prj == call_prj == pat_prj True Keys should only appear if they were specified and exist in the space. Order is retained. >>> list(prj) ['a', 'c'] Attempting to access a key not in the projection results in a KeyError. >>> prj['b'] Traceback (most recent call last): ... KeyError: 'b' Use the projection to update another dict. >>> target = {'a': 2, 'b': 2} >>> target.update(prj) >>> target {'a': 1, 'b': 2, 'c': 3} Projection keeps a reference to the original dict, so modifying the original dict may modify the Projection. >>> del sample['a'] >>> dict(prj) {'c': 3} r r )�keys�spacec C s t |�| _|| _d S r )r �_match�_space)�selfr"