Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in python API: 'int' should be 'int64' #27

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 15 additions & 15 deletions hyperclient/python/hyperclient.pyx
Expand Up @@ -227,7 +227,7 @@ cdef _obj_to_backing(v):
mixedtype = TypeError("Cannot store heterogeneous maps")
for x, y in v.iteritems():
if isinstance(x, int):
if keytype not in ('int', None):
if keytype not in ('int64', None):
raise mixedtype
backing += struct.pack('<q', x)
keytype = 'int64'
Expand All @@ -240,7 +240,7 @@ cdef _obj_to_backing(v):
else:
raise mixedtype
if isinstance(y, int):
if valtype not in ('int', None):
if valtype not in ('int64', None):
raise mixedtype
backing += struct.pack('<q', y)
valtype = 'int64'
Expand Down Expand Up @@ -288,7 +288,7 @@ cdef _dict_to_map_attrs(list value, hyperclient_map_attribute** attrs, size_t* a
cdef dict b
cdef bytes name
cdef long i = 0
attrs_sz[0] = sizeof(hyperclient_map_attribute) * sum([len(a) for a in value])
attrs_sz[0] = sum([len(a[1]) for a in value])
attrs[0] = <hyperclient_map_attribute*> \
malloc(sizeof(hyperclient_map_attribute) * attrs_sz[0])
if attrs[0] == NULL:
Expand Down Expand Up @@ -674,40 +674,40 @@ cdef class DeferredMapOp(Deferred):
# get Cython to work with function pointers correctly
if op == 'map_add':
self._reqid = hyperclient_map_add(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_remove':
self._reqid = hyperclient_map_remove(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_atomic_add':
self._reqid = hyperclient_map_atomic_add(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_atomic_sub':
self._reqid = hyperclient_map_atomic_sub(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_atomic_mul':
self._reqid = hyperclient_map_atomic_mul(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_atomic_div':
self._reqid = hyperclient_map_atomic_div(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_atomic_mod':
self._reqid = hyperclient_map_atomic_mod(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_atomic_and':
self._reqid = hyperclient_map_atomic_and(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_atomic_or':
self._reqid = hyperclient_map_atomic_or(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_atomic_xor':
self._reqid = hyperclient_map_atomic_xor(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_string_prepend':
self._reqid = hyperclient_map_string_prepend(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
elif op == 'map_string_append':
self._reqid = hyperclient_map_string_append(client._client, space_cstr,
key_cstr, len(key_backing), attrs, len(value), &self._status)
key_cstr, len(key_backing), attrs, attrs_sz, &self._status)
else:
raise AttributeError("op == {0} is not valid".format(op))
if self._reqid < 0:
Expand Down