barneygale / pathlib-abc

Python base classes for rich path objects
Other
23 stars 1 forks source link

`PurePathBase` shouldn't cache drive/root/tail/string #10

Closed barneygale closed 6 months ago

barneygale commented 7 months ago

PurePathBase has a few slots and methods that facilitate fast path object generation:

These features are useful in PurePath, where speed is important, but much less so in PurePathBase, where the clarity of the interfaces and interactions should win out.

It should be possible to move them to PurePath, leaving PurePathBase with only _raw_paths and _resolving slots.

barneygale commented 7 months ago

This might also make it possible to implement PathBase.resolve() without spinning up loads of path objects.

barneygale commented 7 months ago

Upstream issue: https://github.com/python/cpython/issues/113528