Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix python compiler generated all_structs with type_hints
Currently with type_hints enabled, we does not explicitly declare the type of generated all_structs. It's meant to be a list of different types, but that will cause problems, as the generated code is usually like this: all_structs = [] ... all_structs.append(Type1) ... all_structs.append(Type2) ... The first append infers the type of all_struct to be list[Type1], so mypy would start complaining from the 2nd append as the type is unexpected. Explicitly declare all_struct to be list[typing.Any] instead, which fixes the issue.
- Loading branch information