Add remaining bitwise operators to Flags

This commit is contained in:
zephyrkul
2022-05-23 19:58:46 -06:00
committed by GitHub
parent 2ef7ae0778
commit 78a026aae2
2 changed files with 227 additions and 21 deletions

View File

@ -82,6 +82,34 @@ class Permissions(BaseFlags):
.. describe:: x > y
Checks if a permission is a strict superset of another permission.
.. describe:: x | y, x |= y
Returns a Permissions instance with all enabled flags from
both x and y.
.. versionadded:: 2.0
.. describe:: x & y, x &= y
Returns a Permissions instance with only flags enabled on
both x and y.
.. versionadded:: 2.0
.. describe:: x ^ y, x ^= y
Returns a Permissions instance with only flags enabled on
only one of x or y, not on both.
.. versionadded:: 2.0
.. describe:: ~x
Returns a Permissions instance with all flags inverted from x.
.. versionadded:: 2.0
.. describe:: hash(x)
Return the permission's hash.