Or wouldn't it be enough to simply mandate that exists() return something
that can be tested against True/False?
If that's the case, wouldn't a bit of wrapping around and implementing the
__eq__/__neq__ descriptors (possibly __cmp__) be good enough so that we can
get to the error description when needed (if False) without breaking
existing usages?

Or maybe I'm just missing the point, in which case I apologize ;)

Cheers,

JB

On 9 September 2014 04:24, William Blevins <[email protected]> wrote:

> This might be obvious, but it the exception pattern not popular in python?
> On Sep 8, 2014 9:19 PM, "Gary Oberbrunner" <[email protected]> wrote:
>
>>
>> On Mon, Sep 8, 2014 at 4:13 PM, Kenny, Jason L <[email protected]>
>> 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
>>
>> _______________________________________________
>> Scons-dev mailing list
>> [email protected]
>> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>>
>>
> _______________________________________________
> Scons-dev mailing list
> [email protected]
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
>
_______________________________________________
Scons-dev mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev

Reply via email to