Skip to content

Instantly share code, notes, and snippets.

@DomNomNom
Last active February 1, 2019 05:15
Show Gist options
  • Save DomNomNom/91b801a55eaa637c4abc to your computer and use it in GitHub Desktop.
Save DomNomNom/91b801a55eaa637c4abc to your computer and use it in GitHub Desktop.
#!/usr/bin/python3 -i
# Hello there!
# The following line of code creates a mystery object which behaves in really weird ways.
# Have fun trying to figure it out.
# :Dom
#
# PS: This concept came from a Kiwi Pycon 2015 talk.
mystery = next(filter(lambda _:'.'in repr([_])and not(list!= type(_) or _),['%s'%{}]+__import__('gc').get_objects()))
print()
print("Try these in your interactive python3 shell:")
print()
print("mystery")
print("{'mystery': mystery}")
print("[[mystery]]")
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment