diff --git a/setup.cfg b/setup.cfg index 8dad329c..64a4f48c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,3 +40,4 @@ exclude_lines = pragma: no cover pragma: nocover if typing.TYPE_CHECKING: + @typing.overload diff --git a/starlette/config.py b/starlette/config.py index a4abf49a..8c58b273 100644 --- a/starlette/config.py +++ b/starlette/config.py @@ -61,21 +61,17 @@ class Config: self.file_values = self._read_file(env_file) @typing.overload - def __call__( - self, key: str, *, default: None - ) -> typing.Optional[str]: # pragma: no cover + def __call__(self, key: str, *, default: None) -> typing.Optional[str]: ... @typing.overload - def __call__( - self, key: str, cast: typing.Type[T], default: T = ... - ) -> T: # pragma: no cover + def __call__(self, key: str, cast: typing.Type[T], default: T = ...) -> T: ... @typing.overload def __call__( self, key: str, cast: typing.Type[str] = ..., default: str = ... - ) -> str: # pragma: no cover + ) -> str: ... @typing.overload @@ -84,13 +80,13 @@ class Config: key: str, cast: typing.Callable[[typing.Any], T] = ..., default: typing.Any = ..., - ) -> T: # pragma: no cover + ) -> T: ... @typing.overload def __call__( self, key: str, cast: typing.Type[str] = ..., default: T = ... - ) -> typing.Union[T, str]: # pragma: no cover + ) -> typing.Union[T, str]: ... def __call__(