osdir.com


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

more pythonic way


 

Hello to everyone:

Could you please tell me wich way of writing this method is more pythonic:

 

..

    def find_monthly_expenses(month=None, year=None):

        month = month or datetime.date.today()

..

 

Or it should better be:

...

        if not month:

            month = datetime.date.today()

..

 

Cheers,

Felix.