[Python-Dev] get for lists and tuples? (original) (raw)
Russell E. Owen rowen at cesmail.net
Tue Jul 11 19:32:01 CEST 2006
- Previous message: [Python-Dev] Minor: Unix icons for 2.5?
- Next message: [Python-Dev] get for lists and tuples?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'd like to have the get method available for lists and tuples. (I figured this must have been discussed before but can't recall it and didn't turn anything up on google).
It's obviously not a use-all-the-time method (or it'd already be there), but I find myself wanting it often enough to justify it in my own mind (and curse this omission, relative to dict).
Basically I run into it when parsing data of variable length (where the extra elements have some obvious default value), including config files, sys.argv (for simple command scripts), that sort of thing.
Yes a 4-liner does the job, but "get" would be a much clearer way to write it.
Anyway, I'm just testing the waters. If it's not heresy then I'd like to do what I can to make it happen.
-- Russell
- Previous message: [Python-Dev] Minor: Unix icons for 2.5?
- Next message: [Python-Dev] get for lists and tuples?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]