Skip to content

Instantly share code, notes, and snippets.

@harlowja
Created February 5, 2016 19:50
Show Gist options
  • Save harlowja/6dc4eb90bf150eaeca29 to your computer and use it in GitHub Desktop.
Save harlowja/6dc4eb90bf150eaeca29 to your computer and use it in GitHub Desktop.
from osprofiler import profiler
def big_e():
pass
class A(object):
@staticmethod
def e():
print 'b'
def hello(self):
A.e()
# This one isn't traced
a = A()
a.hello()
my_old_e = A.e
# This one now is traced.
a = profiler.trace_cls('a')(a)
a.hello()
# Works, not traced, should it have been?
my_old_e()
# Barfs
a.e()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment