Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnyClassMethod type annotation #5311

Closed
5 of 15 tasks
mehdigmira opened this issue Mar 30, 2023 · 2 comments
Closed
5 of 15 tasks

AnyClassMethod type annotation #5311

mehdigmira opened this issue Mar 30, 2023 · 2 comments
Assignees
Labels
bug V1 Bug related to Pydantic V1.X unconfirmed Bug not yet confirmed as valid/applicable

Comments

@mehdigmira
Copy link

mehdigmira commented Mar 30, 2023

Initial Checks

  • I have searched GitHub for a duplicate issue and I'm sure this is something new
  • I have searched Google & StackOverflow for a solution and couldn't find anything
  • I have read and followed the docs and still think this is a bug
  • I am confident that the issue is with pydantic (not my code, or another library in the ecosystem like FastAPI or mypy)

Description

Hello, current type annotation for AnyClassMethod is classmethod[Any] while the definition in typeshed has changed
as you can see in https://github.com/python/typeshed/blob/main/stdlib/builtins.pyi#L131
This change has been introduced in typeshed a couple of weeks ago https://github.com/python/typeshed/pull/9771/files

Would it be possible to fix the type annotations in pydantic accordingly ?

This impact pyright, as it starts reporting "partially unknown" types (which it is right about)

Example Code

No response

Python, Pydantic & OS Version

pydantic version: 1.10.2
            pydantic compiled: False
                 install path: /home/vscode/.local/lib/python3.11/site-packages/pydantic
               python version: 3.11.2 (main, Feb  9 2023, 20:14:21) [GCC 10.2.1 20210110]
                     platform: Linux-5.15.49-linuxkit-aarch64-with-glibc2.31
     optional deps. installed: ['dotenv', 'typing-extensions']

Affected Components

@mehdigmira mehdigmira added bug V1 Bug related to Pydantic V1.X unconfirmed Bug not yet confirmed as valid/applicable labels Mar 30, 2023
@ITProKyle
Copy link

Still relevant for pydantic==1.10.7. We are unable to use the last few releases of pyright until this is resolved.

@Kludex
Copy link
Member

Kludex commented Aug 25, 2023

@Kludex Kludex closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V1 Bug related to Pydantic V1.X unconfirmed Bug not yet confirmed as valid/applicable
Projects
None yet
Development

No branches or pull requests

4 participants