[Python-ideas] Optional keepsep argument in str.split()

Masklinn masklinn at masklinn.net
Thu Aug 29 18:19:57 CEST 2013


On 2013-08-28, at 23:14 , Marco Buttu wrote:

> On 08/28/2013 09:36 PM, Masklinn wrote:
>> and the "keeping" split can be handled via findall:
>> 
>>>>> >>>re.findall(r'([^n]+(?:n|$))', "python3")
>> ['python', '3']
> 
> Of course, but this is not built-in

How is the re module not built-in?

> and not obvious.

Neither is the behavior you want out of "keepsep".


More information about the Python-ideas mailing list