Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78799

Re: ruby instance variable in python

From Jussi Piitulainen <jpiitula@ling.helsinki.fi>
Newsgroups comp.lang.python
Subject Re: ruby instance variable in python
Date 2014-10-07 15:46 +0300
Organization A noiseless patient Spider
Message-ID <qotzjd8nj3d.fsf@ruuvi.it.helsinki.fi> (permalink)
References <mailman.14632.1412590002.18130.python-list@python.org> <b22416b5-e3ed-4ece-aeba-65603fff1b3f@googlegroups.com>

Show all headers | View raw


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. Could be
> wrong.
> 
> if ins_var is None:
>     ins_var = 'val'

Just out of interest, please, do you think the word 'ternary' is more
or less synonymous with 'conditional'?

I'm not being sarcastic. This possibility just occurred to me, and the
world will begin to make more sense to me if it turns out that there
are people who simply do not think 'three' when they think 'ternary'.

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

ruby instance variable in python roro codeath <rorocodeath@gmail.com> - 2014-10-06 18:06 +0800
  Re: ruby instance variable in python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-07 05:54 +1100
  Re: ruby instance variable in python flebber <flebber.crue@gmail.com> - 2014-10-07 05:29 -0700
    Re: ruby instance variable in python Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2014-10-07 15:46 +0300
      Re: ruby instance variable in python flebber <flebber.crue@gmail.com> - 2014-10-07 17:59 -0700
        Re: ruby instance variable in python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-08 12:32 +1100
          Re: ruby instance variable in python flebber <flebber.crue@gmail.com> - 2014-10-08 03:12 -0700

csiph-web