I am using Sphinx v1.8.5 to build documentation for Python 2 code that has external dependencies that I mock using autodoc_mock_imports
. I get an error message when I try to use the mocked object (RAMP
) as a default argument:
def foo(name, amp=RAMP):
The error says:
NameError: name 'RAMP' is not defined
If I do not use RAMP
as a default argument, the error disappears. What am I doing wrong?