Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4383

Repetitive Python code is generated around serializaion/deserialization

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: Python - Library
    • Labels:
      None

      Description

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

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

      Can't this be abstracted via a helper function and may be the version can be cached given that it is not going to change?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bgedik Bu─čra Gedik

              Dates

              • Created:
                Updated:

                Issue deployment