Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63279

Re: function to split strings and lists on predicate

From Dave Angel <davea@davea.name>
Subject Re: function to split strings and lists on predicate
Date 2014-01-06 08:35 -0500
References <ladjir$21h$1@ger.gmane.org> <ladjir$21h$1@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.5014.1389015242.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, 06 Jan 2014 06:48:11 +0000, Mark Lawrence 
<breamoreboy@yahoo.co.uk> wrote:
> I came across this over the weekend 
> 
http://paddy3118.blogspot.co.uk/2013/10/unifying-pythons-string-and-lis
t.html. 
>   I couldn't come up with a solution to the fsplit function that 
seemed 
> in any way cleaner.  What can our nest of avid Pythonistas come up 
with?

Looks like that link is already broken.  Try the first half of page:

http://paddy3118.blogspot.co.uk/2013_10_01_archive.html

I can't see any way to simplify the generator Paddy produced,  but 
the thing that bothered me is that it won't work on iterables, such 
as itself. For thar reason I think I'd stick with the separate 
functions,  or write an adaptor to convert a iterable of lists to one 
of strings.

-- 
DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: function to split strings and lists on predicate Dave Angel <davea@davea.name> - 2014-01-06 08:35 -0500

csiph-web