Skip to content

Instantly share code, notes, and snippets.

@isidentical
Created June 14, 2020 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isidentical/3c247f1aba272db830efbb5e253e922d to your computer and use it in GitHub Desktop.
Save isidentical/3c247f1aba272db830efbb5e253e922d to your computer and use it in GitHub Desktop.
import random
@object.__new__
class Maybe:
def __bool__(self):
return random.choice((True, False))
print(bool(Maybe), bool(Maybe), bool(Maybe))
print(Maybe is Maybe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment