New submission from Thomas Oldbury <tho...@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 <rep...@bugs.python.org> <http://bugs.python.org/issue7603> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com