[
https://issues.apache.org/jira/browse/THRIFT-2642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16075394#comment-16075394
]
ASF GitHub Bot commented on THRIFT-2642:
----------------------------------------
Github user econner commented on a diff in the pull request:
https://github.com/apache/thrift/pull/1293#discussion_r125751862
--- Diff: lib/py/src/TRecursive.py ---
@@ -0,0 +1,63 @@
+# MODIFIED June 20, 2017, Eric Conner
+#
+#
+# Original source copyright 2014-present Facebook, Inc.
+#
--- End diff --
Yea, I'm not very experienced with the whole issue of licensing. I mainly
put these lines because of the fbthrift license and I used this file more or
less verbatim from fbthrift.
(https://github.com/facebook/fbthrift/blob/master/LICENSE#L97)
(https://github.com/facebook/fbthrift/blob/master/thrift/lib/py/util/Recursive.py)
> (b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
But perhaps it is fine to use verbatim since fbthrift is itself a branch of
thrift? Not really sure what the protocol here is...
> Recursive structs don't work in python
> --------------------------------------
>
> Key: THRIFT-2642
> URL: https://issues.apache.org/jira/browse/THRIFT-2642
> Project: Thrift
> Issue Type: Bug
> Components: Python - Compiler, Python - Library
> Affects Versions: 0.9.2
> Reporter: Igor Kostenko
> Assignee: Eric Conner
>
> Recursive structs in 0.9.2 work fine in c++ & c#, but not in python, because
> generated code trying to use objects which not constructed yet.
> Struct:
> {code}
> struct Recursive {
> 1: list<Recursive> Children
> }
> {code}
> Python code:
> {code}
> class Recursive:
> thrift_spec = (
> None, # 0
> (1, TType.LIST, 'Children', (TType.STRUCT,(Recursive,
> Recursive.thrift_spec)), None, ), # 1
> )
> {code}
> Error message:
> {code}
> Traceback (most recent call last):
> File "ttypes.py", line 20, in <module>
> class Recursive:
> File "ttypes.py", line 28, in Recursive
> (1, TType.LIST, 'Children', (TType.STRUCT,(Recursive,
> Recursive.thrift_spec)), None, ), # 1
> NameError: name 'Recursive' is not defined
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)