Message7339
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/) |
|
Date |
User |
Action |
Args |
2021-09-01 15:48:37 | rouilj | set | recipients:
+ rouilj, schlatterbeck |
2021-09-01 15:48:37 | rouilj | link | issue2551159 messages |
2021-09-01 15:48:37 | rouilj | create | |
|