Raymond Hettinger added the comment:
Marking as closed for the reasons listed above. And there has been no further
comments for over a year.
--
resolution: -> rejected
status: open -> closed
___
Python tracker
Raymond Hettinger added the comment:
Here are a few more thoughts and a concrete example for clarity.
Itemgetter/Attrgetter were designed to make multiple lookups (possibly
multi-level) and to return a tuple that need not be homogenous. A single
default value
Raymond Hettinger added the comment:
FWIW, Joe Jevnik worked hard to squeeze every possible nanosecond out of these
calls because they were frequently used. Extending this API will tend to undo
his efforts.
The original intent of itemgetter() was to provide a
Guido van Rossum added the comment:
I think represents a legitimate use case. There's another request for this on
python-ideas:
https://groups.google.com/d/msg/python-ideas/0jeftqQpm9c/yZ_uKO84BAAJ
--
nosy: +gvanrossum
resolution: later ->
status: closed -> open
Miki Tebeka miki.teb...@gmail.com added the comment:
python-ideas post at
https://groups.google.com/d/msg/python-ideas/lc_hkpKNvAg/ledftgY0mFUJ
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14384
R. David Murray rdmur...@bitdance.com added the comment:
Great. I'm going to close the issue, but it's only for now: if you get a
good response and a design agreement on python-ideas please reopen the issue.
Of course, we'd need a patch, too; and I believe there would need to be close
to
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14384
___
___
New submission from Miki Tebeka miki.teb...@gmail.com:
This way they will behave more like getattr and the dictionary get.
If default is not specified, then if the item/attr not found, an execption will
be raised, which is the current behavior.
However if default is specified, then return it
R. David Murray rdmur...@bitdance.com added the comment:
Thanks for the suggestion.
It is an interesting idea, but there are some issues. attrgetter and
itemgetter can take more than one key. It would probably make more sense to
have the returned function be the one that takes the default,