[ 
https://issues.apache.org/jira/browse/THRIFT-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672803#action_12672803
 ] 

Esteve Fernandez commented on THRIFT-339:
-----------------------------------------

It's quite late here, so I'm probably asking something stupid, but why is 
thrift_spec a tuple? Using a dict keyed on field keys, would allow the 
fastbinary extension to support negative field keys, IMHO. But I'm sure there 
must be a reason why it isn't, apart from dictionaries being mutable. I wish we 
could use named tuples in Python 2.4 and 2.5

THRIFT-105 is slightly related to this, so Alexander can explain the problem 
with negative field keys much better than I.

> THRIFT-242 is incompatible with arguments with empty key fields
> ---------------------------------------------------------------
>
>                 Key: THRIFT-339
>                 URL: https://issues.apache.org/jira/browse/THRIFT-339
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (Python)
>            Reporter: Jonathan Ellis
>
> Esteve's last change to how default values are stored broke stuff.  Here is a 
> quick example:
> {{
> service Test
> {
>   bool  get_slice(i32 start = -1),
> }
> }}
> generates
> {{
> class get_slice_args:
>   thrift_spec = None
>   def __init__(self, start=thrift_spec[-1][4],):
>     self.start = start
> }}
> which is obviously invalid.
> I'm not sure how thrift_spec is supposed to be populated here so I'm unsure 
> how to fix this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to