more pythonic way
Terry Reedy
tjreedy at udel.edu
Mon Feb 11 15:35:31 EST 2019
More information about the Python-list mailing list
Mon Feb 11 15:35:31 EST 2019
- Previous message (by thread): more pythonic way
- Next message (by thread): more pythonic way
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): more pythonic way
- Next message (by thread): more pythonic way
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list