Change locking boundaries for shared dict. Add a unit test.
[python_utils.git] / conversion_utils.py
index 43268400021443344809b59dd8ced0fb91b9de18..684edc0a9116aa827db2c7c83a52de10dbbba73b 100644 (file)
@@ -86,9 +86,7 @@ conversion_catalog = {
         lambda c: c * 1.8 + 32.0,
         "°F",
     ),
-    "Celsius": Converter(
-        "Celsius", "temperature", lambda c: c, lambda c: c, "°C"
-    ),
+    "Celsius": Converter("Celsius", "temperature", lambda c: c, lambda c: c, "°C"),
     "Kelvin": Converter(
         "Kelvin",
         "temperature",
@@ -109,9 +107,7 @@ def convert(magnitude: Number, from_thing: str, to_thing: str) -> float:
     return _convert(magnitude, src, dst)
 
 
-def _convert(
-    magnitude: Number, from_unit: Converter, to_unit: Converter
-) -> float:
+def _convert(magnitude: Number, from_unit: Converter, to_unit: Converter) -> float:
     canonical = from_unit.to_canonical(magnitude)
     converted = to_unit.from_canonical(canonical)
     return float(converted)