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

Already on GitHub? Sign in to your account

`None` should be an acceptable value for limit #50

Merged
merged 1 commit into from Aug 19, 2012
Jump to file or symbol
Failed to load files and symbols.
+4 −1
Split
View
@@ -332,12 +332,15 @@ def find(self, spec=None, fields=None, skip=0, limit=0,
if spec is None:
spec = {}
+ if limit is None:
+ limit = 0
+
if not isinstance(spec, dict):
raise TypeError("spec must be an instance of dict")
if not isinstance(skip, int):
raise TypeError("skip must be an instance of int")
if not isinstance(limit, int):
- raise TypeError("limit must be an instance of int")
+ raise TypeError("limit must be an instance of int or None")
if not isinstance(timeout, bool):
raise TypeError("timeout must be an instance of bool")
if not isinstance(snapshot, bool):