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

More dict and Path like api #206

Open
6 tasks
LecrisUT opened this issue Aug 15, 2023 · 0 comments
Open
6 tasks

More dict and Path like api #206

LecrisUT opened this issue Aug 15, 2023 · 0 comments

Comments

@LecrisUT
Copy link

dict api

  • __len__, __iter__, __contains__ Type hints #203
  • keys(), values(), items()
    These ones are a bit weird. I propose that these should only contain the items in data since the others can be obtained from the Path api

Path api

  • __fspath__
    Probably this one only needs to output posix path as a string
  • __truediv__, __rtruediv__, joinpath()
  • glob(), rglob()
  • iterdir(), walk()
    First part should be trivial, but the latter could use some equivalence: Path.walk()

Non-compliant apis:

  • parent (Path api)
    Should always be of type Self. It should return itself if current object is root
  • root (Path api)
    Should always be of type str
  • get(), __getitem__ (dict api)
    • It should not accept an empty name or a list[str]
    • It should return type equivalent to __getitem__

Other apis

  • pop(), setdefault(), __setitem__, etc.
    These are changing the tree structure and should not implemented. If virtual Trees/Path are needed/implemented, these can be added
  • unlink(), rmdir()
    Could be implemented, but there is ambiguity if it's a branch defined in main.fmf file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant