Hacker News new | ask | show | jobs
by jwilk 771 days ago
Complete example without eval:

  def f(): pass
  f.__code__ = f.__code__.replace(co_consts=())
  f()
1 comments

yup, eval was just there for golfing purposes