Message97050
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. :) |
|
Date |
User |
Action |
Args |
2009-12-30 18:44:09 | tom66 | set | recipients:
+ tom66 |
2009-12-30 18:44:09 | tom66 | set | messageid: <1262198649.61.0.804746779448.issue7603@psf.upfronthosting.co.za> |
2009-12-30 18:44:08 | tom66 | link | issue7603 messages |
2009-12-30 18:44:07 | tom66 | create | |
|