On 5/11/06, Talin <[EMAIL PROTECTED]> wrote:
> sequence( indexable ):
>     -- an indexable in which the indexes are successive integers
>     -- Test: isinstance( index_type, int )

I think as of Python 2.5, this should be hasattr(index_type, '__index__'), no?

> mapping( indexable ):
>     -- an indexable in which the indices are hashable values:
>     -- Test: hashable( index_type )
>     -- (Also test for immutable if its feasible)

This seems all and good, but how do you figure out what "index_type"
is?  Are you suggesting that "indexables" which want to be identified
as sequences or mappings need to provide their index type somehow?  If
so, how?  (By inheriting from an abstract type?)

STeVe
-- 
Grammar am for people who can't think for myself.
        --- Bucky Katt, Get Fuzzy
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to