Skip to content

Instantly share code, notes, and snippets.

@jdswinbank
Last active March 15, 2017 19:45
Show Gist options
  • Save jdswinbank/12afbea0fafb5fd5dec2dfe81f523ae4 to your computer and use it in GitHub Desktop.
Save jdswinbank/12afbea0fafb5fd5dec2dfe81f523ae4 to your computer and use it in GitHub Desktop.
class PSDPosterior(object):
def __init__(self):
self.foo = 10
my_lambda = lambda self, x : self.foo * x
psd_posterior = PSDPosterior()
import types
psd_posterior.logprior = types.MethodType(my_lambda, psd_posterior)
print(psd_posterior.logprior(9))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment