Document the change in behaviour of bool(flag_obj)

This commit is contained in:
Jakub Kuczys
2023-05-13 20:13:55 +02:00
committed by GitHub
parent 8d047d9e1d
commit ca0b444047
3 changed files with 66 additions and 0 deletions

View File

@ -1006,6 +1006,20 @@ Due to a breaking API change by Discord, :meth:`Guild.bans` no longer returns a
async for ban in guild.bans(limit=1000):
...
Flag classes now have a custom ``bool()`` implementation
--------------------------------------------------------
To allow library users to easily check whether an instance of a flag class has any flags enabled,
using `bool` on them will now only return ``True`` if at least one flag is enabled.
This means that evaluating instances of the following classes in a bool context (such as ``if obj:``) may no longer return ``True``:
- :class:`Intents`
- :class:`MemberCacheFlags`
- :class:`MessageFlags`
- :class:`Permissions`
- :class:`PublicUserFlags`
- :class:`SystemChannelFlags`
Function Signature Changes
----------------------------