No description
Find a file
Ethan Dalool b288cca519
Rewrite a lot of pathclass, spinal.walk using tuple-based Path.
I was inspired by the idea of "making impossible states impossible"
and using a data model that accurately represents what we intend for
it to represent. Instead of storing the path as a string where "it's
a string but actually you're supposed to know that the parts between
os.seps are different parts and the first one is special and...", we
can use a data model that directly says that. Storing the path as a
tuple of (Drive, Part, Part) helps me focus on the semantics of the
Path as a collection of parts joined by the os.sep.

Furthermore, storing the path as a string made some operations slow.
Every time we call one of the os.path functions with a string, it
has to do a lot of normalization and edge-case handling even when we
know it wouldn't be needed. By storing the path as a tuple, we can
instantly get the drive name, parent dir name, and basename without
asking os.path to split it for us every single time. It also makes
relative path / common ancestor checks a lot easier to understand.
Fewer operations need to go into the slow functions.
2021-11-30 21:16:47 -08:00
voussoirkit Rewrite a lot of pathclass, spinal.walk using tuple-based Path. 2021-11-30 21:16:47 -08:00
CONTACT.md Update CONTACT.md with link to voussoir.net. 2021-04-04 17:11:21 -07:00
LICENSE.txt Update license, contact, donate for many projects. 2021-01-14 02:47:38 -08:00
pypi_upload.bat Update pypi upload script to use twine. 2019-08-05 17:35:53 -07:00
README.md Add Mirrors header. 2020-12-23 19:54:45 -08:00
setup.py Bump to version 0.0.70. 2021-11-08 23:37:24 -08:00
voussoirkit_logo.svg Add voussoirkit_logo.svg. 2020-01-18 22:40:48 -08:00

voussoirkit

This is a collection of tools that I use often and import into my other projects.

Install

pip install voussoirkit

Mirrors

https://github.com/voussoir/voussoirkit

https://gitlab.com/voussoir/voussoirkit

https://codeberg.org/voussoir/voussoirkit