Roundup Robot added the comment:
New changeset 3e2354dde892 by Raymond Hettinger in branch '3.4':
Issue #18652: Add an itertools recipe for first_true()
http://hg.python.org/cpython/rev/3e2354dde892
--
nosy: +python-dev
___
Python tracker
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
Changes by Joshua Bronson jabron...@gmail.com:
--
nosy: +jab
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing
Raymond Hettinger added the comment:
As soon as the trunk opens again, I'll add Nick's version to the itertools
recipes section.
I'm disinclined to add it directly to the itertools module as a native C
function for several reasons:
* The problem solved isn't that common (very little of
Serhiy Storchaka added the comment:
David said, now I have a place in the non-test email code where using this
would lead to easier-to-read code. IMO, this is telling. The bar is
higher than I would have used this one time. That doesn't make it worth
having to learn and remember.
I will
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list
Changes by Nick Coghlan ncogh...@gmail.com:
--
versions: +Python 3.5 -Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Serhiy Storchaka added the comment:
OK, now I have a place in the non-test email code where using this would lead
to easier-to-read code.
Now you have not this place. ;)
--
___
Python tracker rep...@bugs.python.org
Changes by Radu Voicilas radu.voici...@gmail.com:
--
nosy: +raduv
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list
R. David Murray added the comment:
OK, now I have a place in the non-test email code where using this would lead
to easier-to-read code.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Raymond Hettinger added the comment:
Hynek, thanks for your suggestion. I would like to mull it over for a while
before chiming in.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
Hynek Schlawack added the comment:
Well that's the point: it's extremely handy but simple. I wish Raymond would
pronounce on this. I can keep using the PyPI version for all I care, so I'm
not going fight for it. But with one exception there seems to be an agreement
that it would be a very
R. David Murray added the comment:
For what it is worth, I am currently writing some email tests and it would
certainly be convenient to have this. Of course I *can* define it locally in
the the test file.
--
___
Python tracker
Hynek Schlawack added the comment:
So I wanted to provide a first patch to move the discussion on and realized
that itertools appears currently to be completely inside of
`Modules/itertoolsmodule.c`. :-/
Any volunteers? :)
--
assignee: hynek -
stage: - needs patch
Serhiy Storchaka added the comment:
How large will be a C implementation of this one-line function?
I'm still -1 for polluting the itertools module with trivial combinations of
existing functions.
--
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
How large will be a C implementation of this one-line function?
I'm still -1 for polluting the itertools module with trivial
combinations of existing functions.
The solution is to move the current itertools to _itertools and have a
companion itertools.py.
Serhiy Storchaka added the comment:
Looks as too much work for too small gain (and I'm suppose the total gain is
negative if we count all costs).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Mark Dickinson added the comment:
+1 on the name 'first_true'. Does exactly what it says on the tin.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
Hynek Schlawack added the comment:
+1 on the name 'first_true'. Does exactly what it says on the tin.
I fully agree.
***
I assume what's missing now is a permission from Raymond to mess with his turf?
--
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
I would like to chime in and say that the fact that the functions exists in SQL
(and possibly Lisp, Snobol and PHP) sells me on the idea!
Okay, only joking, but I do think this is a useful addition.
first_true should be its name, but itertools already has a
Antoine Pitrou added the comment:
(but you don't have to trust me: itertools also has izip_longest() and
combinations_with_replacement())
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
Nick Coghlan added the comment:
I concede Tim's point about itertools already using underscores where it
improves readability of a name :)
So, the latest state of the proposal is to add the following, preferably
directly to the module, but at least as a recipe in the itertools docs:
def
24 matches
Mail list logo