Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Unable to generate yaml for functions decorated with functools.lru_cache #104

Open
JamesLTaylor opened this issue May 4, 2021 · 0 comments

Comments

@JamesLTaylor
Copy link

The issue appears to be when the decorator replaces the function with an instance of a python class.

This repo demonstrates the error.

In short if there is a function like

@lru_cache(maxsize=128)
def cached_adder(a: int, b: int) -> int:

Then sphinx-docfx-yaml produces an error like:

Can't inspect type <class 'functools._lru_cache_wrapper'>: utils.curry_and_docfx.cached_adder

Exception occurred:
  File "c:\dev\python\curry-test\venv\lib\site-packages\docfx_yaml\extension.py", line 523, in insert_children_on_class
    insert_class = app.env.docfx_yaml_classes[datam[CLASS]]
KeyError: 'utils.curry_and_docfx'

and no output is produced.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant