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

Buğra Gedik updated THRIFT-4383:
--------------------------------
    Description: 
When I look at the generated Python code, I see lines like the following 
repeated all over the place:

{code}
iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else 
iprot.readString()
{code}

Given that system info is not going to change, can't this be abstracted via a 
helper function? 



  was:
When I look at the generated Python code, I see code like the following 
repeated all over the place:

{code}
iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else 
iprot.readString()
{code}

Given that system info is not going to change, can't this be abstracted via a 
helper function? 




> Repetitive Python code is generated around serializaion/deserialization
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-4383
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4383
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Library
>    Affects Versions: 0.10.0
>            Reporter: Buğra Gedik
>            Priority: Minor
>
> When I look at the generated Python code, I see lines like the following 
> repeated all over the place:
> {code}
> iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else 
> iprot.readString()
> {code}
> Given that system info is not going to change, can't this be abstracted via a 
> helper function? 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to