From 0b0a9588f3d4647eefa172d97f6f20372d6c9737 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Thu, 26 Oct 2017 06:57:46 +0200 Subject: [PATCH] Document default argument syntax (#1687) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 56f44953a..8fc017af2 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ class date(object): def fromtimestamp(cls, timestamp: Union[int, float]) -> date: ... @classmethod def fromordinal(cls, ordinal: int) -> date: ... + def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ... @classmethod def today(self) -> date: ... def ctime(self) -> str: ... @@ -81,6 +82,8 @@ class date(object): as `Text`). Even so, in Python 2, whenever possible, use `unicode` if that's the only possible type, and `Text` if it can be either `unicode` or `bytes`. +* For arguments with default values, use `...` instead of the actual + default value. * Most type-checkers interpret optional parameters of the form `x : Foo = None` as `x : Optional[Foo] = ...`. (So the former is a shortcut for the latter) In typeshed, however, we prefer the explicit latter form.