@@ -259,23 +259,23 @@ class TypeHintedDict(RegexpDict):
259259 Attributes:
260260 _typehints (dict):
261261 The backing store for the type hint information
262- __regexGetType (re):
262+ _regex_get_type (re):
263263 Used to extract the type hint from a string
264- __regexSignedInt (re):
264+ _regex_signed_int (re):
265265 matches type hint strings for signed integers
266- __regexUnsignedInt (re):
266+ _regex_unsigned_int (re):
267267 matches the type hint string for unsigned integers
268- __regexFloat (re):
268+ _regex_float (re):
269269 matches the type hint strings for floats
270- __regexBoolean (re):
270+ _regex_boolean (re):
271271 matches the type hint string for a boolean
272- __regexStrng (re):
272+ _regex_strng (re):
273273 matches the type hint string for a string variable
274- __regexEvaluatable (re):
274+ _regex_evaluatable (re):
275275 matches the type hint string for a compoind data type
276- __types (dict):
276+ _types (dict):
277277 mapping of type hinted types to actual Python types
278- __tests (dict):
278+ _tests (dict):
279279 mapping of the regex patterns to actual python types
280280
281281 Notes:
@@ -287,20 +287,20 @@ class TypeHintedDict(RegexpDict):
287287 allowed_keys : Tuple = string_types
288288 # Force metadata keys to be strings
289289
290- __regexGetType : RegExp = re .compile (r"([^\{]*)\{([^\}]*)\}" )
290+ _regex_get_type : RegExp = re .compile (r"([^\{]*)\{([^\}]*)\}" )
291291 # Match the contents of the inner most{}
292- __regexSignedInt : RegExp = re .compile (r"^I\d+" )
292+ _regex_signed_int : RegExp = re .compile (r"^I\d+" )
293293 # Matches all signed integers
294294 __regexUnsignedInt : RegExp = re .compile (r"^U / d+" )
295295 # Match unsigned integers
296- __regexFloat : RegExp = re .compile (r"^(Extended|Double|Single)\sFloat" )
296+ _regex_float : RegExp = re .compile (r"^(Extended|Double|Single)\sFloat" )
297297 # Match floating point types
298- __regexBoolean : RegExp = re .compile (r"^Boolean" )
298+ _regex_boolean : RegExp = re .compile (r"^Boolean" )
299299 __regexString = re .compile (r"^(String|Path|Enum)" )
300300 __regexTimestamp : RegExp = re .compile (r"Timestamp" )
301- __regexEvaluatable : RegExp = re .compile (r"^(Cluster||\d+D Array|List)" )
301+ _regex_evaluatable : RegExp = re .compile (r"^(Cluster||\d+D Array|List)" )
302302
303- __types : Dict [str , Type ] = dict (
303+ _types : Dict [str , Type ] = dict (
304304 [ # Key order does matter here!
305305 ("Boolean" , bool ),
306306 ("I32" , int ),
@@ -313,17 +313,17 @@ class TypeHintedDict(RegexpDict):
313313 ("String" , str ),
314314 ]
315315 )
316- # This is the inverse of the __tests below - this gives
316+ # This is the inverse of the _tests below - this gives
317317 # the string type for standard Python classes
318318
319- __tests : List [Tuple ] = [
320- (__regexSignedInt , int ),
319+ _tests : List [Tuple ] = [
320+ (_regex_signed_int , int ),
321321 (__regexUnsignedInt , int ),
322- (__regexFloat , float ),
323- (__regexBoolean , bool ),
322+ (_regex_float , float ),
323+ (_regex_boolean , bool ),
324324 (__regexTimestamp , datetime .datetime ),
325325 (__regexString , str ),
326- (__regexEvaluatable , _evaluatable ()),
326+ (_regex_evaluatable , _evaluatable ()),
327327 ]
328328
329329 # This is used to work out the correct python class for
@@ -374,7 +374,7 @@ def findtype(self, value: Any) -> str:
374374 typ = "Invalid Type"
375375 if value is None :
376376 return "Void"
377- for t , val in self .__types .items ():
377+ for t , val in self ._types .items ():
378378 if isinstance (value , val ):
379379 if t in ["Cluster" , "AnonCluster" ]:
380380 elements = []
@@ -415,7 +415,7 @@ def __mungevalue(self, typ: str, value: Any) -> Any:
415415 """
416416 if typ == "Invalid Type" : # Short circuit here
417417 return repr (value )
418- for regexp , valuetype in self .__tests :
418+ for regexp , valuetype in self ._tests :
419419 if regexp .search (typ ) is None :
420420 continue
421421 if isinstance (valuetype , _evaluatable ):
@@ -455,7 +455,7 @@ def _get_name_(self, name: Union[str, RegExp]) -> Tuple[str, Optional[str]]:
455455 the type hint string),
456456 """
457457 search = str (name )
458- m = self .__regexGetType .search (search )
458+ m = self ._regex_get_type .search (search )
459459 if m is not None :
460460 return m .group (1 ), m .group (2 )
461461 if not isinstance (name , string_types + int_types ):
0 commit comments