Skip to content

Decorators are not linked, emit RuntimeWarning #28

Closed
@Zac-HD

Description

@Zac-HD
.. code:: python

    from functools import lru_cache

    @lru_cache
    def f(x): pass

    @lru_cache(maxsize=None)
    def f(x): pass

would ideally have lru_cache autolinked when used as a decorator, but instead we get:

sphinx_codeautolink/extension/block.py:224: 
	RuntimeWarning: Could not match transformation of `lru_cache` 
	on source line 3 <or line 6> in document "example.html", source:

from functools import lru_cache

@lru_cache
def f(x): pass

@lru_cache(maxsize=None)
def f(x): pass

I'm running Python 3.8, sphinx-codeautolink 0.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions