HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/libpasteurize/fixes/__pycache__/fix_annotations.cpython-38.pyc
U

,�]-�@sJdZddlmZddlmZddlmZdZdd�ZGdd	�d	ej	�Z
d
S)z&
Fixer to remove function annotations
�)�
fixer_base)�token)�symsz)Removing function annotations completely.cCs
|jdS)Nr)�children)�node�r�E/usr/lib/python3/dist-packages/libpasteurize/fixes/fix_annotations.py�param_without_annotationssr	c@s$eZdZdZdd�ZdZdd�ZdS)�FixAnnotationsFcCs|jsd|_|j||d�dS)NT��reason)�warnedZwarning)�selfrrrrr�	warn_onceszFixAnnotations.warn_oncezm
              funcdef< 'def' any parameters< '(' [params=any] ')' > ['->' ret=any] ':' any* >
              cCs�|�d�}|�d�}|dk	rR|jjtjks2td��|j|td�|j��|��|dkr^dS|jt	j
kr�|jD],}|jt	jkrp|j|td�|�
t|��qpn(|jt	jkr�|j|td�|�
t|��dS)zK
        This just strips annotations from the funcdef completely.
        �params�retNzInvalid return annotationr)�getZprev_sibling�typer�RARROW�AssertionErrorr�warning_text�removerZ
typedargslistrZtname�replacer	)rrZresultsrrZparamrrr�	transforms"



zFixAnnotations.transformN)�__name__�
__module__�__qualname__r
rZPATTERNrrrrrr
sr
N)�__doc__Zlib2to3rZ
lib2to3.pgen2rZlib2to3.fixer_utilrrr	ZBaseFixr
rrrr�<module>s