[jira] [Updated] (THRIFT-2642) Recursive structs don't work in python

2017-05-12 Thread julien greard (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

julien greard updated THRIFT-2642:
--

Hello,

I agree with Jens and I'm available for giving my opinion even if I don't
know much about thrift architecture.

Wish you luck !

Julien




> 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
>
> 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 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 
> 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.3.15#6346)


[jira] [Updated] (THRIFT-2642) Recursive structs don't work in python

2015-05-12 Thread Jens Geyer (JIRA)

 [ 
https://issues.apache.org/jira/browse/THRIFT-2642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jens Geyer updated THRIFT-2642:
---
Description: 
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 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 
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}


  was:
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:
{quote}struct Recursive {
1: list Children
}
{quote}
Python code:
{quote}class Recursive:
  thrift_spec = (
None, # 0
(1, TType.LIST, 'Children', (TType.STRUCT,(Recursive, 
Recursive.thrift_spec)), None, ), # 1
  )
{quote}
An error:
{quote}Traceback (most recent call last):
  File "ttypes.py", line 20, in 
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
{quote}


> 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
>
> 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 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 
> 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.3.4#6332)