0

Let's say I have:

# a.py
def number(value):
 return value+1

# main.py
import a
print(a.number(0)) # 1

Then I change the value of my function, and save the file:

# a.py
def number(value):
 return value+2

And then I import it again but I still get the same number:

# main.py
import a
print(number(0)) # 1

What do I need to do to override the function?

zest16
  • 455
  • 3
  • 7
  • 20

1 Answers1

0

Check if you have .pyc files , remove them if yes and run your code

Sami Fakhfakh
  • 89
  • 2
  • 17