Closed jameshughes89 closed 12 months ago
~Remove the use of f strings when there is no need for f string~ Add more details to the f strings for the exceptions.
~ Mostly because my flake8 yelled at me~ It's better this way
:+1:
The messages are redundant to a silly level, but whatever, it's at least showing you that you were in fact wrong. E.g.
"Total fitness of population is 0" vs f"Total fitness of population is 0: {sum(population)}"
"Total fitness of population is 0"
f"Total fitness of population is 0: {sum(population)}"
Obv the sum will be 0, but still, it shows you.
Even for dumb checks like this, it can be helpful to include the erroneous value in the error message. sum cannot be zero but got: {sum} is more helpful than sum cannot be zero.
sum cannot be zero but got: {sum}
sum cannot be zero
good call, brother
What
~Remove the use of f strings when there is no need for f string~ Add more details to the f strings for the exceptions.
Why
~ Mostly because my flake8 yelled at me~ It's better this way
Testing
:+1:
Additional Notes
The messages are redundant to a silly level, but whatever, it's at least showing you that you were in fact wrong. E.g.
"Total fitness of population is 0"
vsf"Total fitness of population is 0: {sum(population)}"
Obv the sum will be 0, but still, it shows you.