We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems that an optional return type does not work as expected. Extending the test case in def test_optional(tdir): results in an error:
def test_optional(tdir):
@cachew(tdir) def data() -> Optional[Job]: return None
Error:
... @cachew(tdir) > def data() -> Optional[Job]: test_cachew.py:497: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../__init__.py:694: in <lambda> return lambda realf: f(realf, *args, **kwargs) ../__init__.py:789: in cachew inferred = infer_type(func) ../__init__.py:667: in infer_type if not issubclass(rtype.__origin__, Iterable): /usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py:835: in __subclasscheck__ return issubclass(cls, self.__origin__) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = <class 'collections.abc.Iterable'>, subclass = typing.Union def __subclasscheck__(cls, subclass): """Override for issubclass(subclass, cls).""" > return _abc_subclasscheck(cls, subclass) E TypeError: issubclass() arg 1 must be a class
The text was updated successfully, but these errors were encountered:
core: rewrite and simplify return type inference
8e2a706
simplifies code by reusing existing marshalling routings in addition enables support for #29 (needs a bit more work though)
c82d6ff
ae7edaa
core: add support for caching single return values, not just iterables
2d06acf
should fix #29
251efb5
No branches or pull requests
It seems that an optional return type does not work as expected. Extending the test case in
def test_optional(tdir):
results in an error:Error:
The text was updated successfully, but these errors were encountered: