mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
This prevents the include of the type defined in the pyi, otherwise this leads to error message like this: error: Name XYZ already defined (possibly by an import) [no-redef]
20 lines
596 B
Python
20 lines
596 B
Python
from __future__ import annotations
|
|
|
|
import flatbuffers
|
|
import numpy as np
|
|
|
|
import flatbuffers
|
|
import typing
|
|
from MyGame.Example.NestedUnion.TestSimpleTableWithEnum import TestSimpleTableWithEnum
|
|
from MyGame.Example.NestedUnion.Vec3 import Vec3
|
|
from flatbuffers import table
|
|
|
|
uoffset: typing.TypeAlias = flatbuffers.number_types.UOffsetTFlags.py_type
|
|
|
|
class Any(object):
|
|
NONE: int
|
|
Vec3: int
|
|
TestSimpleTableWithEnum: int
|
|
def AnyCreator(union_type: typing.Literal[Any.NONE, Any.Vec3, Any.TestSimpleTableWithEnum], table: table.Table) -> typing.Union[None, Vec3, TestSimpleTableWithEnum]: ...
|
|
|