On Thu, Sep 5, 2013 at 12:44 PM, Mike Dewhirst <[email protected]>wrote:

> On 5/09/2013 12:27pm, Javier Candeira wrote:
>
>> Put first an
>> unguarded expression that might go boom, so it goes boom early.
>> Brilliant. It's still a hack.
>>
>
> So what if your method only cared about a particular attribute of whatever
> object is passed in?
>
> Then maybe ...
>
>     assert(obj.attribute is not None)
>
> ... which reminds me of Eiffel
>
> Mike
>
> What if obj.attribute is allowed to be None?

assert(obj.attribute)

would work fine.

John La Rooy
_______________________________________________
melbourne-pug mailing list
[email protected]
https://mail.python.org/mailman/listinfo/melbourne-pug

Reply via email to