From: Joshua Lock <josh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: accessing variables
Date: Wed, 01 Feb 2012 10:18:30 -0800 [thread overview]
Message-ID: <4F2981F6.9090701@linux.intel.com> (raw)
In-Reply-To: <CALbNGRSKUfru5Z-jAJmywTieJUALfLAZgxW_NEhLBK8W5pw1VA@mail.gmail.com>
On 01/02/12 10:15, Andreas Müller wrote:
> another stupid question from my side:
>
> do
>
> bb.data.getVar('foo', d, 1)
>
> and
>
> d.getVar('foo', 1)
>
> access the same data?
Yes.
The first is calling the class method and passing in an instance of a
data object, the second is calling the method on the object directly.
Either way you're using the same data object, d.
The latter is more pythonic and we've been slowly moving the code
towards that style.
Also for stylistic reasons please use True/False rather than 1/0 for the
final parameter.
Cheers,
Joshua
--
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre
next prev parent reply other threads:[~2012-02-01 18:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 18:15 accessing variables Andreas Müller
2012-02-01 18:16 ` Otavio Salvador
2012-02-01 22:40 ` Chris Larson
2012-02-01 18:18 ` Joshua Lock [this message]
2012-02-01 18:24 ` Martin Jansa
2012-02-01 18:56 ` Andreas Müller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F2981F6.9090701@linux.intel.com \
--to=josh@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.