Skip to content

Commit fa63ad4

Browse files
committed
Replace more references to reserved words with keywords
1 parent 491450d commit fa63ad4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

peps/pep-0818.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ we detect empty containers and return ``false``.
10011001
The following helper function is used to implement ``__dir__``. It walks the
10021002
prototype chain and accumulates all keys, filtering out keys that start with
10031003
numbers (not valid Python identifiers) and reversing the
1004-
``normalize_python_reserved_words`` transform. We also filter out the
1004+
``normalize_python_keywords`` transform. We also filter out the
10051005
``Array.keys`` method.
10061006

10071007
.. code:: javascript
@@ -1026,11 +1026,11 @@ numbers (not valid Python identifiers) and reversing the
10261026
});
10271027
}
10281028
1029-
// If the key is a reserved word followed by 0 or more underscores,
1029+
// If the key is a keyword followed by 0 or more underscores,
10301030
// add an extra underscore to reverse the transformation applied by
1031-
// normalizeReservedWords.
1031+
// normalize_python_keywords().
10321032
result = result.map((word) =>
1033-
isReservedWord(word.replace(/_*$/, "")) ? word + "_" : word,
1033+
iskeyword(word.replace(/_*$/, "")) ? word + "_" : word,
10341034
);
10351035
10361036
return result;
@@ -1048,7 +1048,7 @@ numbers (not valid Python identifiers) and reversing the
10481048
if attr == "keys" and Array.isArray(self):
10491049
raise AttributeError(attr)
10501050
1051-
attr = normalize_python_reserved_words(attr)
1051+
attr = normalize_python_keywords(attr)
10521052
js_getattr = run_js(
10531053
"""
10541054
(jsobj, attr) => jsobj[attr]
@@ -1069,7 +1069,7 @@ numbers (not valid Python identifiers) and reversing the
10691069
def __setattr__(self, attr, value):
10701070
if attr in ["__loader__", "__name__", "__package__", "__path__", "__spec__"]:
10711071
return object.__setattr__(self, attr, value)
1072-
attr = normalize_python_reserved_words(attr)
1072+
attr = normalize_python_keywords(attr)
10731073
js_setattr = run_js(
10741074
"""
10751075
(jsobj, attr) => {
@@ -1082,7 +1082,7 @@ numbers (not valid Python identifiers) and reversing the
10821082
def __delattr__(self, attr):
10831083
if attr in ["__loader__", "__name__", "__package__", "__path__", "__spec__"]:
10841084
return object.__delattr__(self, attr)
1085-
attr = normalize_python_reserved_words(attr)
1085+
attr = normalize_python_keywords(attr)
10861086
js_delattr = run_js(
10871087
"""
10881088
(jsobj, attr) => {

0 commit comments

Comments
 (0)