README, bitmask.py: rewrite examples to new format

This commit is contained in:
dogeystamp 2022-08-02 21:57:39 -04:00
parent 6ccad93aa2
commit 060d91473b
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ class Desc(IntFlag):
FUNKY = 1 << 2 FUNKY = 1 << 2
LARGE = 1 << 3 LARGE = 1 << 3
marble = Bitmask(Desc, Desc.SMALL, Desc.ROUND, Desc.FUNKY) marble = Bitmask(Desc.SMALL, Desc.ROUND, Desc.FUNKY)
Desc.SMALL in marble Desc.SMALL in marble
>>> True >>> True
@ -40,6 +40,6 @@ Desc.SMALL in marble
Desc.LARGE in marble Desc.LARGE in marble
>>> False >>> False
Bitmask(Desc, Desc.SMALL, Desc.ROUND) in marble Bitmask(Desc.SMALL, Desc.ROUND) in marble
>>> True >>> True
``` ```

View File

@ -24,7 +24,7 @@ class Bitmask:
ROUND = 1 << 1 ROUND = 1 << 1
FUNKY = 1 << 2 FUNKY = 1 << 2
bmask = Bitmask(Desc, Desc.BIG, Desc.FUNKY) bmask = Bitmask(Desc.BIG, Desc.FUNKY)
Determine if a flag enabled:: Determine if a flag enabled::