unlisted
ubuntu2004o
��c � @ sP d Z ddlmZ ddlZddlmZ dd� Zddd �ZG d
d� d�Zdd
� Z dS )z}
Convenience tools for handling deprecations.
Most of the code is taken from the SageMath source code in misc/superseded.py
� )�warnN)�lazy_attributec C s
d� | �S )Nz=https://gitlab.com/modulispaces/admcycles/-/merge_requests/{})�format)�num� r �8/home/user/Introduction lectures/admcycles/superseded.py�merge_request_url s
r � c C s* |d7 }|d� t| ��7 }t|t|� d S )N�
zSee {} for details.)r r r �DeprecationWarning)�
merge_request�message�
stacklevelr r r �deprecation s r c @ s8 e Zd ZdZddd�Zedd� �Z dd� Zdd d
�ZdS )
�DeprecatedFunctionAliasze
A wrapper around methods or functions which automatically prints a
deprecation message.
Nc C s� z | j �|j � W n ty Y nw || _|| _|| _|| _|| _t|t t
��r,d}nd}d}|d| d | jj d 7 }|d�t
|��7 }|| _d S )N�func�methzDeprecated: zUse :z:`z` instead.
zSee {} for details.
)�__dict__�update�AttributeErrorr r �instance�unbound�
__module__�
isinstance�typer �__name__r r �__doc__)�selfr r �moduler r �
sphinxrole�docr r r �__init__, s"