Re: ruby %w equivalent

2006-09-30 Thread James Stroud
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 -- http://mail.python.org/mailman/

Re: ruby %w equivalent

2006-09-30 Thread MonkeeSage
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 bracket

Re: ruby %w equivalent

2006-09-27 Thread Nick Craig-Wood
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", "m

Re: ruby %w equivalent

2006-09-27 Thread Antoine De Groote
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", an

Re: ruby %w equivalent

2006-09-27 Thread Piet van Oostrum
> 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

Re: ruby %w equivalent

2006-09-27 Thread Duncan Booth
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 __

Re: ruby %w equivalent

2006-09-27 Thread Nick Craig-Wood
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

Re: ruby %w equivalent

2006-09-26 Thread Thorsten Kampe
* 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... >>> | >>

Re: ruby %w equivalent

2006-09-26 Thread Antoine De Groote
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 m

Re: ruby %w equivalent

2006-09-26 Thread Antoine De Groote
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'

Re: ruby %w equivalent

2006-09-25 Thread hg
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 ! -- http://mail.python.org/mailm

Re: ruby %w equivalent

2006-09-25 Thread Wildemar Wildenburger
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 -- http://mail.python.org/mai

Re: ruby %w equivalent

2006-09-25 Thread MonkeeSage
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

Re: ruby %w equivalent

2006-09-25 Thread Georg Brandl
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 ma

Re: ruby %w equivalent

2006-09-25 Thread hg
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

Re: ruby %w equivalent

2006-09-25 Thread Thorsten Kampe
* 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. Somethi

Re: ruby %w equivalent

2006-09-25 Thread hg
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: >

Re: ruby %w equivalent

2006-09-25 Thread MonkeeSage
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 "b

Re: ruby %w equivalent

2006-09-25 Thread hg
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

Re: ruby %w equivalent

2006-09-24 Thread MonkeeSage
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

Re: ruby %w equivalent

2006-09-24 Thread Tim Chase
>> 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

Re: ruby %w equivalent

2006-09-24 Thread John Machin
[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

Re: ruby %w equivalent

2006-09-24 Thread p . lavarre
> 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 http://docs.python.org/lib/string-met

Re: ruby %w equivalent

2006-09-24 Thread John Machin
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/p

Re: ruby %w equivalent

2006-09-24 Thread Robert Kern
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

ruby %w equivalent

2006-09-24 Thread Antoine De Groote
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