3 ms·
bool() is not a function named after a fundamental type. bool is a type. As with any type, you can call bool(...) to construct a new object of that type. https
by jonathrg 1y ago
bool() is not a function named after a fundamental type. bool is a type. As with any type, you can call bool(...) to construct a new object of that type.
https://docs.python.org/3/library/functions.html#bool https://docs.python.org/3/library/functions.html#bool
A good tutorial will reflect this fact and use appropriate language.
Both the idea that you can "cast", and the idea that bool is a function, are misunderstandings rooted in the idea that Python should be like C in all ways.