Josh Rosenberg added the comment:
Agreed, this is not a bug. The behavior of the bool constructor is not a parser
(unlike, say, int), it's a truthiness detector. Non-empty strings are always
truthy, by design, so both "True" and "False" are truthy strings. There's no
bug to address here.
Alex Waygood added the comment:
Hi! Your message here is a little unclear. Are you proposing a new feature (an
enhancement), or filing a bug report?
In either case, I'm afraid this behavior is very unlikely to change. In
general, strings in Python are always considered truthy unless they
New submission from aziz :
>>> st = "True"
>>> bool(st)
True
>>> st = "False"
>>> bool(st)
True
>>>
>>> stk = "False"
>>> bool(stk)
True
>>> eval(stk)
False
--
components: 2to3 (2.x to 3.x conversion tool)
messages: 408595
nosy: aziz
priority: normal
severity: normal
status: open