Skip to content

Commit 35b787c

Browse files
Shorthand for True False
1 parent bbe9f3d commit 35b787c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

utils.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,3 +606,14 @@ def __delitem__(self, key):
606606
for i, (value, item) in enumerate(self.A):
607607
if item == key:
608608
self.A.pop(i)
609+
610+
# ______________________________________________________________________________
611+
# Useful Shorthands
612+
613+
614+
class Bool(int):
615+
"""Just like `bool`, except values display as 'T' and 'F' instead of 'True' and 'False'"""
616+
__str__ = __repr__ = lambda self: 'T' if self else 'F'
617+
618+
T = Bool(True)
619+
F = Bool(False)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy