Skip to content

Commit

Permalink
Add docstring in object_to_item
Browse files Browse the repository at this point in the history
  • Loading branch information
thomass-dev committed Sep 19, 2024
1 parent 203abac commit bfa71c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/skore/item/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ def object_to_item(object: Any) -> Item:
MediaItem,
):
with suppress(ImportError, TypeError):
# ImportError:
# The factories are responsible to import third-party libraries in a
# lazy way. If library is missing, an ImportError exception will
# automatically be thrown.
# TypeError:
# The factories are responsible for checking that parameters are of the
# correct type. If not, they throw a TypeError exception.
return cls.factory(object)

raise NotImplementedError(f"Type '{object.__class__}' is not supported.")
Expand Down

0 comments on commit bfa71c7

Please # to comment.