>>>            self.name =ame
>
> I assume this is a typo? And it never gets executed because the error is
> always raised.

yep. that was a typo that should be "name"

> I don't mind using exceptions for a simple test but not where the test is
> being forced by a piece of code that does nothing. In this case I agree it
> would be better to check explicitly for a string if a string is required.

I am indeed trying to check if it's a string.
>
>  if type(name) != str:
>       super(....)
>  else:
>       # other stuff here
>
> is clearer still
>

In this case, is there any argument against checking for None? Or is
it better to do a type check for a string?

if name is None:
    super(....)
else:
    # do stuff
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to