-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed as not planned
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
The expression: True is bool fails to yield a syntax warning even though other literals do so.
$ uname -v
#14~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jan 15 15:52:10 UTC 2
$
$ python3 --version
Python 3.12.3
$
$ python3
Python 3.12.3 (main, Jan 22 2026, 20:57:42) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> print(1 is int)
<stdin>:1: SyntaxWarning: "is" with 'int' literal. Did you mean "=="?
False
>>> print(True is bool)
False
>>> CPython versions tested on:
3.12
Operating systems tested on:
Linux
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error