Skip to content

Commit

Permalink
fix: add support for field with name 'self' (#2205)
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea authored Oct 8, 2024
1 parent ab19c5a commit ed88fe2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gapic/utils/reserved_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
"exec",
"help",
# Comes from Protoplus
"ignore_unknown_fields"
"ignore_unknown_fields",
"self", # Refer to PEP8 https://peps.python.org/pep-0008/#function-and-method-arguments
"cls", # Refer PEP8 https://peps.python.org/pep-0008/#function-and-method-arguments
]
)
4 changes: 4 additions & 0 deletions tests/fragments/test_reserved_field_name.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ message MethodRequest {
string any = 4;
string license = 5;
string type = 6;
// Refer to PEP8 https://peps.python.org/pep-0008/#function-and-method-arguments
string self = 7;
// Refer to PEP8 https://peps.python.org/pep-0008/#function-and-method-arguments
string cls = 8;
}

message MethodResponse {
Expand Down

0 comments on commit ed88fe2

Please sign in to comment.