This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author thomassen
Recipients docs@python, thomassen
Date 2017-06-29.13:36:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The truth value of sets is not properly documented, in particular regarding whether an empty set is considered false or not.

Ignoring primitive (such as numerals) as well as user-defined types, says:

> The following values are considered false:
> - [...]
> - any empty sequence, for example, '', (), [].
> - any empty mapping, for example, {}.
> - [...]
> All other values are considered true

According to, a set is not a sequence (it is unordered, its elements do not have indices, etc.):

> There are three basic sequence types: lists, tuples, and range objects.

And, according to,

> There is currently only one standard mapping type, the dictionary.

So, as per the documentation, the set type is not a type that can ever be False. However, when I try, bool(set()) evaluates to False.

When I asked this on Stack Overflow, someone checked in the CPython code and judged that this is most likely a mere documentation issue:
Date User Action Args
2017-06-29 13:36:18thomassensetrecipients: + thomassen, docs@python
2017-06-29 13:36:18thomassensetmessageid: <>
2017-06-29 13:36:18thomassenlinkissue30803 messages
2017-06-29 13:36:17thomassencreate