From f54b6efa328d42b22c61f2e3fc5a31069e848457 Mon Sep 17 00:00:00 2001 From: tristanlatr <19967168+tristanlatr@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:49:13 -0500 Subject: [PATCH] 743 fix noise (#744) * Fix ambiguous annotation noise * Add readme entry --------- Co-authored-by: tristanlatr --- README.rst | 1 + pydoctor/linker.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 44876832e..280588043 100644 --- a/README.rst +++ b/README.rst @@ -82,6 +82,7 @@ This is the last major release to support Python 3.7. * Add support for Python 3.12 * `ExtRegistrar.register_post_processor()` now supports a `priority` argument that is an int. Highest priority callables will be called first during post-processing. +* Fix too noisy ``--verbose`` mode (suppres some ambiguous annotations warnings). pydoctor 23.9.1 ^^^^^^^^^^^^^^^ diff --git a/pydoctor/linker.py b/pydoctor/linker.py index 97145b7cc..f403e64dc 100644 --- a/pydoctor/linker.py +++ b/pydoctor/linker.py @@ -261,7 +261,7 @@ def warn_ambiguous_annotation(self, target:str) -> None: # report a low-level message about ambiguous annotation mod_ann = self._module.expandName(target) obj_ann = self._scope.expandName(target) - if mod_ann != obj_ann: + if mod_ann != obj_ann and '.' in obj_ann and '.' in mod_ann: self.obj.report( f'ambiguous annotation {target!r}, could be interpreted as ' f'{obj_ann!r} instead of {mod_ann!r}', section='annotation',