1212# pylint:disable=R0903
1313from abc import ABCMeta
1414from collections .abc import Sequence
15- from typing import Dict , Optional , Type , Union
15+ from typing import Optional , Union
1616
1717from geoip2 ._internal import Model
1818
@@ -28,13 +28,13 @@ def __repr__(self) -> str:
2828class PlaceRecord (Record , metaclass = ABCMeta ):
2929 """All records with :py:attr:`names` subclass :py:class:`PlaceRecord`."""
3030
31- names : Dict [str , str ]
31+ names : dict [str , str ]
3232 _locales : Sequence [str ]
3333
3434 def __init__ (
3535 self ,
3636 locales : Optional [Sequence [str ]],
37- names : Optional [Dict [str , str ]],
37+ names : Optional [dict [str , str ]],
3838 ) -> None :
3939 if locales is None :
4040 locales = ["en" ]
@@ -98,7 +98,7 @@ def __init__(
9898 * ,
9999 confidence : Optional [int ] = None ,
100100 geoname_id : Optional [int ] = None ,
101- names : Optional [Dict [str , str ]] = None ,
101+ names : Optional [dict [str , str ]] = None ,
102102 ** _ ,
103103 ) -> None :
104104 self .confidence = confidence
@@ -152,7 +152,7 @@ def __init__(
152152 * ,
153153 code : Optional [str ] = None ,
154154 geoname_id : Optional [int ] = None ,
155- names : Optional [Dict [str , str ]] = None ,
155+ names : Optional [dict [str , str ]] = None ,
156156 ** _ ,
157157 ) -> None :
158158 self .code = code
@@ -224,7 +224,7 @@ def __init__(
224224 geoname_id : Optional [int ] = None ,
225225 is_in_european_union : bool = False ,
226226 iso_code : Optional [str ] = None ,
227- names : Optional [Dict [str , str ]] = None ,
227+ names : Optional [dict [str , str ]] = None ,
228228 ** _ ,
229229 ) -> None :
230230 self .confidence = confidence
@@ -305,7 +305,7 @@ def __init__(
305305 geoname_id : Optional [int ] = None ,
306306 is_in_european_union : bool = False ,
307307 iso_code : Optional [str ] = None ,
308- names : Optional [Dict [str , str ]] = None ,
308+ names : Optional [dict [str , str ]] = None ,
309309 # pylint:disable=redefined-builtin
310310 type : Optional [str ] = None ,
311311 ** _ ,
@@ -536,7 +536,7 @@ def __init__(
536536 confidence : Optional [int ] = None ,
537537 geoname_id : Optional [int ] = None ,
538538 iso_code : Optional [str ] = None ,
539- names : Optional [Dict [str , str ]] = None ,
539+ names : Optional [dict [str , str ]] = None ,
540540 ** _ ,
541541 ) -> None :
542542 self .confidence = confidence
@@ -558,13 +558,12 @@ class Subdivisions(tuple):
558558 """
559559
560560 def __new__ (
561- cls : Type ["Subdivisions" ],
561+ cls : type ["Subdivisions" ],
562562 locales : Optional [Sequence [str ]],
563563 * subdivisions ,
564564 ) -> "Subdivisions" :
565565 subobjs = tuple (Subdivision (locales , ** x ) for x in subdivisions )
566- obj = super ().__new__ (cls , subobjs ) # type: ignore
567- return obj
566+ return super ().__new__ (cls , subobjs ) # type: ignore
568567
569568 def __init__ (
570569 self ,
@@ -925,7 +924,7 @@ def __init__(
925924
926925 @property
927926 def ip_address (self ):
928- """The IP address for the record"""
927+ """The IP address for the record. """
929928 if not isinstance (
930929 self ._ip_address ,
931930 (ipaddress .IPv4Address , ipaddress .IPv6Address ),
@@ -935,7 +934,7 @@ def ip_address(self):
935934
936935 @property
937936 def network (self ) -> Optional [Union [ipaddress .IPv4Network , ipaddress .IPv6Network ]]:
938- """The network for the record"""
937+ """The network for the record. """
939938 # This code is duplicated for performance reasons
940939 network = self ._network
941940 if network is not None :
0 commit comments