Last active
March 15, 2017 19:45
-
-
Save jdswinbank/12afbea0fafb5fd5dec2dfe81f523ae4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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