Azure / Azure/azure-sdk-tools

[Python APIView] docstring and annotations with *args are being mixed

Open
#8,574 6 comments 0 reactions 1 assignee Assigned to @swathipil View on GitHub
APIView Client Python
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
144

Description

The [[APIView]](https://apiview.dev/Assemblies/Review/a9a32dd697cf46e5bfdb586b779355bb?revisionId=a7257080d54e4e28b9dcd4e07ff937a3&diffOnly=False&doc=False&diffRevisionId=67b1ef1c4d07412cb0f0a78a83d9d914#2d2299d509d8469db09ca9e65d74c4ca) for the following method seems to be mixing docstring and annotations in the signature:
```
class InvalidContentError(ValueError):
"""Error during encoding or decoding content with a schema.

:param str message: The message object stringified as 'message' attribute
:keyword dict[str, str] or None details: The error details. Depending on the error, this may include
information like: `schema_id`, `schema_definition`, `message_content`.
:keyword error: The original exception, if any.

:ivar str message: A stringified version of the message parameter
:ivar dict[str, str] details: The error details. Depending on the error, this may include
information like: `schema_id`, `schema_definition`, `message_content`.
"""

def __init__(self, message: str, *args: Any, **kwargs: Any) -> None:
```

APIView:
```
def __init__(
self,
message: str,
*args: Any,
*,
error = ...
**kwargs: Any
) -> None:
```

I would expect that the APIView method signature looks entirely like the method signature and not the docstring. Should I update this method/docstring in some way or is this is an APIView bug? Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.