Last active
February 1, 2019 05:15
-
-
Save DomNomNom/91b801a55eaa637c4abc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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