diff --git a/masque/ports.py b/masque/ports.py index 6179f87..b1943a3 100644 --- a/masque/ports.py +++ b/masque/ports.py @@ -1,4 +1,4 @@ -from typing import Iterable, KeysView, ValuesView, overload, Self, Mapping +from typing import Iterable, KeysView, ValuesView, overload, Self, Mapping, NoReturn import warnings import traceback import logging @@ -138,6 +138,9 @@ class PortList(metaclass=ABCMeta): else: return {k: self.ports[k] for k in key} + def __contains__(self, key: str) -> NoReturn: + raise NotImplementedError('PortsList.__contains__ is left unimplemented. Use `key in container.ports` instead.') + # NOTE: Didn't add keys(), items(), values(), __contains__(), etc. # because it's weird on stuff like Pattern that contains other lists # and because you can just grab .ports and use that instead