Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion stubs/oauthlib/oauthlib/oauth1/rfc5849/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@ class Client:
): ...
def get_oauth_signature(self, request): ...
def get_oauth_params(self, request): ...
def sign(self, uri, http_method: str = "GET", body: str | None = None, headers: dict[str, str] | None = None, realm=None): ...
def sign(
self,
uri,
http_method: str = "GET",

This comment was marked as outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks. I don't have experience with type stubs, so I appreciate you providing the import statement.

body: str | dict[str, str] | list[tuple[str, str]] | None = None,
headers: dict[str, str] | None = None,
realm=None,
): ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of these arguments are forwarded to oauthlib.common.Request: https://github.com/oauthlib/oauthlib/blob/v3.3.0/oauthlib/oauth1/rfc5849/__init__.py#L295-L296. If you're feeling ambitious, you could align some of the other parameter hints with its signature:

def __init__(
self,
uri: str,
http_method: _HTTPMethod = "GET",
body: str | dict[str, str] | list[tuple[str, str]] | None = None,
headers: Mapping[str, str] | None = None,
encoding: str = "utf-8",
): ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Thanks for the suggestion.