[Python-ideas] Updated PEP 428 (pathlib)
Charles-François Natali
cf.natali at gmail.com
Sun Mar 3 09:46:16 CET 2013
> Hello,
Hi,
> I've updated PEP 428 following the previous discussion.
I really look forward to PEP 428 acceptance :-)
Just a couple remarks:
>>> p = PureNTPath('c:/Downloads/pathlib.tar.gz')
>>> p.name
'pathlib.tar.gz'
>>> p.basename
'pathlib.tar'
>>> p.suffix
'.gz'
I find the 'p.basename' name confusing: following POSIX conventions,
'basename' should be 'pathlib.tar.gz'. I don't have another 'name' to
propose for the stripped name, though.
> match() matches the path against a glob pattern:
I think it could be interesting to add an optional argument to
mitigate glob-based DoS. Whether this should be made default is left
as an exercise to the reader :-)
cf
More information about the Python-ideas
mailing list