-4

I have file foo.py

PARAMS = None
def cals(x):
    return PARAMS + x

I want to import foo.py into bar.py like below

import foo
foo.PARAMS = 4

print(foo.cals(4))

but in pycharm it show redeclared 'PARAMS' defined above without usage. what meaning of pycharm showed

Peter
  • 120
  • 1
  • 8

1 Answers1

0

when you import something, it runs through the file. I think it is saying that when you imported foo.py, the keyword PARAMS was not used. I would just ignore it, or if you have OCD you can change it and see if the warming goes away.

Kenivia
  • 384
  • 1
  • 13