On 04.03.2012 04:59, Richard Purdie wrote:
> Using "1" with getVar is bad coding style and "True" is preferred.
Slightly OT, but wouldn't it be more convenient, especially for external
callers like OE, to make True the default for getVar? This would also
make getVar somehow more symmetric to setVar.
A rough, inexact comparison between usage of True vs. False [1]:
bitbake: 214 times True, 25 times False
openembedded-core: 1143 times True, 49 times False
meta-openembedded: 93 times True, 1 time False
Regards,
Andreas
[1]: Method used to obtain the numbers:
git grep '\<getVar\>\s*([^)]\+,\s*\(True\|1\)\s*)' | wc -l
git grep '\<getVar\>\s*([^)]\+,\s*\(False\|0\)\s*)' | wc -l

On Mon, 2012-03-05 at 13:16 +0100, Andreas Oberritter wrote:
> On 04.03.2012 04:59, Richard Purdie wrote:> > Using "1" with getVar is bad coding style and "True" is preferred.> > Slightly OT, but wouldn't it be more convenient, especially for external> callers like OE, to make True the default for getVar? This would also> make getVar somehow more symmetric to setVar.> > A rough, inexact comparison between usage of True vs. False [1]:> > bitbake: 214 times True, 25 times False> openembedded-core: 1143 times True, 49 times False> meta-openembedded: 93 times True, 1 time False
It would be convenient but would also change things in a way which would
introduce hard to detect subtle bugs. We're thought about it before and
concluded it would cause too much confusion/breakage.
Cheers,
Richard