Skip to content

Commit

Permalink
fix(mitmproxy#753): Apply suggestion
Browse files Browse the repository at this point in the history
... from @mhils during mitmproxy#754

Signed-off-by: Bryant Finney <[email protected]>
  • Loading branch information
bryant-finney committed Oct 23, 2024
1 parent cb540f8 commit 2878ac5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pdoc/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ class Doc(Generic[T]):
qualname: str
"""
The qualified identifier name for this object. For example, if we have the following code:
```python
class Foo:
def bar(self):
pass
```
The qualname of `Foo`'s `bar` method is `Foo.bar`. The qualname of the `Foo` class is just `Foo`.
See <https://www.python.org/dev/peps/pep-3155/> for details.
"""

Expand Down Expand Up @@ -445,7 +445,7 @@ def _taken_from(self, member_name: str, obj: Any) -> tuple[str, str]:

mod = _safe_getattr(obj, "__module__", None)
qual = _safe_getattr(obj, "__qualname__", None)
if mod and hasattr(qual, "__contains__") and "<locals>" not in qual:
if mod and isinstance(qual, str) and "<locals>" not in qual:
return mod, qual
else:
# This might be wrong, but it's the best guess we have.
Expand Down Expand Up @@ -1051,7 +1051,7 @@ class Variable(Doc[None]):
) # technically Any includes empty, but this conveys intent.
"""
The variable's default value.
In some cases, no default value is known. This may either be because a variable is only defined in the constructor,
or it is only declared with a type annotation without assignment (`foo: int`).
To distinguish this case from a default value of `None`, `pdoc.doc_types.empty` is used as a placeholder.
Expand All @@ -1060,7 +1060,7 @@ class Variable(Doc[None]):
annotation: type | empty
"""
The variable's type annotation.
If there is no type annotation, `pdoc.doc_types.empty` is used as a placeholder.
"""

Expand Down

0 comments on commit 2878ac5

Please sign in to comment.