Files
flatbuffers/tests/namespace_test/NamespaceA/NamespaceB/UnionInNestedNS.py
lu-wang-g 5fc87f4c4b Enable --gen-onefile in Python (#6953)
* Enable --gen-onefile in Python

Made it possible to generate all python code in one file. Modified
py_test.py so that it can switch between the multi-file code and
the one-file code.

Updated PythonTest.sh and py_test.py so that the multi-file code
and the one-file code can be tested based on the same test code.

* Sync with google/flatbuffers

* Add --gen-onefile to generate_code.py
2021-12-09 15:47:09 -08:00

16 lines
446 B
Python

# automatically generated by the FlatBuffers compiler, do not modify
# namespace: NamespaceB
class UnionInNestedNS(object):
NONE = 0
TableInNestedNS = 1
def UnionInNestedNSCreator(unionType, table):
from flatbuffers.table import Table
if not isinstance(table, Table):
return None
if unionType == UnionInNestedNS().TableInNestedNS:
return TableInNestedNST.InitFromBuf(table.Bytes, table.Pos)
return None