appnexus / pyrobuf

A Cython alternative to Google's Python Protobuf library
Other
554 stars 76 forks source link

Naming a field "from" renders .proto uncompilable #134

Open Redoubts opened 5 years ago

Redoubts commented 5 years ago

The following proto file won't compile with pyrobuf:

syntax = "proto2";

package test;

message Item {
    optional double from = 1;
}

due to this error:

Error compiling Cython file:
------------------------------------------------------------
...
        self._from = 0
        return

    @property
    def from(self):
       ^
------------------------------------------------------------

out/test_proto.pyx:54:8: Expected an identifier