-
Notifications
You must be signed in to change notification settings - Fork 3
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
SPath: Implement more helper methods #10
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LightArrowsEXE
force-pushed
the
master
branch
from
September 4, 2024 21:54
44b82e9
to
b14aab8
Compare
$ python benchmark.py
Total time for 10000 iterations: 0.4242 seconds
Average time per fglob call: 0.000042 seconds
Total time for 10000 simple glob iterations: 0.5244 seconds
Average time per simple glob call: 0.000052 seconds oh ye, we zoomin' now |
```bash $ python benchmark.py Total time for 10000 iterations: 0.4242 seconds Average time per fglob call: 0.000042 seconds Total time for 10000 simple glob iterations: 0.5244 seconds Average time per simple glob call: 0.000052 seconds ```
LightArrowsEXE
force-pushed
the
master
branch
from
September 4, 2024 22:08
5a65e8e
to
5275045
Compare
stgpytools/types/file.py
Outdated
def lglob(self, pattern: str = '*') -> list[SPath]: | ||
"""Glob the path and return the list of paths.""" | ||
|
||
return [SPath(p) for p in self.glob(pattern)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list and map
stgpytools/types/file.py
Outdated
|
||
raise ValueError("Path is neither a file nor a directory") | ||
|
||
def backup(self, dst: SPath | None = None) -> SPath: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the use for this? and why not copy_dir?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement some more methods that I would have uses for, and others may too.