This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tom66
Recipients tom66
Date 2009-12-30.18:44:07
SpamBayes Score 3.3101125e-07
Marked as misclassified No
Message-id <1262198649.61.0.804746779448.issue7603@psf.upfronthosting.co.za>
In-reply-to
Content
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. :)
History
Date User Action Args
2009-12-30 18:44:09tom66setrecipients: + tom66
2009-12-30 18:44:09tom66setmessageid: <1262198649.61.0.804746779448.issue7603@psf.upfronthosting.co.za>
2009-12-30 18:44:08tom66linkissue7603 messages
2009-12-30 18:44:07tom66create