From 707076ca63916181e2bfa94e5fb5a30d1d862324 Mon Sep 17 00:00:00 2001 From: AmirHossein Ahmadi Date: Sat, 29 Mar 2025 16:34:41 +0330 Subject: [PATCH 1/2] update readme --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) From 96ca9b6851c9f1efe4225fb5ec7474f15332b73e Mon Sep 17 00:00:00 2001 From: AmirHossein Ahmadi Date: Sat, 29 Mar 2025 16:43:26 +0330 Subject: [PATCH 2/2] add str and repr method to base protocol of enumerable --- pyenumerable/protocol/_enumerable.py | 6 ++++++ 1 file changed, 6 insertions(+) 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})"