It'd be great to have struct datatype supported. The implementation is in starlark-go repo, but seems not enabled by default: https://github.com/google/starlark-go/tree/master/starlarkstruct
Conversion to/from Python values can be done either by writing new class, or reusing namedtuple. With namedtuple, you have to take care of builtin index() and count() methods. Also to check that object is a named tuple, you can check that it's an instance of tuple and has _fields:
isinstance(x, tuple) and hasattr(x, '_fields')
Go is not my area of competence, but I could help with Python side of things.
It'd be great to have
structdatatype supported. The implementation is instarlark-gorepo, but seems not enabled by default: https://github.com/google/starlark-go/tree/master/starlarkstructConversion to/from Python values can be done either by writing new class, or reusing
namedtuple. Withnamedtuple, you have to take care of builtinindex()andcount()methods. Also to check that object is a named tuple, you can check that it's an instance oftupleand has_fields:Go is not my area of competence, but I could help with Python side of things.