Validation of parameters
tjreedy at udel.edu
Sun Aug 10 20:32:14 CEST 2008
> On 10 ago, 15:03, Paddy <paddy3... at googlemail.com> wrote:
>> If you just want the absense of _foo to raise an exception then why to
>> just reference self._foo and leave the hard work to ptyhon? Something
>> If it is present then fine, if it is not then an exception is raised.
> It only was an example but I need show a better message.
The usual idiom is
except AttrError as m: #3.0
More information about the Python-list