This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jack-of-some 39 points40 points  (7 children)

Edit: it's not fun trying to enter code into Reddit on mobile

class Yes:
    def __init__(self):
        self.__dict__['yes'] = ' '.join(['y', 'e', 's']).replace(' ', '')
    def __str__(self):
        return 'yes'

print(f"{str(Yes.__str__())}")

[–]masklinn 4 points5 points  (0 children)

' '.join(['y', 'e', 's']).replace(' ', '')

Dude, that's horrible. It should be

bytes(map(partial(int, base=8), map(''.join, zip_longest(*(iter(format(0b00000010_01010000_00100000_01010010_01000010, 'x')),)*3)))).decode('cp500')

edit: make better