cpython icon indicating copy to clipboard operation
cpython copied to clipboard

improve fnmatch.fnmatch documentation

Open gordcodes opened this issue 1 year ago • 1 comments

Documentation

In the documentation for fnmatch. https://docs.python.org/3/library/fnmatch.html

It says that "Both parameters are case-normalized using os.path.normcase()".

This implies that the strings are always case normalized but if you dive into the description of os.path.normcase, it's actually OS dependent. Windows is case insensitive while non Windows is case sensitive.

So I would like the documentation clarified with something basic like " Both parameters are case-normalized using os.path.normcase(), which behaves differently based on OS."

gordcodes avatar Oct 22 '24 17:10 gordcodes

It says that they are case-normalized using os.path.normcase and the docs of the latter says:

Normalize the case of a pathname. On Windows, convert all characters in the pathname to lowercase, and also convert forward slashes to backward slashes. On other operating systems, return the path unchanged.

I don't think we'll need to restate it (in case of confusion, clicking on the link should be sufficient actually). cc @barneygale

picnixz avatar Oct 23 '24 15:10 picnixz

Let's go ahead and close this issue @picnixz.

Thanks for the suggestion @gordcodes. I've reviewed the text and I think the link to os.path.normcase provides the most accurate information of the behavior

willingc avatar Oct 31 '24 01:10 willingc

@gordcodes Thank you for your suggestion but we'll be closing this as wont fix as per Carol's suggestion.

picnixz avatar Oct 31 '24 09:10 picnixz