Kless wrote:
On 10 ago, 15:03, Paddy <[EMAIL PROTECTED]> 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
like:
self._foo
If it is present then fine, if it is not then an exception is raised.
On 10 ago, 15:03, Paddy <[EMAIL PROTECTED]> 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
> like:
>
> self._foo
>
> If it is present then fine, if it is not then an exception is raised.
It on
On Aug 10, 9:13 am, Kless <[EMAIL PROTECTED]> wrote:
> Which is the best mode for validation of parameters? I'm using the
> next way but it is not well testable.
>
> -
> if not self._foo:
> try:
> raise ValueError('Val
Which is the best mode for validation of parameters? I'm using the
next way but it is not well testable.
-
if not self._foo:
try:
raise ValueError('ValueError: foo not found')
except ValueError, err:
print (err.message)