mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-24 14:15:14 +02:00
Ensure that object.__new__ never gets called with arguments
This commit is contained in:
parent
b4a3253e26
commit
a6e28205e1
1 changed files with 5 additions and 1 deletions
|
|
@ -148,7 +148,11 @@ class LogGaussian(Gaussian):
|
||||||
for instance in cls._instances:
|
for instance in cls._instances:
|
||||||
if instance().mu == mu and instance().sigma == sigma:
|
if instance().mu == mu and instance().sigma == sigma:
|
||||||
return instance()
|
return instance()
|
||||||
o = super(Prior, cls).__new__(cls, mu, sigma)
|
newfunc = super(Prior, cls).__new__
|
||||||
|
if newfunc is object.__new__:
|
||||||
|
o = newfunc(cls)
|
||||||
|
else:
|
||||||
|
o = newfunc(cls, mu, sigma)
|
||||||
cls._instances.append(weakref.ref(o))
|
cls._instances.append(weakref.ref(o))
|
||||||
return cls._instances[-1]()
|
return cls._instances[-1]()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue