X-Git-Url: https://git.distorted.org.uk/~mdw/mLib-python/blobdiff_plain/5b1830f325c55c70d65fd020f08dd958493e528d..HEAD:/assoc.pyx diff --git a/assoc.pyx b/assoc.pyx index 2a6e6e5..7685dd6 100644 --- a/assoc.pyx +++ b/assoc.pyx @@ -34,11 +34,11 @@ cdef class AssocTable (Mapping): return 0 cdef void *_find(me, object key, unsigned *f) except NULL: cdef void *p - cdef int n + cdef Py_ssize_t n cdef _assoc_entry *e cdef atom *a a = ATOM_A(atom_pyintern(key)) - PyObject_AsReadBuffer(key, &p, &n) + PyObject_AsReadBuffer(key, &p, &n) if f: f[0] = 0 e = <_assoc_entry *>assoc_find(&me._t, a, PSIZEOF(e), f) @@ -73,7 +73,7 @@ cdef class AssocTable (Mapping): cdef class _AssocIter (_MapIterator): cdef AssocTable t cdef assoc_iter i - def __cinit__(me, AssocTable t): + def __cinit__(me, AssocTable t not None): me.t = t assoc_mkiter(&me.i, &me.t._t) cdef void *_next(me):