Make apache thrift gen mangle thrift files to avoid Python keywords in the same way as thrift_builider does.

Review Request #1571 — Created Jan. 8, 2015 and submitted

dturner-tw
pants
157a959...
pants-reviews
benjyw, davidt, ity, jsirois, peiyu
Make apache thrift gen mangle thrift files to avoid Python keywords in the same way as thrift_builider does.

Ran ci.sh. This runs the example tests, which include this newly-added test.

BE
  1. It's sad that the apache thrift compiler doesn't do this already, and doing this via naive regex replacement is far from ideal. But that's a problem for another day.

    1. In fact, the thrift compiler (0.5.0) bans certain reserved words -- I believe every single Python reserved word except "from". But it does not ban the pseudo-reserved None, so we would still want this.

  2. Looks like you don't need this import?

  3. 
      
DT
IT
  1. lgtm! unfortunate that we need to do this -- but thanks for doing this!

  2. 
      
DT
DT
Review request changed

Status: Closed (submitted)

Loading...