Remove mutable defaults from function signature. (#1663)

This commit is contained in:
IJumpAround 2023-05-08 21:55:41 -04:00 committed by GitHub
parent 32ad47c898
commit 020fe7b50b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 10 deletions

View file

@ -55,12 +55,12 @@ class Iteratorize:
Adapted from: https://stackoverflow.com/a/9969000
"""
def __init__(self, func, kwargs={}, callback=None):
def __init__(self, func, kwargs=None, callback=None):
self.mfunc = func
self.c_callback = callback
self.q = Queue()
self.sentinel = object()
self.kwargs = kwargs
self.kwargs = kwargs or {}
self.stop_now = False
def _callback(val):