The error I get on 3.9 without any modifications is
test_puzzles.py:287: in <module>
run_test(test_sum)
test_puzzles.py:191: in run_test
fn()
test_puzzles.py:171: in test_problem
def test_problem(d):
test_puzzles.py:165: in spec
ret["return"][:] = 0
E KeyError: 'return'
and appears to be a result of this line of the documentation for get_type_hints:
The function recursively replaces all Annotated[T, ...] with T, unless include_extras is set to True
It seems that between 3.8 (https://docs.python.org/3.8/library/typing.html#typing.get_type_hints) and 3.9 (https://docs.python.org/3.9/library/typing.html#typing.get_type_hints), the argument
include_extras
was added toget_type_hints
, and it defaults toFalse
, but the behavior in 3.8 was as if the argument wasTrue
. It appears that usingx.__annotations__
instead of https://github.com/srush/Tensor-Puzzles/blob/9635adab1d4d7283baff4675f22bcb45db8ca48e/test_puzzles.py#L133 works with both python versions, but I can't totally verify since I haven't done all the puzzles and don't totally understand the testing setup.The error I get on 3.9 without any modifications is
and appears to be a result of this line of the documentation for
get_type_hints
:Thanks for the puzzles!