This transform removes function annotations and variable annotations.
This transform is generally safe to use. Although the annotations have no meaning to the python language, they are made available at runtime. Some python library features require annotations to be kept.
If these are detected, annotations are kept for that class:
If you know the module requires the annotations to be kept, disable this transform.
If a variable annotation without assignment is used the annotation is changed to a literal zero instead of being removed.
The transform is enabled by default.
Disable this source transformation by passing the
remove_annotations=False argument to the
--no-remove-annotations to the pyminify command.
def compile(source: "something compilable", filename: "where the compilable thing comes from", mode: "A string annotation"): a: int = 1 b: str def inner(): nonlocal b b = 'hello' inner() print(b) compile(None, None, None)
def compile(source,filename,mode): a=1;b:0 def inner():nonlocal b;b='hello' inner();print(b) compile(None,None,None)