diff --git a/pint/facets/plain/registry.py b/pint/facets/plain/registry.py index 277a6f7a2..9cd8bae01 100644 --- a/pint/facets/plain/registry.py +++ b/pint/facets/plain/registry.py @@ -366,11 +366,11 @@ def __getattr__(self, item: str) -> QuantityT: # self.Unit will call parse_units return self.Unit(item) + @deprecated( + "Calling the getitem method from a UnitRegistry will be removed in future versions of pint.\n" + "use `parse_expression` method or use the registry as a callable." + ) def __getitem__(self, item: str) -> UnitT: - logger.warning( - "Calling the getitem method from a UnitRegistry is deprecated. " - "use `parse_expression` method or use the registry as a callable." - ) return self.parse_expression(item) def __contains__(self, item: str) -> bool: