Skip to content

gh-94220: Replaced name(s) & pat with filename(s) & pattern in fnmatch module as per docs#94261

Closed
n-i-n wants to merge 5 commits intopython:mainfrom
n-i-n:patch-1
Closed

gh-94220: Replaced name(s) & pat with filename(s) & pattern in fnmatch module as per docs#94261
n-i-n wants to merge 5 commits intopython:mainfrom
n-i-n:patch-1

Conversation

@n-i-n
Copy link

@n-i-n n-i-n commented Jun 25, 2022

The parameters used by fnmatch and its sister functions at fnmatch module are different then the one metion at docs.

image

lib/fnmatch.py

def fnmatch(name, pat):
    """Test whether FILENAME matches PATTERN.
    .
    .
    .
    """
    name = os.path.normcase(name)
    pat = os.path.normcase(pat)
    return fnmatchcase(name, pat)

The doc uses filename(s) and pattern as parameters while the source code uses name(s) and pat. Both of them should use the same parameters. I have converted the parameters of all functions in fnmatch module to filename(s) and pattern.
source :

@ghost
Copy link

ghost commented Jun 25, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@erlend-aasland
Copy link
Contributor

Changing the names of the parameters is a breaking change; it is better to align the docs with the implementation. Closing as rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants