We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f30746a commit 29ef38dCopy full SHA for 29ef38d
pyrogram/api/core/primitives/bool.py
@@ -41,13 +41,7 @@ class BoolTrue(BoolFalse):
41
class Bool(Object):
42
@classmethod
43
def read(cls, b: BytesIO) -> bool:
44
- value = int.from_bytes(b.read(4), "little")
45
-
46
- return (
47
- True if value == BoolTrue.ID
48
- else False if value == BoolFalse.ID
49
- else None
50
- )
+ return int.from_bytes(b.read(4), "little") == BoolTrue.ID
51
52
def __new__(cls, value: bool) -> BoolTrue or BoolFalse:
53
return BoolTrue() if value else BoolFalse()
0 commit comments