From ff92eb4af236735bab96996bbf5dc5e3a57bf28a Mon Sep 17 00:00:00 2001 From: jicruz96 Date: Thu, 25 Jul 2024 14:51:39 -0400 Subject: [PATCH] [nit] use explicit types for country overload --- geonamescache/mappers.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/geonamescache/mappers.py b/geonamescache/mappers.py index 3c02c4a..45d1aa4 100644 --- a/geonamescache/mappers.py +++ b/geonamescache/mappers.py @@ -4,7 +4,8 @@ from geonamescache import GeonamesCache from . import mappings -from .types import ContinentCode, CountryFields, CountryNumericFields +from .types import (ContinentCode, CountryFields, CountryNumericFields, + CountryStringFields) @overload @@ -16,20 +17,7 @@ def country( @overload def country( from_key: str = "name", - to_key: Literal[ - "capital", - "currencycode", - "currencyname", - "iso", - "iso3", - "fips", - "languages", - "name", - "neighbours", - "phone", - "postalcoderegex", - "tld", - ] = "iso", + to_key: CountryStringFields = "iso", ) -> Callable[[str], str]: ...