pytries / hat-trie Goto Github PK
View Code? Open in Web Editor NEWHAT-Trie for Python
License: MIT License
HAT-Trie for Python
License: MIT License
I recently pushed a change to the upstream hat-trie C library which you may want to pull in:
dcjones/hat-trie@2ec3a7c
I was curious if there was any particular reason you don't allow storing arbitrary Python objects as values?
It looks like the underlying C library just stores unsigned long
as value_t
, but it seems like you could store a PyObject *
by simply casting it to value_t
.
The error is as follows:
cl : Command line error D8021 : invalid numeric argument '/Wno-error=declaration-after-statement' error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
I'm running into 2 issues with installing hat-trie:
I have to install Cython manually to prevent ImportError: No module named Cython.Distutils
error (missing requirements file ?)
On one of my systems, even after installing Cython, the step cythoning src/hat_trie.pyx to src/hat_trie.c
is missing, hence the build fails with gcc: src/hat_trie.c: No such file or directory
.
This might be just my environment (virtualenv on a SLES 11, multiple pythons in PATH), but I don't know how to investigate Cython issues...
Full pip.log: https://gist.github.com/eddy-geek/e9d6459b5a8989f7e5f3
When I clone the repo and run python setup.py build
, I get the error below. I am on a 64-bit machine running RHEL 6.5 and gcc version 4.4.7.
running build
running build_ext
cythoning src/hat_trie.pyx to src/hat_trie.c
building 'hat_trie' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/hat-trie
creating build/temp.linux-x86_64-2.7/hat-trie/src
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ihat-trie/src -I/opt/python/2.7/include/python2.7 -c src/hat_trie.c -o build/temp.linux-x86_64-2.7/src/hat_trie.o
src/hat_trie.c: In function ‘__pyx_gb_8hat_trie_8BaseTrie_20generator’:
src/hat_trie.c:2082: warning: assignment discards qualifiers from pointer target type
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ihat-trie/src -I/opt/python/2.7/include/python2.7 -c hat-trie/src/ahtable.c -o build/temp.linux-x86_64-2.7/hat-trie/src/ahtable.o
In file included from hat-trie/src/ahtable.h:28,
from hat-trie/src/ahtable.c:8:
hat-trie/src/pstdint.h:457: error: conflicting types for ‘int64_t’
/usr/include/sys/types.h:198: note: previous declaration of ‘int64_t’ was here
error: command 'gcc' failed with exit status 1
I think the setdefault method is a similar method of dict, but it does not return a valid value, so it is strange.
>>> from hat_trie import Trie
>>> t = Trie()
>>> t.setdefault(u'a', 1)
>>> d = {}
>>> d.setdefault(u'a', 1)
1
In commit 1515b91, superfasthash was replaced with murmurhash3.
You removed superfasthash.h and superfasthash.c, and added murmurhash3.h, but it seems to me that you forgot to add murmurhash3.c...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.