11from abc import ABC , abstractmethod
22from collections import abc
3- from typing import Any , Dict , List , Mapping , Optional , Type , TypeVar
3+ from typing import Any , Mapping , Type , TypeVar
44
55from deepmerge import Merger
66
@@ -97,7 +97,7 @@ def merge_values(destination: Mapping[str, Any], source: Mapping[str, Any]) -> N
9797
9898class ConfigurationSource (ABC ):
9999 @abstractmethod
100- def get_values (self ) -> Dict [str , Any ]:
100+ def get_values (self ) -> dict [str , Any ]:
101101 """Returns the values read from this source."""
102102
103103 def __repr__ (self ) -> str :
@@ -112,7 +112,7 @@ def __init__(self, values: Mapping[str, Any]) -> None:
112112 super ().__init__ ()
113113 self ._values = dict (values .items ())
114114
115- def get_values (self ) -> Dict [str , Any ]:
115+ def get_values (self ) -> dict [str , Any ]:
116116 return self ._values
117117
118118
@@ -136,11 +136,11 @@ def __new__(cls, arg=None):
136136 return [cls (item ) for item in arg ]
137137 return arg
138138
139- def __init__ (self , mapping : Optional [ Mapping [str , Any ]] = None ):
139+ def __init__ (self , mapping : Mapping [str , Any ] | None = None ):
140140 """
141141 Creates a new instance of Configuration object with the given values.
142142 """
143- self ._data : Dict [str , Any ] = dict (mapping .items ()) if mapping else {}
143+ self ._data : dict [str , Any ] = dict (mapping .items ()) if mapping else {}
144144
145145 def __contains__ (self , item : str ) -> bool :
146146 return item in self ._data
@@ -166,7 +166,7 @@ def __repr__(self) -> str:
166166 return f"<Configuration { repr (hidden_values )} >"
167167
168168 @property
169- def values (self ) -> Dict [str , Any ]:
169+ def values (self ) -> dict [str , Any ]:
170170 """
171171 Returns a copy of the dictionary of current settings.
172172 """
@@ -190,13 +190,13 @@ def __init__(self, *sources: ConfigurationSource) -> None:
190190 object from different sources. Sources are applied in the given order and can
191191 override each other's settings.
192192 """
193- self ._sources : List [ConfigurationSource ] = list (sources ) if sources else []
193+ self ._sources : list [ConfigurationSource ] = list (sources ) if sources else []
194194
195195 def __repr__ (self ) -> str :
196196 return f"<ConfigurationBuilder { self ._sources } >"
197197
198198 @property
199- def sources (self ) -> List [ConfigurationSource ]:
199+ def sources (self ) -> list [ConfigurationSource ]:
200200 return self ._sources
201201
202202 def add_source (self , source : ConfigurationSource ):
0 commit comments