On Sun, Mar 20, 2011 at 10:46:14PM -0700, Mike Orr wrote:
> Sprox objects appear to be unsliceable and therefore incompatible with
> paginate. I also discovered that SQLAlchemy queries and selects also
> don't have .__getslice__, but that's OK because their wrapper class
> emulates it. So i had to move the slice check below the SQLAlchemy
> check.

I'll just add a note that defining __getslice__ is not necessary to support
slicing (in fact it's been deprecated since Python 2.0).  The modern way
is to have your __getitem__ check if the argument passed to it is an
instance of the builtin `slice` type.

(You probably knew that already, but your wording above is a bit ambiguous.)

Incidentally, what's that '__slice__' thing you're checking for in
https://bitbucket.org/bbangert/webhelpers/changeset/556b55e75dd6#chg_webhelpers/paginate.py_newline215
?  docs.python.org has no knowledge of it.

Marius Gedminas
-- 
It is a mess, pure and simple.  Sucks to be away from Unix, huh?
        -- man perlfaq3

Attachment: signature.asc
Description: Digital signature

Reply via email to