>> is there a python equivalent for the ruby %w operator?
>> %w{a b c} creates an array with strings "a", "b", and "c" in ruby...
>>
>
> | >>> "a b c".split()
> | ['a', 'b', 'c']
>
> ... appears to match your single example.
bah, far to easy to understand...add a little line-noise, man,
and it will be closer to ruby/perl.
Maybe something like
>>> from string import split as _
>>> _("a b c")
['a', 'b', 'c']
or perhaps
>>> "a b c".split
>>> _()
['a', 'b', 'c']
to give it that perl/ruby-ish feel of terseness and obscurity.
And people wonder why I like python... :)
-tkc
--
http://mail.python.org/mailman/listinfo/python-list