mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 07:06:26 +00:00
Optionally generate Python type annotations (#7858)
* optionally generate type prefixes and suffixes for python code * fix codegen error when qualified name is empty * WIP: Python typing * more progress towards python typing * Further iterate on Python generated code typing * clang-format * Regenerate code * add documentation for Python type annotations option * generate code with Python type annotations * handle forward references * clang-format
This commit is contained in:
@@ -36,16 +36,16 @@ class TestSimpleTableWithEnum(object):
|
||||
return 2
|
||||
|
||||
def TestSimpleTableWithEnumStart(builder):
|
||||
return builder.StartObject(1)
|
||||
builder.StartObject(1)
|
||||
|
||||
def Start(builder):
|
||||
return TestSimpleTableWithEnumStart(builder)
|
||||
TestSimpleTableWithEnumStart(builder)
|
||||
|
||||
def TestSimpleTableWithEnumAddColor(builder, color):
|
||||
return builder.PrependUint8Slot(0, color, 2)
|
||||
builder.PrependUint8Slot(0, color, 2)
|
||||
|
||||
def AddColor(builder, color):
|
||||
return TestSimpleTableWithEnumAddColor(builder, color)
|
||||
def AddColor(builder: flatbuffers.Builder, color: int):
|
||||
TestSimpleTableWithEnumAddColor(builder, color)
|
||||
|
||||
def TestSimpleTableWithEnumEnd(builder):
|
||||
return builder.EndObject()
|
||||
|
||||
Reference in New Issue
Block a user