(python) Keywords directly following numbers are not detected
See original GitHub issueDescribe the issue As keywords and variables cannot start with a number in Python, the space between a number and a keyword can be skipped. The highlighting should separate the number and the keyword part.
Which language seems to have the issue?
python
Are you using highlight
or highlightAuto
?
highlight
Sample Code to Reproduce
print(1if 0==0else"b")
Expected behavior
(Also see GitHub’s highlighting above)
(Also, also should print
be a built-in here?)
Additional context
Found on this StackExchange answer:
https://codegolf.stackexchange.com/a/218451/25026
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Python Keywords: An Introduction
Python keywords are special reserved words that have specific meanings and purposes and can't be used for anything but those specific purposes. These...
Read more >Python Keywords and Identifiers - GeeksforGeeks
Keywords are used to define the syntax of the coding. The keyword cannot be used as an identifier, function, and variable name. All...
Read more >4. More Control Flow Tools — Python 3.11.1 documentation
The keyword ' elif ' is short for 'else if', and is useful to avoid ... This is exemplified by the following loop,...
Read more >Built-in Functions — Python 3.11.1 documentation
The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical...
Read more >7. Simple statements — Python 3.11.1 documentation
In interactive mode, if the value is not None , it is converted to a string using the built-in repr() function and the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Reaching out to the author of the PR for our Python numeric support so see if there is a reason for all those
\b
at the end of number matches. But if this boils down to “better support average python” vs “better support code golf” (with no easy/clear solution) then I’ll probably close this a #wontfix and just say that code golf is not our specialty. We’ll see.https://docs.python.org/3.8/reference/lexical_analysis.html#keywords