Closed teichert closed 3 years ago
Thanks for looking through this! I've responded to your comments and also added the tests for None: str
and other: str
.
Here is a test that probably should be added (it would currently fail):
def test_str_nonidentifier_should_fail():
with pytest.raises(TypeError):
def func(x: TensorType["x":"y+2"]):
pass
The point is that we should probably only allow str
for a dimension size if it is a legit identifier (alphanumeric or underscore but doesn't start with a number). Do you want me to add the test and then make the fix? I can't think of a good reason not to.
Thanks for the changes.
I actually wouldn't worry about that last one. For the time being any string is a valid way of referring to a dimension, and this then becomes an exception to that rule. And once #2 happens, I don't see a reason to avoid functions in the other named dimensoin.
Okay; sounds good! Let me know if you need anything else from me.
LGTM! Thanks for contributing.
fixes #15, tests, and updates README