On 14 August 2013 12:45, Peter Otten <__pete...@web.de> wrote: > Joshua Landau wrote: >> On 14 August 2013 09:30, Alister <alister.w...@ntlworld.com> wrote: >>> I would agree with the last statement. >>> Please write list definitions as lists rather than taking a short-cut to >>> save a few key presses >> >> That's true with this example, but is: >> >> lines = [ >> "Developments in high-speed rail, and high-speed", > ... >> "same problems the latter was designed to solve." >> ] >> >> really more readable than: >> >> lines = """\ >> Developments in high-speed rail, and high-speed > ... >> same problems the latter was designed to solve. >> """[1:-1].split("\n") >> >> ? > > It's definitely more correct -- unless you meant to strip the "D" from the > first line ;) > > I would use > > lines = """\ > Developments in high-speed rail, and high-speed > ... > same problems the latter was designed to solve. > """.splitlines()
Thanks, I didn't actually know about .splitlines()! -- http://mail.python.org/mailman/listinfo/python-list