[New-bugs-announce] [issue7603] There is no 'seq' type

Thomas Oldbury report at bugs.python.org
Wed Dec 30 19:44:09 CET 2009

New submission from Thomas Oldbury <thomas at tgohome.com>:

I find myself often writing the following code:

   if isinstance(var, (tuple, list, basestring)):

to determine if a var is indexable and iterable. 

It would be simpler if there were a 'seq' type which is subclassed into 
mutableseq and immutableseq (or something like that). Tuples and strings 
would be children of immutableseq. Lists would be children of 
mutableseq. Then I can do:

   if isinstance(var, seq):

Or to determine if I can edit values I can:

   if isinstance(var, mutableseq):

Actually this should probably not be a bug, maybe a PEP... or something.

This is the only thing I can presently think I would really like to 
correct in Python, because so far Python is the best language I've ever 
had the pleasure to write programs for. Thanks to everyone involved. :)

messages: 97050
nosy: tom66
severity: normal
status: open
title: There is no 'seq' type

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list