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

Add __repr__ to FS classes #323

Merged
merged 2 commits into from
Aug 31, 2023
Merged

Add __repr__ to FS classes #323

merged 2 commits into from
Aug 31, 2023

Conversation

niboshi
Copy link
Member

@niboshi niboshi commented Aug 24, 2023

It would be convenient if some information was included in repr.

<pfio.v2.local.Local object at 0x7f6b09c7d120>

pfio.v2.local.Local(cwd='/')

Copy link
Member

@kuenishi kuenishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, that's wonderful suggestion and this is what I really wanted. I want to merge it so hard but also I want to keep the code under the principle of "no util" to prevent it being source of mess in the near future. c.f. https://mykeels.medium.com/utils-are-a-blackhole-c8320968325b
https://dev.to/dvddpl/utils-files-are-not-so-useful-and-helper-classes-are-not-so-helpful-1kfn

from typing import Any, Dict, Type


def format_repr(cls: Type, data: Dict[str, Any]) -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want this function included in the tail of fs.py to obey the no-util principle.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the commend. Fixed: 3146828

@kuenishi kuenishi added this to the 2.7.0 milestone Aug 30, 2023
@kuenishi kuenishi added the cat:enhancement Implementation that does not break interfaces. label Aug 30, 2023
Copy link
Member

@kuenishi kuenishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kuenishi kuenishi merged commit c846b57 into master Aug 31, 2023
8 checks passed
@kuenishi kuenishi deleted the fs-repr branch August 31, 2023 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:enhancement Implementation that does not break interfaces.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants