more pythonic way

Grant Edwards grant.b.edwards at
Mon Feb 11 14:45:37 EST 2019

On 2019-02-11, Felix Lazaro Carbonell <felix at> wrote:

> 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
> Or it should better be:
>         if not month:
>             month =

The most pythonic way is to do this:

   def find_monthly_expenses(,

And then start a month-long argument on the mailing list about how the
behavior of parameter default values is wrong and needs be changed.


Grant Edwards               grant.b.edwards        Yow! I always have fun
                                  at               because I'm out of my

More information about the Python-list mailing list