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

setdefault method does not return a value but None #2

Closed
yflau opened this issue Aug 15, 2013 · 2 comments
Closed

setdefault method does not return a value but None #2

yflau opened this issue Aug 15, 2013 · 2 comments

Comments

@yflau
Copy link
Contributor

yflau commented Aug 15, 2013

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
@kmike
Copy link
Member

kmike commented Aug 15, 2013

Yes, you're right. This could be easy to fix (see https://github.com/kmike/hat-trie/blob/master/src/hat_trie.pyx ) - pull requests are welcome!

@kmike
Copy link
Member

kmike commented Aug 15, 2013

Could you please add yourself to README.rst under "Contributors" section?

@kmike kmike closed this as completed Aug 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants