[Python] error: "get" is not a known attribute of "None" (reportOptionalMemberAccess)

Discussão em 'Python' iniciado por Stack, Agosto 27, 2025.

  1. Stack

    Stack Membro Participativo

    I use PyRight to check my Django code. It complains about that


    class FooForm(ModelForm):

    def clean(self):
    cleaned_data = super().clean()
    start = cleaned_data.get("start_date") # <------- here


    error: "get" is not a known attribute of "None" (reportOptionalMemberAccess)
    ​

    I installed django-stubs.

    How to make PyRight aware that cleaned_data is a dictionary?

    Or is something wrong with my setup?

    Continue reading...

Compartilhe esta Página