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

[dynamodb2] Implement nonzero for Item to consider empty items falsey #1899

Closed
wants to merge 1 commit into from

Conversation

jamesob
Copy link
Contributor

@jamesob jamesob commented Dec 10, 2013

Doing table.get_item(foo='a') where no item exists matching foo='a' returns an empty item. The returned empty item when passed to bool evaluates as True:

In [23]: i =  comments_table.get_item(item_id='not_in_there')

In [24]: bool(i)
Out[24]: True

This is surprising, and it'd be nice to have i show up falsey.

zachm pushed a commit to zachm/boto that referenced this pull request Jan 10, 2014
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

Successfully merging this pull request may close these issues.

None yet

1 participant