Browse Source

return val von binäroperatoren zu Byte geändert

main
Laurids Renk 4 months ago
parent
commit
8d377012bb
1 changed files with 3 additions and 8 deletions
  1. +3
    -8
      byte.py

+ 3
- 8
byte.py View File

@ -33,17 +33,12 @@ class Byte:
return self.value
def __and__(self, other):
return (int(self) & int(other))
return Byte(int(self) & int(other))
def __or__(self, other):
return (int(self) | int(other))
return Byte(int(self) | int(other))
def __xor__(self, other):
return (int(self) ^ int(other))
return Byte(int(self) ^ int(other))
if __name__ == "__main__":
b = Byte(0x77)
a = Byte(0x88)
c = Byte(0xaa)
print()

Loading…
Cancel
Save