Mercurial > p > roundup > code
diff CHANGES.txt @ 7766:c65e0a725c88
fix: replace eval with ast.literal_eval; ruff linting
strings.py:
When reading csv export files, use the safer literal_eval to
evaluate the fields. Issue pointed out by ruff linter.
Other Cleanup:
sort imports
replace if, else, if, else with if, elif, else
use isinstance with tuples rather than 'isinstance() or
isinstance()'
test_anypy.py:
Added tests for tuples, and booleans. Also added exception handling
for malformed strings, booleans, tuples.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 02 Mar 2024 04:01:22 -0500 |
| parents | ad1e8e1f7fa7 |
| children | af6b577993f5 |
line wrap: on
line diff
--- a/CHANGES.txt Sat Mar 02 02:30:12 2024 -0500 +++ b/CHANGES.txt Sat Mar 02 04:01:22 2024 -0500 @@ -92,6 +92,8 @@ classhelp for users now shows the requested properties. (Found by team-3 of the UMass-Boston CS682 Spring 2024 class; fix John Rouillard) +- use ast.eval_literal() rather than eval() to turn CSV exported + string values into Python object/values. Features:
