PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!)

Tim Chase python.list at tim.thechases.com
Thu Feb 13 06:51:42 EST 2014


On 2014-02-13 05:39, Tim Chase wrote:
>   def age(self, as_of=None):
>     if as_of is None:
>       as_of = datetime.date.today()
>     return as_of = self.dob

and of course I mean

  return as_of - self.dob

which is what I get for typing in the dark and the "-" and "="
keys are adjacent. :-/

-tkc





More information about the Python-list mailing list