Nick Craig-Wood wrote:
These are snatched straight from perl. In perl they are spelt
slightly differently
Yup, they are; perl had _some_ good ideas; no doubt. ;)
In perl (and maybe in ruby I don't know) the { } can be replaced with
any two identical chars, or the matching pair if bracketty,
hg wrote:
But today ? what is the cost of replacing %w(blah blah) by
Hi_I_Want_To_Split_The_String_That_Follows( blah blah)
The latter is beginning to look like the Cocoa/NextStep framework.
Perhaps we should give up scripting languages for ObjC?
James
--
MonkeeSage [EMAIL PROTECTED] wrote:
In ruby there are several special literal notations, just like python.
In ruby it goes like this:
%{blah} / %Q{blah} # same as blah but igornes and '
%q{blah} # same as 'blah' but no interpolation
%w{blah blah} # same as blah blah.split
%r{blah} #
Nick Craig-Wood [EMAIL PROTECTED] wrote:
In python when making __slots__ or module.__all__ you end up typing
lists of objects or methods and they turn out like this which is quite
a lot of extra typing
__slots__ = [method1, method2, method3, method4, method5]
For __all__ you can use
hg [EMAIL PROTECTED] (A) wrote:
A Antoine De Groote wrote:
Hi everybody,
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...
Thanks a lot
Regards,
antoine
A Why would they want to make such an obscure API ? ... didn't
Thorsten Kampe wrote:
* Antoine De Groote (Tue, 26 Sep 2006 12:06:38 +0200)
Thorsten Kampe wrote:
* John Machin (24 Sep 2006 15:32:20 -0700)
Antoine De Groote wrote:
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
Duncan Booth [EMAIL PROTECTED] wrote:
Nick Craig-Wood [EMAIL PROTECTED] wrote:
In python when making __slots__ or module.__all__ you end up typing
lists of objects or methods and they turn out like this which is quite
a lot of extra typing
__slots__ = [method1, method2, method3,
Antoine De Groote wrote:
Thorsten Kampe wrote:
* John Machin (24 Sep 2006 15:32:20 -0700)
Antoine De Groote wrote:
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
Thorsten Kampe wrote:
* John Machin (24 Sep 2006 15:32:20 -0700)
Antoine De Groote wrote:
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.
* Antoine De Groote (Tue, 26 Sep 2006 12:06:38 +0200)
Thorsten Kampe wrote:
* John Machin (24 Sep 2006 15:32:20 -0700)
Antoine De Groote wrote:
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',
Antoine De Groote wrote:
Hi everybody,
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...
Thanks a lot
Regards,
antoine
Why would they want to make such an obscure API ? ... didn't they have
Python to learn from (I am
hg wrote:
Why would they want to make such an obscure API ? ... didn't they have
Python to learn from (I am truly amazed - nothing cynical ...just ...
why ?)
In ruby there are several special literal notations, just like python.
In ruby it goes like this:
%{blah} / %Q{blah} # same as blah
MonkeeSage wrote:
hg wrote:
Why would they want to make such an obscure API ? ... didn't they have
Python to learn from (I am truly amazed - nothing cynical ...just ...
why ?)
In ruby there are several special literal notations, just like python.
In ruby it goes like this:
%{blah} /
* John Machin (24 Sep 2006 15:32:20 -0700)
Antoine De Groote wrote:
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.
Something wrong with
hg wrote:
MonkeeSage wrote:
hg wrote:
Why would they want to make such an obscure API ? ... didn't they have
Python to learn from (I am truly amazed - nothing cynical ...just ...
why ?)
In ruby there are several special literal notations, just like python.
In ruby it goes like this:
Thorsten Kampe wrote:
* John Machin (24 Sep 2006 15:32:20 -0700)
Antoine De Groote wrote:
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.
hg wrote:
But today ? what is the cost of replacing %w(blah blah) by
Hi_I_Want_To_Split_The_String_That_Follows( blah blah)
How about r'blah', u'blah', blah, and '''blah'''. :)
Regards,
Jordan
--
http://mail.python.org/mailman/listinfo/python-list
MonkeeSage wrote:
hg wrote:
But today ? what is the cost of replacing %w(blah blah) by
Hi_I_Want_To_Split_The_String_That_Follows( blah blah)
How about r'blah', u'blah', blah, and '''blah'''. :)
C'mon, the last two really don't count.
wildemar
--
MonkeeSage wrote:
hg wrote:
But today ? what is the cost of replacing %w(blah blah) by
Hi_I_Want_To_Split_The_String_That_Follows( blah blah)
How about r'blah', u'blah', blah, and '''blah'''. :)
Regards,
Jordan
Some truth to that !
--
Hi everybody,
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...
Thanks a lot
Regards,
antoine
--
http://mail.python.org/mailman/listinfo/python-list
Antoine De Groote wrote:
Hi everybody,
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...
I assume that
['a', 'b', 'c']
isn't what you are looking for. How does
'a b c'.split()
strike you?
--
Robert Kern
I have
Antoine De Groote wrote:
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.
HTH,
John
--
http://mail.python.org/mailman/listinfo/python-list
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...
The expression 'a b c'.split() creates the ['a', 'b', 'c'] list of str,
if that helps.
Also dir('a b c') briefly lists much of what
[EMAIL PROTECTED] wrote:
Also Google was curiously resistant to telling me where Ruby's %w is
documented.
You would need to dig into your Google toolbar config and un-tick
YAGNI filter.
--
http://mail.python.org/mailman/listinfo/python-list
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
Tim Chase wrote:
to give it that perl/ruby-ish feel of terseness and obscurity.
Don't feel bad, you always have things like r'%s\%s' % (u'blah',
u'blah') and so on. But of course, it's only the other guys who are
evil / ugly / stupid. As the human torch says, Flame On. :)
[Full disclosure: I
26 matches
Mail list logo