osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

more pythonic way


On 2/11/2019 2:46 PM, Felix Lazaro Carbonell wrote:

>      def find_monthly_expenses(month=None, year=None):
>          month = month or datetime.date.today().month
> 
> Or it should better be:

>          if not month:
>              month = datetime.date.today().month

As a 20+ year veteran, I would be fine either way.

-- 
Terry Jan Reedy