News for hackers. Stuff that matters.
Re:Diagnosing a Linux-only unit test failure by cyphar on Monday October 09, 2017 @08:47PM (#15438534)
That is a bit of a hack though ;). You could also do it with %-style formatting as well:

  some_var = ...
  "%(some_var)s" % locals()
If you want to do both locals and globals you can do:

  some_var = ...
  "%(some_var)s" % dict(globals(), **locals())
New Python versions (>=3.5) have this syntax:

  "%(some_var)s" % {**globals(), **locals()}
But those versions also have f-strings so that's sort of moot.

There are no comments on this comment yet.