Author nickpapior
Recipients nickpapior, ronaldoussoren
Date 2021-11-24.10:09:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1637748595.88.0.866206563597.issue45889@roundup.psfhosted.org>
In-reply-to
Content
Ok, I see this a feature. :)

As for why it is desirable.

A part of a path is still a path, and matching for something must mean that you are matching a partial path.

Even if you use '*.py' as the pattern this would still make sense as a path:

path = pl.Path("foo/bar")
print(path.match("bar"))
print(path.match(str(pl.Path("bar"))))
print(path.match(str(pl.Path("*"))))

The idea is that *anything* that can match a path _is_ a sub-path by definition, otherwise it can't be matched. So allowing path is just as natural as far as I see it.

As for the above argumentation I think this also holds for Path.glob and Path.rglob where pattern could just as well be a Path.
History
Date User Action Args
2021-11-24 10:09:55nickpapiorsetrecipients: + nickpapior, ronaldoussoren
2021-11-24 10:09:55nickpapiorsetmessageid: <1637748595.88.0.866206563597.issue45889@roundup.psfhosted.org>
2021-11-24 10:09:55nickpapiorlinkissue45889 messages
2021-11-24 10:09:55nickpapiorcreate