Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: DefinedNamespace: fixed handling of
_NS
attribute
This patch changes `DefinedNamespace` to always raise `AttributeError` for the name `_NS` from `__getattr__`. Without doign this `inspect.signature` recurses infinitely when inspecting `rdflib.namespace.DefinedNamespace`. One situation in which this occurs is when sphinx autodoc is generating documentation from type hints: ``` WARNING: error while formatting signature for rdflib.namespace.DefinedNamespace: Handler <function record_typehints at 0x7fbf2696dd40> for event 'autodoc-process-signature' threw an exception (exception: maximum recursion depth exceeded while calling a Python object) ``` Also: - fix: handling of `_NS` in `__contains__`. Without this `dir` on an empty `DefinedNamespace` does not behave correctly.
- Loading branch information