852 ssa_path,
853 transcript_json_path,
854 frame_every_x=1,
855 ending_chars=[".", "!", "?"], 856 first_slide_frame_num=0,
857 to_json=False,
858 summarization_method="abstractive",
Do not use a mutable like list
or dictionary
as a default value to an argument. Python’s default arguments are evaluated once when the function is defined. Using a mutable default argument and mutating it will mutate that object for all future calls to the function as well.
def my_function(elem, l=[]):
l.append(elem)
return l
print(my_function(2)) # [2]
print(my_function(5)) # [2, 5]
def my_function(elem, l=None):
if l is None:
l = []
l.append(elem)
return l
print(my_function(2)) # [2]
print(my_function(5)) # [5]