4 ms·
Types are implicitly converted in a variety of cases, notably True-ness First off, see my other comment about Python's boolean type and the fact that it is an
by ubernostrum 11y ago
Types are implicitly converted in a variety of cases, notably True-ness
First off, see my other comment about Python's boolean type and the fact that it is an integral type:
https://news.ycombinator.com/item?id=9595988 https://news.ycombinator.com/item?id=9595988
Second, boolean evaluation of arbitrary types in Python is not "weak" -- it's well-defined through a standard language-level protocol, and it's always very clear what can and can't be evaluated as a boolean and what boolean values will result from doing so.