pyrefly
pyrefly copied to clipboard
operator.truth doesn't narrow type, but bool does
Describe the Bug
.. function:: truth(obj)
Return :const:`True` if *obj* is true, and :const:`False` otherwise. This is
equivalent to using the :class:`bool` constructor.
Code block?
https://github.com/pyrefly-org/pyrefly/blob/34f240e95bceceb614b99fdb8de9f2b3d5a1b372/pyrefly/lib/binding/narrow.rs#L1271-L1286
Sandbox Link
https://pyrefly.org/sandbox/?project=v2.pZQ9CsMwDIWvYsjgTtXesSfoAby4rYmz2CFRQo_fJ_8UQsEJZLSQhKX36TUtM47ZGurN87Swr5iug73jgC_sPpzurhCaNMcTqzIMWZ81SdgybLhwJSEJlCeGwli_1hCO_W7v9KHDzf8V69QjB1QZHl4FqfsFY0PCqwkdzNApzzzON6JaHqeeXKB3fM20qSAlcNrVDslnt-2wz-zIJpxBRWdSdAsULZwgo6n9Fw
(Only applicable for extension issues) IDE Information
No response
#claim
@Quaden2307 you've claimed this issue — it's now assigned to you. Thanks for picking it up! 🎉