mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +00:00
gh-138318, PyREPL: builtins should not be highlighted when used as attribute names (#138319)
This commit is contained in:
parent
921f61bd82
commit
7a3bca50e0
3 changed files with 30 additions and 2 deletions
|
|
@ -208,7 +208,10 @@ def gen_colors_from_token_stream(
|
|||
):
|
||||
span = Span.from_token(token, line_lengths)
|
||||
yield ColorSpan(span, "soft_keyword")
|
||||
elif token.string in BUILTINS:
|
||||
elif (
|
||||
token.string in BUILTINS
|
||||
and not (prev_token and prev_token.exact_type == T.DOT)
|
||||
):
|
||||
span = Span.from_token(token, line_lengths)
|
||||
yield ColorSpan(span, "builtin")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue