Skip to content

Commit

Permalink
Update pint_array.py
Browse files Browse the repository at this point in the history
Make type hints compatible with python-3.9 (which requires `Union` and does not support the `|` operator to express type disjunction).

Signed-off-by: Michael Tiemann <[email protected]>
  • Loading branch information
MichaelTiemannOSC committed Jan 14, 2024
1 parent 979fb8f commit 442336d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pint_pandas/pint_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re
import warnings
from importlib.metadata import version
from typing import Any, Callable, Dict, Optional, cast
from typing import Any, Callable, Dict, Optional, Union, cast

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -622,7 +622,7 @@ def unique(self):
data = self._data
return self._from_sequence(unique(data), dtype=self.dtype)

def __contains__(self, item) -> bool | np.bool_:
def __contains__(self, item) -> Union[bool, np.bool_]:
if not isinstance(item, _Quantity):
return False
elif pd.isna(item.magnitude):
Expand Down

0 comments on commit 442336d

Please sign in to comment.