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

Steven D'Aprano steve at pearwood.info
Fri Aug 30 02:46:31 CEST 2013


On 30/08/13 02:19, Masklinn wrote:
> 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?

py> import builtins # use __builtin__ in Python 2
py> 're' in vars(builtins)
False


Of course, not everything needs to be a builtin.



-- 
Steven


More information about the Python-ideas mailing list