diff --git a/pyenumerable/protocol/_enumerable.py b/pyenumerable/protocol/_enumerable.py index 01904db..2e1b17f 100644 --- a/pyenumerable/protocol/_enumerable.py +++ b/pyenumerable/protocol/_enumerable.py @@ -67,3 +67,9 @@ class Enumerable[TSource]( ): @property def source(self) -> tuple[TSource, ...]: ... + + def __str__(self) -> str: + return f"Enumerable(*{self.source})" + + def __repr__(self) -> str: + return f"{self.__class__.__name__}(*{self.source})" diff --git a/readme.md b/readme.md index 7da33cb..dce7875 100644 --- a/readme.md +++ b/readme.md @@ -39,9 +39,9 @@ Implementation of .NET's [IEnumerable](https://learn.microsoft.com/en-us/dotnet/ - [x] Max - [x] remove `Comparable` bind from type variables - [x] Publish on pypi -- [x] Add external wrapper constructor +- [x] Add external constructor wrapper - [x] Add technical documentation pure python implementation -- [ ] Implement `__str__` & `__repr__` for +- [x] Implement `__str__` & `__repr__` for ### v1.1.x - [ ] Improve test code quality - [ ] Add hashed pure python implementation of `Enumerable` (assuming inputs are guaranteed to be `Hashable` & immutable; not preserving order)