Roundup Tracker - Issues

Message7339

Author rouilj
Recipients rouilj, schlatterbeck
Date 2021-09-01.15:48:37
Message-id <20210901154830.517716A0203@pe15.cs.umb.edu>
In-reply-to <20210901074400.2utnfvkykg2te7qw@runtux.com>
In message <20210901074400.2utnfvkykg2te7qw@runtux.com>,
Ralf Schlatterbeck writes:
>On Wed, Sep 01, 2021 at 02:26:09AM +0000, John Rouillard wrote:
>> If my index is displaying all items in the tracker, the filterspec is
>> None.  I then get the following traceback:
>[...]
>
>How about setting the filterspec to {}
>That's what I usually use in such a case.

Ah nice. Should we change

  def  filter(...,filterspec=None,....):

to add:

      if filterspec == None:
         filterspec = {}

at the beginning of the function?

(For those reading, filter(...,filterspec={},,,,) is not a good idea
because the {} object is persistent. So any change the method does to
filterspec will be used on the next call to filter(). Same with [].

https://pythonconquerstheuniverse.wordpress.com/2012/02/15/mutable-default-arguments/)
History
Date User Action Args
2021-09-01 15:48:37rouiljsetrecipients: + rouilj, schlatterbeck
2021-09-01 15:48:37rouiljlinkissue2551159 messages
2021-09-01 15:48:37rouiljcreate