The first one is used very often. Less verbose

Le 11 févr. 2019 à 20:41, à 20:41, Felix Lazaro Carbonell 
<fe...@epepm.cupet.cu> a écrit:
> 
>
>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.
>
> 
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to