zoo.py
from main import animal
def getAnimal(animal)
1) if animal == animal.tiger:
or
2) if animal == "animal"
and
main.py
import Zoo
Class animal
tiger = "tiger"
bear = "bear"
1) get = Zoo.getAnimal(animal.tiger)
or
2) get = Zoo.getAnimal("tiger"):
The above is extremely basic example but what is the "best" convention of performing the above code?
I was told it is better to do it via 1) approach because "strange things happen due to how python uses pointers."
Whats happening in terms of at memory level when the above codes are executed?
If I remember correctly, each memory addr gets ascii value of char for the conseq allocated memory address for strings?
Is it the same when string is now being referenced as an object that of animal.tiger?
Or are there no differences at all?