GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-72904: Simplify implementation of `fnmatch.translate()` by barneygale · Pull Request #109879 · python/cpython

Conversation

@barneygale

@barneygale barneygale commented Sep 26, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Use re to scan shell-style patterns, rather than parsing them by hand in a fat loop. This makes the code twice as slow (!) but arguably more obvious

  • Issue: '*' matches entire path in fnmatch #72904

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@barneygale
pythonGH-72904: Simplify implementation of fnmatch.translate()
83accca
Use `re.Scanner` to scan shell-style patterns, rather than parsing them
by hand in a fat loop. This makes the code slower (!) but more obvious, and
lays some groundwork for a future `glob.translate()` function.
@bedevere-app bedevere-app Bot mentioned this pull request Sep 26, 2023
'*' matches entire path in fnmatch #72904
Closed
@barneygale barneygale added the skip news label Sep 26, 2023
@barneygale
barneygale marked this pull request as ready for review September 26, 2023 02:22
@bedevere-app bedevere-app Bot added the awaiting review label Sep 26, 2023
@barneygale
barneygale requested a review from jaraco September 26, 2023 02:22
@barneygale
Drop use of undocumented re.Scanner
110cf46
@barneygale barneygale mentioned this pull request Sep 26, 2023
GH-72904: Add glob.translate() function #106703
Merged
@AA-Turner

AA-Turner commented Sep 27, 2023

Copy link
Copy Markdown
Member

twice as slow (!)

What are the benchmarks for this? (i.e. are we talking 10μs to 20μs or 250ms to 500ms?) The regression in performance here may not matter if the translation is a sufficiently small part of any reasonable usecase.

@serhiy-storchaka has been working on re performance lately and may have tips?

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@barneygale

barneygale commented Oct 29, 2023

Copy link
Copy Markdown
Contributor Author

Withdrawing this PR - the performance isn't good enough.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@barneygale barneygale closed this Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jaraco jaraco Awaiting requested review from jaraco

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@barneygale @AA-Turner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.