You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
The concept of a file-like path between nodes is often useful. Internally I have an abstraction for this, the NodePath class, but publicly we currently only ever accept and return string paths.
NodePath is a powerful class because it inherits directly from pathlib.PurePosixPath, so it automatically has a .relative_to method, a .parts property, a .root, supports joining paths via the / operator, and is coercible into a string.
We could make NodePath public, and return it from node.path instead of a string as we currently do. This would be a breaking change, but would be nice for users for some tree manipulations, e.g. joining paths. They could still get to the string very easily via node.path.str.
What do we think about this? If we're going to change it we should change it sooner rather than later.
The text was updated successfully, but these errors were encountered:
The concept of a file-like path between nodes is often useful. Internally I have an abstraction for this, the
NodePath
class, but publicly we currently only ever accept and return string paths.NodePath
is a powerful class because it inherits directly frompathlib.PurePosixPath
, so it automatically has a.relative_to
method, a.parts
property, a.root
, supports joining paths via the/
operator, and is coercible into a string.We could make
NodePath
public, and return it fromnode.path
instead of a string as we currently do. This would be a breaking change, but would be nice for users for some tree manipulations, e.g. joining paths. They could still get to the string very easily vianode.path.str
.What do we think about this? If we're going to change it we should change it sooner rather than later.
The text was updated successfully, but these errors were encountered: