[Product-Developers] Re: Hiding portlet when there is no data to display.
wichert at wiggy.net
Thu May 1 07:32:00 UTC 2008
Previously Martin Aspeli wrote:
> Jean-Pascal Houde wrote:
> >I remember getting an attribute error on available, and it was because
> >of an exception that was happening in the method (available). For
> >reason the exception was being stopped somewhere and an AttributeError
> >what I was seeing instead.
> >So are you sure that your code isn't triggering any exception?
> >(For exemple, self._data() could return None instead of  so len
> >would not work and raise an exception)
> I think that's right - you get the AttributeError due to some weirdness
> to do with the @property descriptor when an error is thrown in the handler.
It's not really that weird, is it? I would be extremely surprised if
trying to access an attribute would raise anything else than an
AttributeError. Current versions of python support implementing an
attribute via a property, but that does not change that expectation.
Wichert Akkerman <wichert at wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
More information about the Product-Developers