list unpack trick?
aurora00 at gmail.com
Sun Jan 23 18:00:59 CET 2005
On Sat, 22 Jan 2005 10:03:27 -0800, aurora <aurora00 at gmail.com> wrote:
> I am think more in the line of string.ljust(). So if we have a
> list.ljust(length, filler), we can do something like
> name, value = s.split('=',1).ljust(2,'')
> I can always break it down into multiple lines. The good thing about
> list unpacking is its a really compact and obvious syntax.
Just to clarify the ljust() is a feature wish, probably should be named
something like pad().
Also there is another thread a few hours before this asking about
essentially the same thing.
"default value in a list"
More information about the Python-list