Skip to content

More dict and Path like api #206

@LecrisUT

Description

@LecrisUT

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    backlog

    Status

    triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions