Opened 5 hours ago

Last modified 2 hours ago

#36903 assigned Bug

inspect.signature should use FORWARDREF annotation_format for python 3.14+ — at Version 1

Reported by: 93578237 Owned by:
Component: Core (Other) Version: 6.0
Severity: Release blocker Keywords: typing, inspect, deferred annotations
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by 93578237)

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

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

Change History (1)

comment:1 by 93578237, 5 hours ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top