thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Reiss <dre...@facebook.com>
Subject Re: thrift --gen py: namespace issues
Date Tue, 03 Feb 2009 21:38:49 GMT
Sorry it took so long to respond to this.

These issues are being tracked at 
https://issues.apache.org/jira/browse/THRIFT-256
https://issues.apache.org/jira/browse/THRIFT-310

They should be resolved soon.

David Eisenstat wrote:
> $ cat foo.thrift
> service Foo {
> 	void foo()
> }
> 
> service Bar extends Foo {
> 	void bar()
> }
> $ thrift --gen py foo.thrift
> $ cd gen-py
> $ python
> Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import foo.Bar
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "foo/Bar.py", line 19, in <module>
>     class Iface(Foo.Iface):
> NameError: name 'Foo' is not defined
> 
> This is the essence of a problem I had with the Thrift spec from a
> Facebook puzzle:
> http://www.facebook.com/jobs_puzzles/bag_banner.thrift (I myself have
> been using thrift for about a day.)
> 
> In addition, if Foo has no methods, the generated code does not have
> the "pass" statement required by Python for an empty class.
> 
> -David

Mime
View raw message