Yikes, how deep can you go on writing a #Python expression with more and more limiting rules:
https://oskaerik.github.io/theevalgame/
Spoiler for rule 10
@nedbat finished!
Spoilers for rule 10:
No idea if this was how I was "supposed" to solve it, but I just bypassed the restriction by shallow-copying the builtins dict like this:
(__builtins__ := {k, v for k, v in __builtins__.items()}) and ... rest of expression ...
Looks like the puzzle had a tripwire on the original object's __getattr__ or something, which is why copying didn't trigger it. The rest of the expression stayed the same because of python's lookup rules.
Spoiler for rule 10
@christmastree Hmm, you might have found a loophole!
Spoiler for rule 10
@christmastree @nedbat This is what I came up with (which basically uses your #2): https://gist.github.com/pganssle/d8496bf6553c6f74af97e7f65760defd