#36903: inspect.signature should use FORWARDREF annotation_format for python 
3.14+
------------------------------+--------------------------------------
     Reporter:  93578237      |                    Owner:  (none)
         Type:  Bug           |                   Status:  new
    Component:  Core (Other)  |                  Version:  6.0
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------
Description changed by 93578237:

Old description:

> On python 3.14 it fails at least here:
> https://github.com/django/django/blob/13299a6203f4bc3e5b2552c96a51ff2b15da3c43/django/contrib/auth/__init__.py#L43
>
> {{{
> import typing as t
>
> from django.contrib.auth.backends import ModelBackend
>

> if t.TYPE_CHECKING:
>     from django.http import HttpRequest
>
>     from testproject.models import User as UserModel
>

> class AuthenticationBackend(ModelBackend):
>     def authenticate(
>         self,
>         request: HttpRequest | None = None,
>         username: str | None = None,
>         password: str | None = None,
>         **kwargs: t.Any,
>     ) -> UserModel | None: ...
> }}}
>
> Maybe a new function `signature` should be added to utils/inspect.py

New description:

 On python 3.14 it fails at least here:
 
https://github.com/django/django/blob/13299a6203f4bc3e5b2552c96a51ff2b15da3c43/django/contrib/auth/__init__.py#L43

 {{{
 import typing as t

 from django.contrib.auth.backends import ModelBackend

 if t.TYPE_CHECKING:
     from django.http import HttpRequest

     from testproject.models import User as UserModel


 class AuthenticationBackend(ModelBackend):
     def authenticate(
         self,
         request: HttpRequest | None = None,
         username: str | None = None,
         password: str | None = None,
         **kwargs: t.Any,
     ) -> UserModel | None: ...
 }}}

 Maybe a new function `signature` should be added to utils/inspect.py

--
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36903#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019c2dd5b20e-e511d111-05cf-4e74-9d77-dbb0c73290f4-000000%40eu-central-1.amazonses.com.

Reply via email to