fury icon indicating copy to clipboard operation
fury copied to clipboard

[Python] Support Optional typehint in pyfury

Open chaokunyang opened this issue 8 months ago • 0 comments

Feature Request

Currently pyfury take all fields in a class as nullable:

@dataclass
class ComplexObject1:
    f1: Any = None
    f2: str = None
    f3: List[str] = None
    f4: Dict[pyfury.Int8Type, pyfury.Int32Type] = None
    f5: pyfury.Int8Type = None
    f6: pyfury.Int16Type = None
    f7: pyfury.Int32Type = None
    f8: pyfury.Int64Type = None
    f9: pyfury.Float32Type = None
    f10: pyfury.Float64Type = None
    f11: pyfury.Int16ArrayType = None
    f12: List[pyfury.Int16Type] = None

we should only take Optional fields as nullable.

In this way, we can mapping types like pyfury.Int32Type into primitive type int in java or int32 in golang directly

Is your feature request related to a problem? Please describe

No response

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

chaokunyang avatar Apr 19 '25 04:04 chaokunyang