You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the protobuf language guide, fixednn and sfixednn are integer types. However, when betterproto generates dataclasses it treats them as floats.
$ cat foo.proto
syntax = "proto3";
package foo;
message Foo {
fixed32 bar = 1;
sfixed32 baz = 2;
fixed64 qux = 3;
sfixed64 quux = 4;
}
$ protoc --python_betterproto_out . foo.proto
Writing foo.py
$ cat foo.py
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: foo.proto
# plugin: python-betterproto
from dataclasses import dataclass
import betterproto
@dataclass
class Foo(betterproto.Message):
bar: float = betterproto.fixed32_field(1)
baz: float = betterproto.sfixed32_field(2)
qux: float = betterproto.fixed64_field(3)
quux: float = betterproto.sfixed64_field(4)
betterproto 1.2.2 (from pypi)
protoc 3.6.1
python 3.7.3
The text was updated successfully, but these errors were encountered:
According to the protobuf language guide,
fixednn
andsfixednn
are integer types. However, when betterproto generates dataclasses it treats them as floats.The text was updated successfully, but these errors were encountered: