diff --git a/pint/facets/plain/quantity.py b/pint/facets/plain/quantity.py index f2b9ae05a..8c7c09406 100644 --- a/pint/facets/plain/quantity.py +++ b/pint/facets/plain/quantity.py @@ -281,9 +281,9 @@ def __bytes__(self) -> bytes: def __repr__(self) -> str: if isinstance(self._magnitude, float): - return f"" + return f"" else: - return f"" + return f"" def __hash__(self) -> int: self_base = self.to_base_units() diff --git a/pint/facets/plain/unit.py b/pint/facets/plain/unit.py index 7340764f4..72c952d82 100644 --- a/pint/facets/plain/unit.py +++ b/pint/facets/plain/unit.py @@ -49,7 +49,7 @@ def __init__(self, units: UnitLike) -> None: self._units = units._units else: raise TypeError( - "units must be of type str, PlainUnit or " + "units must be of type str, Unit or " "UnitsContainer; not {}.".format(type(units)) ) @@ -77,7 +77,7 @@ def __bytes__(self) -> bytes: return str(self).encode(locale.getpreferredencoding()) def __repr__(self) -> str: - return "".format(self._units) + return "".format(self._units) @property def dimensionless(self) -> bool: