Re: ruby instance variable in python

2014-10-08 Thread flebber
The end result of a confusing sentence with no > > context is that I have no idea what you are trying to say. Could you try > > explaining again please? > > > Steven No problem my reply from phone at work a little confusing. So trying to determine what this does. def ins_var @ins_var ||

Re: ruby instance variable in python

2014-10-07 Thread Steven D'Aprano
flebber wrote: > I thought that it was a shortcut in ruby to negate the other option of > providing another default . I'm afraid I can't work out what that sentence means, "to negate the other option of providing *another* default"? How many defaults are you providing? Then you negate *the option

Re: ruby instance variable in python

2014-10-07 Thread flebber
I thought that it was a shortcut in ruby to negate the other option of providing another default . I don't greatly know ruby but took a guess after reading examples here https://blog.neowork.com/ruby-shortcuts -- https://mail.python.org/mailman/listinfo/python-list

Re: ruby instance variable in python

2014-10-07 Thread Jussi Piitulainen
flebber writes: > On Monday, 6 October 2014 21:07:24 UTC+11, roro codeath wrote: > > in ruby: > > > > > > module M > > def ins_var > > @ins_var ||= nil > > end ... > I took || to be a ternary. So I assumed your code just sets ins_var > to nil and then is called in module m and supplied a val.

Re: ruby instance variable in python

2014-10-07 Thread flebber
On Monday, 6 October 2014 21:07:24 UTC+11, roro codeath wrote: > in ruby: > > > module M > def ins_var > @ins_var ||= nil > end > > > def m > @ins_var = 'val' > end > > > def m2 > m > ins_var # => 'val' > end > end > > > in py: > > > # m.py > > > # how to def ins_var > > > def m: >  

Re: ruby instance variable in python

2014-10-06 Thread Steven D'Aprano
roro codeath wrote: > in ruby: > > module M > def ins_var > @ins_var ||= nil > end > > def m > @ins_var = 'val' > end > > def m2 > m > ins_var # => 'val' > end > end I admit that my Ruby skills are admittedly pretty lousy. Still, I used to think that Ruby was pretty readable, but I find the a

Re: ruby instance variable in python

2014-10-06 Thread Mark Lawrence
On 06/10/2014 11:45, David Palao wrote: Hello, If you explain what the ruby code does, I think much more people will be able to help you. Don't forget, this is a Python list. Not everybody knows Ruby here. Best 2014-10-06 12:06 GMT+02:00 roro codeath : in ruby: Please don't top post here, t

Re: ruby instance variable in python

2014-10-06 Thread David Palao
Hello, If you explain what the ruby code does, I think much more people will be able to help you. Don't forget, this is a Python list. Not everybody knows Ruby here. Best 2014-10-06 12:06 GMT+02:00 roro codeath : > in ruby: > > module M > def ins_var > @ins_var ||= nil > end > > def m > @ins_var

ruby instance variable in python

2014-10-06 Thread roro codeath
in ruby: module M def ins_var @ins_var ||= nil end def m @ins_var = 'val' end def m2 m ins_var # => 'val' end end in py: # m.py # how to def ins_var def m: # how to set ins_var def m2: m() # how to get ins var -- https://mail.python.org/mailman/listinfo/python-list

ruby instance variable in python

2014-10-06 Thread roro codeath
for instance in ruby i can write following code: module M def ins_var @ins_var ||= nil end def m @ins_var = "val" end def m2 ins_var # => "val" end end in py # m.py # how to def a ins_var? def m: # how to set a ins_var? def m2: # how to get a ins_var? -- https://mail.python.org/ma