[issue18821] Add .lastitem attribute to takewhile instances
Claudiu.Popa
report at bugs.python.org
Sat Sep 7 17:30:48 CEST 2013
Claudiu.Popa added the comment:
Hello. Here's a basic patch with tests which accomplishes your request. Currently, it defaults to None if no item failed, but probably it can be set only when something fails the predicate (and the user will check using hasattr(t, 'last') ).
----------
keywords: +patch
nosy: +Claudiu.Popa
Added file: http://bugs.python.org/file31647/itertools_takewhile.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18821>
_______________________________________
More information about the Python-bugs-list
mailing list