12
12
# pylint:disable=R0903
13
13
from abc import ABCMeta
14
14
from collections .abc import Sequence
15
- from typing import Dict , Optional , Type , Union
15
+ from typing import Optional , Union
16
16
17
17
from geoip2 ._internal import Model
18
18
@@ -28,13 +28,13 @@ def __repr__(self) -> str:
28
28
class PlaceRecord (Record , metaclass = ABCMeta ):
29
29
"""All records with :py:attr:`names` subclass :py:class:`PlaceRecord`."""
30
30
31
- names : Dict [str , str ]
31
+ names : dict [str , str ]
32
32
_locales : Sequence [str ]
33
33
34
34
def __init__ (
35
35
self ,
36
36
locales : Optional [Sequence [str ]],
37
- names : Optional [Dict [str , str ]],
37
+ names : Optional [dict [str , str ]],
38
38
) -> None :
39
39
if locales is None :
40
40
locales = ["en" ]
@@ -98,7 +98,7 @@ def __init__(
98
98
* ,
99
99
confidence : Optional [int ] = None ,
100
100
geoname_id : Optional [int ] = None ,
101
- names : Optional [Dict [str , str ]] = None ,
101
+ names : Optional [dict [str , str ]] = None ,
102
102
** _ ,
103
103
) -> None :
104
104
self .confidence = confidence
@@ -152,7 +152,7 @@ def __init__(
152
152
* ,
153
153
code : Optional [str ] = None ,
154
154
geoname_id : Optional [int ] = None ,
155
- names : Optional [Dict [str , str ]] = None ,
155
+ names : Optional [dict [str , str ]] = None ,
156
156
** _ ,
157
157
) -> None :
158
158
self .code = code
@@ -224,7 +224,7 @@ def __init__(
224
224
geoname_id : Optional [int ] = None ,
225
225
is_in_european_union : bool = False ,
226
226
iso_code : Optional [str ] = None ,
227
- names : Optional [Dict [str , str ]] = None ,
227
+ names : Optional [dict [str , str ]] = None ,
228
228
** _ ,
229
229
) -> None :
230
230
self .confidence = confidence
@@ -305,7 +305,7 @@ def __init__(
305
305
geoname_id : Optional [int ] = None ,
306
306
is_in_european_union : bool = False ,
307
307
iso_code : Optional [str ] = None ,
308
- names : Optional [Dict [str , str ]] = None ,
308
+ names : Optional [dict [str , str ]] = None ,
309
309
# pylint:disable=redefined-builtin
310
310
type : Optional [str ] = None ,
311
311
** _ ,
@@ -536,7 +536,7 @@ def __init__(
536
536
confidence : Optional [int ] = None ,
537
537
geoname_id : Optional [int ] = None ,
538
538
iso_code : Optional [str ] = None ,
539
- names : Optional [Dict [str , str ]] = None ,
539
+ names : Optional [dict [str , str ]] = None ,
540
540
** _ ,
541
541
) -> None :
542
542
self .confidence = confidence
@@ -558,13 +558,12 @@ class Subdivisions(tuple):
558
558
"""
559
559
560
560
def __new__ (
561
- cls : Type ["Subdivisions" ],
561
+ cls : type ["Subdivisions" ],
562
562
locales : Optional [Sequence [str ]],
563
563
* subdivisions ,
564
564
) -> "Subdivisions" :
565
565
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
568
567
569
568
def __init__ (
570
569
self ,
@@ -925,7 +924,7 @@ def __init__(
925
924
926
925
@property
927
926
def ip_address (self ):
928
- """The IP address for the record"""
927
+ """The IP address for the record. """
929
928
if not isinstance (
930
929
self ._ip_address ,
931
930
(ipaddress .IPv4Address , ipaddress .IPv6Address ),
@@ -935,7 +934,7 @@ def ip_address(self):
935
934
936
935
@property
937
936
def network (self ) -> Optional [Union [ipaddress .IPv4Network , ipaddress .IPv6Network ]]:
938
- """The network for the record"""
937
+ """The network for the record. """
939
938
# This code is duplicated for performance reasons
940
939
network = self ._network
941
940
if network is not None :
0 commit comments