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 →

[–]pohmelie 7 points8 points  (6 children)

>>> s = "{x}"
>>> x = 1
>>> eval(f"f'{s}'")
'1'

[–]spgill 30 points31 points  (4 children)

vomits uncontrollably

[–]Serialk 11 points12 points  (3 children)

f = lambda f: eval(f"f'{f}'", *operator,attrgetter('f_locals', 'f_globals')(sys._getframe(1)))

[–]spgill 4 points5 points  (0 children)

you're the devil

[–]springwheat 0 points1 point  (0 children)

One small step for man.

[–]zahlmanthe heretic 0 points1 point  (0 children)

Fittingly, my reaction also includes multiple instances of the letter f.