[issue46082] type casting of bool

2021-12-15 Thread Josh Rosenberg
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.

[issue46082] type casting of bool

2021-12-15 Thread Alex Waygood
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

[issue46082] type casting of bool

2021-12-15 Thread aziz
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