[Python-3000] my take on "typeclasses"
Marcin 'Qrczak' Kowalczyk
qrczak at knm.org.pl
Thu May 11 16:49:43 CEST 2006
Talin <talin at acm.org> writes:
> sequence( indexable ):
> -- an indexable in which the indexes are successive integers
> -- Test: isinstance( index_type, int )
I don't understand. How would this test distinguish [] being a
sequence from {} not being a sequence?
> mapping( indexable ):
> -- an indexable in which the indices are hashable values:
> -- Test: hashable( index_type )
> -- (Also test for immutable if its feasible)
And this on the contrary?
--
__("< Marcin Kowalczyk
\__/ qrczak at knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/
More information about the Python-3000
mailing list