Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup Semaphore repr #501

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion a_sync/primitives/locks/semaphore.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ cdef class Semaphore(_DebugDaemonMixin):
def __repr__(self) -> str:
representation = f"<{self.__class__.__name__} name={self.decode_name()} value={self._Semaphore__value} waiters={len(self)}>"
if self._decorated:
representation = f"{representation[:-1]} decorates={self._decorated}"
detail = next(iter(decorated)) if len(decorated := self._decorated) == 1 else decorated
representation = f"{representation[:-1]} decorates={detail}"
return representation

async def __aenter__(self):
Expand Down
Loading