Describe Path parameters in docstring.

master
voussoir 2021-08-09 16:27:33 -07:00
parent 81782383a9
commit 63251b979b
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 19 additions and 4 deletions

View File

@ -82,10 +82,25 @@ class Extension:
return '.' + self.ext
class Path:
def __init__(
self,
path,
force_sep=None,
*,
_case_correct=False,
):
'''
I started to use pathlib.Path, but it was too much of a pain.
force_sep:
Normally, the pathclass will use the default separator for your
operating system: / on unix and \ on windows. You can use this
argument to force a particular separator.
_case_correct:
True or False. If True, this indicates that the path casing is
known in advance to be correct, which means calls to correct_case
can be skipped. This is helpful because correct_case can be a
source of slowdown.
'''
def __init__(self, path, force_sep=None, *, _case_correct=False):
self.force_sep = force_sep
self.sep = force_sep or os.sep