Closed jonathansp closed 5 years ago
method_name is suggested but MethodName is also allowed for consistency in google. Most old code in protobuf python are using MethodName for example text_format.py message.py descriptor.py, so well_known_types.py also use MethodName for consistency
What language does this apply to?
proto2/3 - python - well_known_types
Describe the problem you are trying to solve.
Most of the python codebase uses the _lowercase_withunderscores convention for methods and functions, as it is enforced by linters. The classes defined in _well_knowntypes.py don't follow this convention as they are similar to the definition from other languages. Although it's not an issue, I think we could create aliases for those methods in order to make then more idiomatic. Example from
python/google/protobuf/internal/well_known_types.py:189
They are fine, but if you put this call in a codebase which follows the lowercase code convention, it's not so good:
Also, it is a little inconsistent since
well_known_types
module uses this convention.Describe the solution you'd like
As python protobuf is widely used, renaming the methods is not a solution. However, I can't see any issues in adding aliases to these methods.
Describe alternatives you've considered
Create an external extension/lib to fix them (I personally dislike it) or keep it as it is.
References: