Skip to content

Commit 871047d

Browse files
Viicosethanfurman
andauthored
gh-139819: Use builtin sentinel in rlcompleter (GH-151222)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
1 parent e60c42d commit 871047d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/rlcompleter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
__all__ = ["Completer"]
4242

4343
# Sentinel object to distinguish "missing" from "present but None"
44-
_SENTINEL = object()
44+
_MISSING = sentinel("MISSING")
4545

4646
class Completer:
4747
def __init__(self, namespace = None):
@@ -200,9 +200,9 @@ def attr_matches(self, text):
200200
):
201201
value = thisobject.__dict__.get(word)
202202
else:
203-
value = getattr(thisobject, word, _SENTINEL)
203+
value = getattr(thisobject, word, _MISSING)
204204

205-
if value is not _SENTINEL:
205+
if value is not _MISSING:
206206
matches.append(self._callable_postfix(value, match))
207207
elif word in getattr(type(thisobject), '__slots__', ()):
208208
matches.append(match)

0 commit comments

Comments
 (0)