Yes, that's good!  Still, I couldn't help myself and submitted a patch
to support slicing:

http://www.sqlalchemy.org/trac/ticket/686

It's all of four lines.  I love Python.

My need is to verify that something *is* a sequence but *is not* a
dict, so without the patch, I'd have to check that it doesn't have
keys and does have __getitem__... that's, like, maybe two dozen extra
characters of clutter!  Obviously intolerable.  :)

On Jul 25, 4:14 pm, "Jonathan Ellis" <[EMAIL PROTECTED]> wrote:
> Well, the docs you link say slicing should be done via __getitem__
> now.  Which is also present in dicts of course.
>
> Why not approach the problem from the other direction?
>
> try:
>   maybedict.keys()
> except AttributeError:
>   ismapping = True
> else:
>   ismapping = False

- Catherine
http://catherinedevlin.blogspot.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to