> 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


That might be ok if string or None are the only types you could get.
Checking for not string will catch any numbers, booleans or anything 
else that might slip through...

Basically check for what id most accurately representing what 
you want. If you want to catch anything other than a string use
an explicit string test, if you only want to catch None then check 
for None.

Alan G.

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to