Skip to content

Commit

Permalink
fix: remove 'property' from reserved names (#613)
Browse files Browse the repository at this point in the history
The Python 'property' builtin name should not be reserved.
  • Loading branch information
software-dov authored Sep 22, 2020
1 parent 6515b77 commit 8338a51
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gapic/utils/reserved_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
import keyword


# The filter and map builtins are a historical artifact;
# they are not used in modern, idiomatic python,
# nor are they used in the gapic surface.
# They are too useful to reserve.
# The exceptions to builtins are frequent and useful.
# They are explicitly allowed message, module, and field names.
RESERVED_NAMES = frozenset(
itertools.chain(
keyword.kwlist,
set(dir(builtins)) - {"filter", "map", "id"},
set(dir(builtins)) - {"filter", "map", "id", "property"},
)
)

0 comments on commit 8338a51

Please sign in to comment.