Skip to content

backend code generation when python programm cotains class #2815

Description

@ljq-0814

I have a question regarding the compilation of a Python program using LPython. If a Python program contains any class or a class like the following:

class student:
    def __init__(self: InOut['student'], name: str, age: i32):
        self.name : str = name
        self.age : i32 = age

Does this imply that after compilation, the code can only generate C++ code, and not C code? I would appreciate an explanation of why that might be the case. Thank you!

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