Closed GoogleCodeExporter closed 8 years ago
First off, I disagree that it's ugly. Also, I don't think special-casing some
options is a good solution.
Original comment by djc.ochtman
on 16 Jun 2010 at 10:50
Well, we are already special-casing some options, namely key, startkey and
endkey. It's common to use limit together with startkey.
Original comment by grimborg@gmail.com
on 16 Jun 2010 at 11:33
@grimborg are you referring to the ViewResult's __getitem__? If so, you're
correct in that those options are special-cased although, now I've noticed that
code, I'd be inclined to rip it out because it actually conflicts with the
options passed to the view, i.e.
db.view('_all_docs', startkey='a', endkey='b')['c':'d']
I would argue that a limit() method has exactly the same problem, i.e.
db.view('_all_docs', limit=10).limit(5)
Personally, I also favour the simplicity of passing a limit=10 arg so I would
-1 your suggestion. However, do you have a use case where a limit() method
makes a significant difference to real code?
Original comment by matt.goo...@gmail.com
on 16 Jun 2010 at 12:45
You're absolutely right. I didn't see that the method args were sent as
options. limit=10 is indeed nicer :)
Thanks!
Original comment by grimborg@gmail.com
on 16 Jun 2010 at 1:37
Original comment by matt.goo...@gmail.com
on 16 Jun 2010 at 2:04
Original issue reported on code.google.com by
grimborg@gmail.com
on 16 Jun 2010 at 9:19