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 — Fix SQLite Aggregation Protocols by max-muoto · Pull Request #12192 · python/typeshed

Conversation

@max-muoto

@max-muoto max-muoto commented Jun 23, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Fix issues detailed in #12141.

Sorry, something went wrong.

Uh oh!

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

All reactions
@max-muoto
feat: Improve/fix sqlite aggregration protocols
335e5ef
@max-muoto max-muoto changed the title feat: Improve/fix sqlite aggregration protocols Fix SQLite Aggregation Protocols Jun 23, 2024
@max-muoto
Remove default
c76c643
@github-actions

This comment has been minimized.

Sign in to view
@max-muoto
Merge branch 'main' into improve-sqllite-agg-types
d417ee5
@max-muoto
max-muoto marked this pull request as ready for review June 23, 2024 19:34
@max-muoto
Add default back
694f7b4
@github-actions

This comment has been minimized.

Sign in to view
@max-muoto
max-muoto marked this pull request as draft June 23, 2024 20:04
max-muoto and others added 2 commits June 23, 2024 16:02
@max-muoto
Add test
6b9e3a1
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
d52702a
max-muoto
max-muoto commented Jun 23, 2024
View reviewed changes
Comment thread stdlib/sqlite3/dbapi2.pyi
def finalize(self) -> _SQLType: ...

class _WindowAggregateClass(Protocol):
step: Callable[..., object]

@max-muoto max-muoto Jun 23, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From testing things out, it doesn't seem this protocol really works as intended in either MyPy or Pyright. Unless you actually were annotating a lambda perhaps. Due to this, I went ahead and removed it.

Some examples of how it might not work as you would expect:

Pyright Playground

MyPy Playground

Sorry, something went wrong.

Uh oh!

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

All reactions

@srittau srittau Jun 24, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been part of the initial commit in #7625, while the other protocols already used a function. Maybe @JelleZijlstra remembers why we used an attribute instead of a function here?

Sorry, something went wrong.

Uh oh!

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

All reactions

@JelleZijlstra JelleZijlstra Jun 24, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really remember what I was thinking when I wrote that code, but the annotations proposed in this PR mean that protocol implementations must take *args. I am not familiar with how these things are used, but I'd expect concrete implementations to only accept a fixed number of parameters. Maybe that's why I chose to use Callable[....

Sorry, something went wrong.

Uh oh!

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

All reactions

@max-muoto max-muoto Jun 24, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried messing around with TypeVarTuples to do that, but had some issues there as well, there might not be a great way, but I'll see if I can figure something out.

Sorry, something went wrong.

Uh oh!

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

All reactions
@github-actions

This comment has been minimized.

Sign in to view
max-muoto and others added 7 commits June 23, 2024 16:12
@max-muoto
Fix test
5377741
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
6169219
@max-muoto
Finalize tests
58fc21a
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
4e5b605
@max-muoto
Tweak
7f41490
@max-muoto
Fix tests
c1ca821
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
8bea1e0
@github-actions

github-actions Bot commented Jun 23, 2024

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

All reactions

Sorry, something went wrong.

Uh oh!

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

@max-muoto max-muoto closed this Sep 8, 2024
@alex

alex commented Aug 17, 2025

Copy link
Copy Markdown
Member

Is there a reason this was closed?

All reactions

Sorry, something went wrong.

Uh oh!

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

@max-muoto max-muoto mentioned this pull request Dec 30, 2025
Improve sqlite Aggregration Protocols #15188
Draft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@srittau srittau srittau left review comments
@JelleZijlstra JelleZijlstra JelleZijlstra left review comments

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

4 participants

@max-muoto @alex @srittau @JelleZijlstra
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.