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

Repetitive Python code is generated around serializaion/deserialization

    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
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: