[
https://issues.apache.org/jira/browse/THRIFT-3490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sylwester Lachiewicz resolved THRIFT-3490.
------------------------------------------
Fix Version/s: 0.12.0
Resolution: Fixed
Same fix as THRIFT-2616:
[t_py_generator.cc|https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_py_generator.cc]
{{render_const_value}} TYPE_DOUBLE branch emits {{float(N)}} for integral
constants, so a default of 0.0 renders as {{float(0)}} instead of {{0}}.
Present since 0.12.0. Resolving as Fixed.
> Default double value of 0.0 becomes 0 (an integer) in Python
> ------------------------------------------------------------
>
> Key: THRIFT-3490
> URL: https://issues.apache.org/jira/browse/THRIFT-3490
> Project: Thrift
> Issue Type: Bug
> Components: Python - Compiler
> Affects Versions: 0.9.3
> Reporter: Buğra Gedik
> Priority: Minor
> Fix For: 0.12.0
>
>
> When there is a struct attribute of type double with a default value of 0.0,
> this value shows up as 0 in the generated Python code, and the variable
> becomes an integer, rather than a double.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)