[Tutor] unpickling a class

Andy W toodles@yifan.net
Sun, 23 Dec 2001 00:29:13 +0800


> >     if pickle_file is not None:
>
> Can this be abbreviated to
>
>      if pickle_file:
>
> ?

Yep. I think I gained "is not None" through osmosis...I see it in a lot of
programs, that argue its use for readability/comprehensibility.
It's certainly not necessary though.

Andy

>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>