diff options
author | Fred Drake <fdrake@acm.org> | 1998-04-03 15:33:43 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1998-04-03 15:33:43 (GMT) |
commit | fcc6c68e11d78d9d967e5bd255d7506061663338 (patch) | |
tree | 292de2e25d82f6fa2f61b2a86a7dd6b56dc5f5d5 /Modules | |
parent | 61885924b164264255207b14cdcc847c9712e358 (diff) | |
download | cpython-fcc6c68e11d78d9d967e5bd255d7506061663338.zip cpython-fcc6c68e11d78d9d967e5bd255d7506061663338.tar.gz cpython-fcc6c68e11d78d9d967e5bd255d7506061663338.tar.bz2 |
Export MPZType -- the type of mpz objects....
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/mpzmodule.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/mpzmodule.c b/Modules/mpzmodule.c index ae4243a..0400605 100644 --- a/Modules/mpzmodule.c +++ b/Modules/mpzmodule.c @@ -1825,12 +1825,15 @@ void mp_free( ptr, size ) void initmpz() { + PyObject *module; + PyObject *dict; + #ifdef MPZ_DEBUG fputs( "initmpz() called...\n", stderr ); #endif /* def MPZ_DEBUG */ 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 */ if ((mpz_value_zero = newmpzobject()) == NULL) @@ -1845,6 +1848,11 @@ initmpz() Py_FatalError("initmpz: can't initialize mpz constants"); mpz_set_si(&mpz_value_mone->mpz, (long)-1); + dict = PyModule_GetDict(module); + if (dict != NULL) { + PyDict_SetItemString(dict, "MPZType", (PyObject*)&MPZtype); + } + } /* initmpz() */ #ifdef MAKEDUMMYINT int _mpz_dummy_int; /* XXX otherwise, we're .bss-less (DYNLOAD->Jack?) */ |