[Scons-dev] This morning's WTF moment

Gary Oberbrunner garyo at oberbrunner.com
Mon Sep 8 21:19:03 EDT 2014


On Mon, Sep 8, 2014 at 4:13 PM, Kenny, Jason L <jason.l.kenny at intel.com>
wrote:

> Ideally I always viewed this as a True False statement. I see you have it
> returning a tuple.
>
>
>
> I only worry that I have seen a lot push with certain python developers to
> say stuff like
>
>
>
> if not tool.exists():
>
>     # do something…
>
>
>
> This will not work as we will have a (True,””) or (False,””) return API.
> This seems to me to more complex to use and understand. At the very least
> east to trip up on. If we want an object returned. I think it will be
> better to define a error object that can be tested as True or False vs
> forcing tuple separation on returns values.
>

Excellent point.  The 'if not tool.exists()' pattern needs to work.  I'll
rethink that.  Maybe something as simple as tool.exist_error() which can be
called just after exists() returns False...

-- 
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20140908/6dd2f725/attachment-0001.html>


More information about the Scons-dev mailing list