�
g\�g2 � �2 � d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ ddlmZ dd lm Z dd
l
mZ ddlm
Z
ddlmZ ej ses
d
dlmZ d
dlmZ nd dlmZ d dlmZ edeg ef �� � Zdd�Z G d� de
� � Z G d� d� � ZdS )� )�annotationsN)�Any)�Callable)�Optional)�TypeVar� )�exc)�util)�HAS_CYEXTENSION)�Protocol)�Self� )�_distill_params_20)�_distill_raw_params�_C)�bound�key�str�return�Callable[[_C], _C]c �6 � � t j � fd�� � }|S )z�Decorator, memoize a function in a connection.info stash.
Only applicable to functions which take no arguments other than a
connection. The memo will be stored in ``connection.info[key]``.
c � �� |� � � } |j � S # t $ r | ||� � x|j �<