Skip to content

[2.4.0] - 2022-12-21

Compare
Choose a tag to compare
@david-yz-liu david-yz-liu released this 22 Dec 17:52

Enhancements

  • unnecessary_indexing_checker has now been extended to check comprehensions in addition to for loops.
  • invalid_for_target_checker has now been extended to check comprehensions in addition to for loops.
  • forbidden_io_function_checker is now able to check for calls to IO functions written at the top-level of a module, but outside the main block.
  • python_ta.debug.AccumulationTable is extended to support printing loop iterations for while loops.
  • Violated representation invariant error message now includes the class name and current values of the instance attributes.
  • Added constant python_ta.contracts.ENABLE_CONTRACT_CHECKING to only check contracts when its value is set to True.
  • python_ta.debug.AccumulationTable has extended loop detection to allow the loop to appear anywhere inside the with statement.

Bug Fixes

  • Fixed Issue #831: Contract Checker Bug. Now raises AssertionError when the expected type is float but got int instead.
  • PyTA contracts' type checking now raises AssertionError when the expected type is int but got bool instead.
  • Fixed PyTA contract checking when running modules in PyCharm using the "Run File in Python Console" action.

New checkers

Custom checkers:

  • forbidden-top-level-code: Flag code written at the top level when it is not one of the four acceptable types.