datacamp / pythonwhat

Verify Python code submissions and auto-generate meaningful feedback messages.
http://pythonwhat.readthedocs.io/
GNU Affero General Public License v3.0
69 stars 31 forks source link

Add a tolerance argument to has_equal_value() #376

Open richierocks opened 5 years ago

richierocks commented 5 years ago

Checking that two numbers are equal within a specified tolerance is currently a bit clunky and prone to error.

See this example of it being done wrong.

https://github.com/datacamp/courses-statistical-simulation-in-python/pull/106#pullrequestreview-234160761

Having a tolerance argument would save messing about writing custom equality functions.