You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
The `Union.type` and `Union.Type` api was left partially unimplemented in the hopes we could easily unify thrift-py3 and thrift-python enums on trunk.
Since that appears to be a non-trivial lift, add a test documenting current behavior and update inplace-migrate to have self-consistent behavior that matches py3 trunk.
Reviewed By: createdbysk
Differential Revision: D73063538
fbshipit-source-id: a8774af8909938d685712075505d366bcebd54dc
Copy file name to clipboardExpand all lines: thrift/compiler/test/fixtures/basic/out/py3_inplace/gen-py3/test/fixtures/basic/module/types_inplace_FBTHRIFT_ONLY_DO_NOT_USE.py
+14-4
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,9 @@ class __MyUnionType(enum.Enum):
60
60
61
61
__module__=_fbthrift__module_name__
62
62
__slots__= ()
63
+
64
+
_MyUnion__MyUnionType=__MyUnionType
65
+
63
66
__all__.append("__MyUnionType")
64
67
65
68
@@ -69,6 +72,9 @@ class __UnionToBeRenamedType(enum.Enum):
Copy file name to clipboardExpand all lines: thrift/compiler/test/fixtures/constants/out/py3_inplace/gen-py3/module/types_inplace_FBTHRIFT_ONLY_DO_NOT_USE.py
+14-4
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,9 @@ class __union1Type(enum.Enum):
63
63
64
64
__module__=_fbthrift__module_name__
65
65
__slots__= ()
66
+
67
+
_union1__union1Type=__union1Type
68
+
66
69
__all__.append("__union1Type")
67
70
68
71
@@ -75,6 +78,9 @@ class __union2Type(enum.Enum):
75
78
76
79
__module__=_fbthrift__module_name__
77
80
__slots__= ()
81
+
82
+
_union2__union2Type=__union2Type
83
+
78
84
__all__.append("__union2Type")
79
85
80
86
@@ -1478,7 +1484,7 @@ class union1(thrift.py3.types.Union):
Copy file name to clipboardExpand all lines: thrift/compiler/test/fixtures/py3/out/py3_inplace/gen-py3/module/types_inplace_FBTHRIFT_ONLY_DO_NOT_USE.py
+7-2
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,9 @@ class __BinaryUnionType(enum.Enum):
62
62
63
63
__module__=_fbthrift__module_name__
64
64
__slots__= ()
65
+
66
+
_BinaryUnion__BinaryUnionType=__BinaryUnionType
67
+
65
68
__all__.append("__BinaryUnionType")
66
69
67
70
@@ -2388,7 +2391,7 @@ class BinaryUnion(thrift.py3.types.Union):
Copy file name to clipboardExpand all lines: thrift/compiler/test/fixtures/py3/out/py3_inplace_auto_migrate/gen-py3/module/types_inplace_FBTHRIFT_ONLY_DO_NOT_USE.py
+7-2
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,9 @@ class __BinaryUnionType(enum.Enum):
62
62
63
63
__module__=_fbthrift__module_name__
64
64
__slots__= ()
65
+
66
+
_BinaryUnion__BinaryUnionType=__BinaryUnionType
67
+
65
68
__all__.append("__BinaryUnionType")
66
69
67
70
@@ -2388,7 +2391,7 @@ class BinaryUnion(thrift.py3.types.Union):
0 commit comments