|
|
{ | { |
distributionobject *self; | distributionobject *self; |
| |
self = PyObject_NEW(distributionobject, &distributiontype); |
self = PyObject_New(distributionobject, &distributiontype); |
if (self == NULL) | if (self == NULL) |
return NULL; | return NULL; |
self->density = NULL; | self->density = NULL; |
|
|
dist_dealloc(distributionobject *self) | dist_dealloc(distributionobject *self) |
{ | { |
Py_XDECREF(self->parameters); | Py_XDECREF(self->parameters); |
PyMem_DEL(self); |
PyObject_Del(self); |
} | } |
| |
| |
|
|
{ | { |
rngobject *self; | rngobject *self; |
| |
self = PyObject_NEW(rngobject, &rngtype); |
self = PyObject_New(rngobject, &rngtype); |
if (self == NULL) | if (self == NULL) |
return NULL; | return NULL; |
self->distribution = distribution; | self->distribution = distribution; |
|
|
rng_dealloc(rngobject *self) | rng_dealloc(rngobject *self) |
{ | { |
Py_DECREF(self->distribution); | Py_DECREF(self->distribution); |
PyMem_DEL(self); |
PyObject_Del(self); |
} | } |
| |
| |