Running the following code snippet in a fresh Python 3.10 venv with trieste installed via pip:
from trieste.models.interfaces import ProbabilisticModel
from typing import Protocol
class SomeProbabilisticModel(ProbabilisticModel, Protocol): pass
assert not isinstance(1, ProbabilisticModel)
results in the following error:
TypeError: Protocols with non-method members don't support issubclass()
Removing the SomeProbabilisticModel definition on line 3 fixes the issue, as does moving the definition into trieste itself. It also seems to be fixed with Python 3.12.
It would be nice to figure out what is causing this, as it prevents us from reliably being able to use isinstance checks.
Running the following code snippet in a fresh Python 3.10 venv with trieste installed via pip:
results in the following error:
Removing the SomeProbabilisticModel definition on line 3 fixes the issue, as does moving the definition into trieste itself. It also seems to be fixed with Python 3.12.
It would be nice to figure out what is causing this, as it prevents us from reliably being able to use isinstance checks.