Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Query and QueryVariable type aliases #475

Merged
merged 1 commit into from
Jul 19, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGES/431.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hide `Query` and `QueryVariable` type aliases in `__init__.pyi`, now they are prefixed with underscore.
18 changes: 9 additions & 9 deletions yarl/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import overload, Any, Tuple, Optional, Mapping, Union, Sequence, Type
import multidict

QueryVariable = Union[str, int]
Query = Union[
None, str, Mapping[str, QueryVariable], Sequence[Tuple[str, QueryVariable]]
_QueryVariable = Union[str, int]
_Query = Union[
None, str, Mapping[str, _QueryVariable], Sequence[Tuple[str, _QueryVariable]]
]

class URL:
Expand Down Expand Up @@ -42,7 +42,7 @@ class URL:
host: str = ...,
port: Optional[int] = ...,
path: str = ...,
query: Optional[Query] = ...,
query: Optional[_Query] = ...,
query_string: str = ...,
fragment: str = ...,
encoded: bool = ...
Expand All @@ -56,7 +56,7 @@ class URL:
def __gt__(self, other: Any) -> bool: ...
def __hash__(self) -> int: ...
def __truediv__(self, name: str) -> URL: ...
def __mod__(self, query: Query) -> URL: ...
def __mod__(self, query: _Query) -> URL: ...
def is_absolute(self) -> bool: ...
def is_default_port(self) -> bool: ...
def origin(self) -> URL: ...
Expand All @@ -68,13 +68,13 @@ class URL:
def with_port(self, port: Optional[int]) -> URL: ...
def with_path(self, path: str, *, encoded: bool = ...) -> URL: ...
@overload
def with_query(self, query: Query) -> URL: ...
def with_query(self, query: _Query) -> URL: ...
@overload
def with_query(self, **kwargs: QueryVariable) -> URL: ...
def with_query(self, **kwargs: _QueryVariable) -> URL: ...
@overload
def update_query(self, query: Query) -> URL: ...
def update_query(self, query: _Query) -> URL: ...
@overload
def update_query(self, **kwargs: QueryVariable) -> URL: ...
def update_query(self, **kwargs: _QueryVariable) -> URL: ...
def with_fragment(self, fragment: Optional[str]) -> URL: ...
def with_name(self, name: str) -> URL: ...
def join(self, url: URL) -> URL: ...
Expand Down