From e67961e3877584af7218cfda8c4fd186546ea51f Mon Sep 17 00:00:00 2001 From: Dan Crosta Date: Mon, 6 May 2019 11:36:49 -0400 Subject: [PATCH] add click.types.DateTime to click stubs (#2958) --- third_party/2and3/click/types.pyi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/third_party/2and3/click/types.pyi b/third_party/2and3/click/types.pyi index 39449555c..a21b28972 100644 --- a/third_party/2and3/click/types.pyi +++ b/third_party/2and3/click/types.pyi @@ -1,4 +1,5 @@ from typing import Any, Callable, IO, Iterable, List, Optional, TypeVar, Union, Tuple as _PyTuple, Type +import datetime import uuid from click.core import Context, Parameter, _ParamType as ParamType, _ConvertibleType @@ -35,6 +36,22 @@ class Choice(ParamType): ... +class DateTime(ParamType): + def __init__( + self, + formats: Optional[List[str]] = ..., + ) -> None: + ... + + def convert( + self, + value: str, + param: Optional[Parameter], + ctx: Optional[Context], + ) -> datetime.datetime: + ... + + class FloatParamType(ParamType): def __call__( self,