From fe984b20b980146677a9d3bcbeda7e465e4448b9 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Mon, 22 Apr 2024 14:04:51 +0200 Subject: [PATCH] Update api.py --- src/curies/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/curies/api.py b/src/curies/api.py index 61b795b..cc0acef 100644 --- a/src/curies/api.py +++ b/src/curies/api.py @@ -327,6 +327,10 @@ class Config: __root__: List[Record] + def __iter__(self) -> Iterable[Record]: + """Iterate over records.""" + return cast(Iterable[Record], iter(self.__root__)) + else: # An explanation of RootModels in Pydantic V2 can be found on # https://docs.pydantic.dev/latest/concepts/models/#rootmodel-and-custom-root-types