mirror of
https://github.com/python/cpython.git
synced 2025-11-28 14:11:15 +00:00
Export MPZType -- the type of mpz objects....
This commit is contained in:
parent
61885924b1
commit
fcc6c68e11
1 changed files with 9 additions and 1 deletions
|
|
@ -1825,12 +1825,15 @@ void mp_free( ptr, size )
|
||||||
void
|
void
|
||||||
initmpz()
|
initmpz()
|
||||||
{
|
{
|
||||||
|
PyObject *module;
|
||||||
|
PyObject *dict;
|
||||||
|
|
||||||
#ifdef MPZ_DEBUG
|
#ifdef MPZ_DEBUG
|
||||||
fputs( "initmpz() called...\n", stderr );
|
fputs( "initmpz() called...\n", stderr );
|
||||||
#endif /* def MPZ_DEBUG */
|
#endif /* def MPZ_DEBUG */
|
||||||
|
|
||||||
mp_set_memory_functions( mp_allocate, mp_reallocate, mp_free );
|
mp_set_memory_functions( mp_allocate, mp_reallocate, mp_free );
|
||||||
(void)Py_InitModule("mpz", mpz_functions);
|
module = Py_InitModule("mpz", mpz_functions);
|
||||||
|
|
||||||
/* create some frequently used constants */
|
/* create some frequently used constants */
|
||||||
if ((mpz_value_zero = newmpzobject()) == NULL)
|
if ((mpz_value_zero = newmpzobject()) == NULL)
|
||||||
|
|
@ -1845,6 +1848,11 @@ initmpz()
|
||||||
Py_FatalError("initmpz: can't initialize mpz constants");
|
Py_FatalError("initmpz: can't initialize mpz constants");
|
||||||
mpz_set_si(&mpz_value_mone->mpz, (long)-1);
|
mpz_set_si(&mpz_value_mone->mpz, (long)-1);
|
||||||
|
|
||||||
|
dict = PyModule_GetDict(module);
|
||||||
|
if (dict != NULL) {
|
||||||
|
PyDict_SetItemString(dict, "MPZType", (PyObject*)&MPZtype);
|
||||||
|
}
|
||||||
|
|
||||||
} /* initmpz() */
|
} /* initmpz() */
|
||||||
#ifdef MAKEDUMMYINT
|
#ifdef MAKEDUMMYINT
|
||||||
int _mpz_dummy_int; /* XXX otherwise, we're .bss-less (DYNLOAD->Jack?) */
|
int _mpz_dummy_int; /* XXX otherwise, we're .bss-less (DYNLOAD->Jack?) */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue