Skip to content

One way to ignore type annotations #2327

Open
@certik

Description

@certik
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
    from lpython import i32

def main0(i: i32):
    x: i32
    x = (2+3)*5+i
    print(x)

if __name__ == "__main__":
   main0(5)

This works with cpython, it will ignore the lpython.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions