The code I am working with is
build_data = {}
# Code that adds data to build_data
build_data_filtered = {}
if flag:
# Code that adds subset of build_data to build_data_filtered
global build_data
build_data = build_data_filtered
The line “global build_data” shows a code hint in pycharm
Name 'build_data' used both as a parameter and as a global
What can I do to remove this hint or is there a better approach to this?
Why are you using the
globalstatement outside of a function?Just remove the line
global build_dataand this should work.