Open
Description
Checklist
- I think this refactoring is useful for everyone (if it's too specific, consider a custom rule)
- I have checked there are no similar issues suggesting the same thing. This is not Replace mutable default arguments doesn't respect type annotations #318
Description
the default value of a parameter should be mutable like {}, [], or pd.DataFrame()
Pycharm is used to detect mutable objects but it doesn't work for pandas
Code Before
def f(df=pd.DataFrame()):
pass
Code After
def f(df=None):
if df is None:
df=pd.DataFrame()