Skip to content

[peewee] Model.select() type contains the model being selected#15958

Open
Psycojoker wants to merge 1 commit into
python:mainfrom
Psycojoker:peewee-Model-select-type-contains-the-model-being-selected
Open

[peewee] Model.select() type contains the model being selected#15958
Psycojoker wants to merge 1 commit into
python:mainfrom
Psycojoker:peewee-Model-select-type-contains-the-model-being-selected

Conversation

@Psycojoker

Copy link
Copy Markdown
Contributor

Hello,

In this kind of code:

class MyModel(Model):
    ...

value = Model.select()

This change the type returned by Model.select() from ModelSelect to ModelSelect[MyModel].

I'm not 100% confident about this modification (on if it's the right way to do it) so don't hesitate if you have feedback.

Kind regards,

@Psycojoker Psycojoker force-pushed the peewee-Model-select-type-contains-the-model-being-selected branch from d5322b2 to 8c3fcf9 Compare June 27, 2026 18:31
@github-actions

This comment has been minimized.

@Psycojoker Psycojoker marked this pull request as draft June 27, 2026 18:56
@Psycojoker Psycojoker force-pushed the peewee-Model-select-type-contains-the-model-being-selected branch from 56ac553 to d11e16f Compare June 27, 2026 19:17
@github-actions

This comment has been minimized.

@Psycojoker Psycojoker force-pushed the peewee-Model-select-type-contains-the-model-being-selected branch from d11e16f to bc71e0c Compare June 27, 2026 19:25
@github-actions

This comment has been minimized.

@Psycojoker Psycojoker marked this pull request as ready for review June 27, 2026 20:55
[pre-commit.ci] auto fixes from pre-commit.com hooks
@Psycojoker Psycojoker force-pushed the peewee-Model-select-type-contains-the-model-being-selected branch from 8094c77 to 71f49bf Compare June 27, 2026 20:57
@github-actions

Copy link
Copy Markdown
Contributor

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant