File: //home/arjun/projects/env/lib/python3.10/site-packages/werkzeug/__pycache__/local.cpython-310.pyc
o
"we�U � @ s> d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dl m
Z
d dl mZ d dlmZ ddl
mZ ejrId d lmZ d d
lmZ d dlmZ e�d�Zejd
ejdejf d�Zd(dd�ZG dd� d�ZG dd� deje �ZG dd� d�ZG dd� d�ZG dd� de�Zd)d!d"�Z d*d$d%�Z!G d&d'� d'eje �Z"dS )+� )�annotationsN)�
ContextVar��partial)�update_wrapper)�
attrgetter� )�ClosingIterator)�
StartResponse)�WSGIApplication)�WSGIEnvironment�T�F.)�bound�local�Local | LocalStack�return�Nonec C s | � � dS )z�Release the data for the current context in a :class:`Local` or
:class:`LocalStack` without using a :class:`LocalManager`.
This should not be needed for modern use cases, and may be removed
in the future.
.. versionadded:: 0.6.1
N)�__release_local__)r � r �G/home/arjun/projects/env/lib/python3.10/site-packages/werkzeug/local.py�
release_local s r c @ sb e Zd ZdZdZdd dd �Zd!dd�Zdd
�d"dd�Zd#dd�Zd$dd�Z d%dd�Z
d&dd�ZdS )'�Localaq Create a namespace of context-local data. This wraps a
:class:`ContextVar` containing a :class:`dict` value.
This may incur a performance penalty compared to using individual
context vars, as it has to copy data to avoid mutating the dict
between nested contexts.
:param context_var: The :class:`~contextvars.ContextVar` to use as
storage for this local. If not given, one will be created.
Context vars not created at the global scope may interfere with
garbage collection.
.. versionchanged:: 2.0
Uses ``ContextVar`` instead of a custom storage implementation.
)� __storageN�context_var�#ContextVar[dict[str, t.Any]] | Noner r c C s. |d u rt dt| �� d��}t�| d|� d S )Nzwerkzeug.Local<� >.storage�_Local__storage)r �id�object�__setattr__��selfr r r r �__init__6 s zLocal.__init__�t.Iterator[tuple[str, t.Any]]c C s t | j�i ��� �S �N)�iterr �get�items�r"