kernc
kernc
`lunr_search=` param is expected to be a dict, not bool: https://github.com/pdoc3/pdoc/blob/2a66eb2c882cabd195a61f44a921bfdc39eddf2e/pdoc/templates/config.mako#L51-L56
> pdoc is trying to `exec` that as a python function. `at::` is a C++ namespace which causes the problem. Yeah, we try to prepopulate custom `_globals` from the parent...
`at` seems to be the namespace that actually [defines the class](https://pytorch.org/cppdocs/api/namespace_at.html#classes). Issue https://github.com/pytorch/extension-cpp/issues/31. Pybind11 is just exact.
> `except NameError` and, in lack of better ideas, return None Here's one better idea: 1. strip type annotations, 2. issue a warning, 3. try exec again. This way we...
> I'm trying to define my docstring manually This sounds like a pain to maintain. :grimacing: Prefer some patching like: ```py read_coefficients.__doc__ = read_coefficients.__doc__.replace('at::', 'torch.') ``` if it can be...
https://github.com/pdoc3/pdoc/blob/9e4f6ad4b311f267648aa1533487a17c8b124f93/pdoc/html_helpers.py#L628-L638 The question seems to be, why isn't `'/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/'` recognized/configured as ['platlib'](https://docs.python.org/3/library/sysconfig.html#installation-paths) path.
The warning you mention is printed when the source code of a module/object can't be determined: https://github.com/pdoc3/pdoc/blob/048919ece483e0609094cee2460d3467d2e0efc3/pdoc/__init__.py#L238-L242
The warning is also raised when the source code does not follow valid Python 3 syntax ... Maybe we should also print the raised exception _type_. :thinking:
Confirmed. ```py >>> import inspect, test.test2 >>> test.test2 >>> inspect.getsource(test.test2) ------------------------------------------------------------------------------------ /usr/lib/python3.7/inspect.py in findsource(object) 784 lines = linecache.getlines(file) 785 if not lines: --> 786 raise OSError('could not get source code')...
This is Python bug [bpo-27578](https://bugs.python.org/issue27578) and proposed fixing PR https://github.com/python/cpython/pull/20809. Encouraged to upvote; contribs move nowhere in CPython. :laughing: