@@ -42,10 +42,17 @@ def get_use_tree(
42
42
scope : Scope ,
43
43
use_dict : dict [str , Use | Import ],
44
44
obj_tree : dict ,
45
- only_list : set [str ] = set () ,
46
- rename_map : dict [str , str ] = {} ,
47
- curr_path : list [str ] = [] ,
45
+ only_list : list [str ] = None ,
46
+ rename_map : dict [str , str ] = None ,
47
+ curr_path : list [str ] = None ,
48
48
):
49
+ if only_list is None :
50
+ only_list = set ()
51
+ if rename_map is None :
52
+ rename_map = {}
53
+ if curr_path is None :
54
+ curr_path = []
55
+
49
56
def intersect_only (use_stmnt : Use | Import ):
50
57
tmp_list = []
51
58
tmp_map = rename_map .copy ()
@@ -318,10 +325,12 @@ class Use:
318
325
def __init__ (
319
326
self ,
320
327
mod_name : str ,
321
- only_list : set [str ] = set () ,
328
+ only_list : set [str ] = None ,
322
329
rename_map : dict [str , str ] = None ,
323
- line_number : int | None = 0 ,
330
+ line_number : int = 0 ,
324
331
):
332
+ if only_list is None :
333
+ only_list = set ()
325
334
if rename_map is None :
326
335
rename_map = {}
327
336
self .mod_name : str = mod_name .lower ()
@@ -364,10 +373,12 @@ def __init__(
364
373
self ,
365
374
name : str ,
366
375
import_type : ImportTypes = ImportTypes .DEFAULT ,
367
- only_list : set [str ] = set () ,
376
+ only_list : set [str ] = None ,
368
377
rename_map : dict [str , str ] = None ,
369
378
line_number : int = 0 ,
370
379
):
380
+ if only_list is None :
381
+ only_list = set ()
371
382
if rename_map is None :
372
383
rename_map = {}
373
384
super ().__init__ (name , only_list , rename_map , line_number )
0 commit comments