[Tutor] __init__, default values and dict's

Kent Johnson kent37 at tds.net
Thu Aug 14 19:46:22 CEST 2008


On Thu, Aug 14, 2008 at 1:32 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
> For the second try
>
> def __init__(self, d=None):
>   if not d:

I would use
  if d is None:
so the user can explicitly pass e.g. an empty dict.

Kent


More information about the Tutor mailing list