Skip to content

Commit

Permalink
Hide Query and QueryVariable type aliases (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov authored Jul 19, 2020
1 parent 8ef1f14 commit acc934e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
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

0 comments on commit acc934e

Please sign in to comment.