Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Fix new style union syntax in type aliases#14008
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Changes fromall commits
585665776b543db11b0238c57be506d0c8d5a79c205438a2e6adab4e6726101967a2cc0d7bfa1f359e72893a918de9c391File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Very simplified decimal stubs for use in tests | ||
| class Decimal: | ||
| def __new__(cls, value: str = ...) -> Decimal: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Very simplified datetime stubs for use in tests | ||
| class datetime: | ||
| def __new__( | ||
| cls, | ||
| year: int, | ||
| month: int, | ||
| day: int, | ||
| hour: int = ..., | ||
| minute: int = ..., | ||
| second: int = ..., | ||
| microsecond: int = ..., | ||
| *, | ||
| fold: int = ..., | ||
| ) -> datetime: ... | ||
| def __format__(self, __fmt: str) -> str: ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Very simplified decimal stubs for use in tests | ||
| from _decimal import * |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| from typing import Generic, TypeVar, Callable, Any, Mapping | ||
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Some tests were using the typeshed stub for | ||
| _T = TypeVar("_T") | ||
| class _SingleDispatchCallable(Generic[_T]): | ||
| registry: Mapping[Any, Callable[..., _T]] | ||
| def dispatch(self, cls: Any) -> Callable[..., _T]: ... | ||
| # @fun.register(complex) | ||
| # def _(arg, verbose=False): ... | ||
| @overload | ||
| def register(self, cls: type[Any], func: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... | ||
| # @fun.register | ||
| # def _(arg: int, verbose=False): | ||
| @overload | ||
| def register(self, cls: Callable[..., _T], func: None = ...) -> Callable[..., _T]: ... | ||
| # fun.register(int, lambda x: x) | ||
| @overload | ||
| def register(self, cls: type[Any], func: Callable[..., _T]) -> Callable[..., _T]: ... | ||
| def _clear_cache(self) -> None: ... | ||
| def __call__(__self, *args: Any, **kwargs: Any) -> _T: ... | ||
| def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... | ||
| def total_ordering(cls: type[_T]) -> type[_T]: ... | ||
| class cached_property(Generic[_T]): | ||
| func: Callable[[Any], _T] | ||
| attrname: str | None | ||
| def __init__(self, func: Callable[[Any], _T]) -> None: ... | ||
| @overload | ||
| def __get__(self, instance: None, owner: type[Any] | None = ...) -> cached_property[_T]: ... | ||
| @overload | ||
| def __get__(self, instance: object, owner: type[Any] | None = ...) -> _T: ... | ||
| def __set_name__(self, owner: type[Any], name: str) -> None: ... | ||
| def __class_getitem__(cls, item: Any) -> Any: ... | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Very simplified traceback stubs for use in tests | ||
| def print_tb(*args, **kwargs) -> None: ... |
Uh oh!
There was an error while loading.Please reload this page.