Skip to content

Warn about unannotated functions containing annotations #4166

Closed
@gvanrossum

Description

@gvanrossum

I found some examples (https://bugs.python.org/issue28936) of functions that have no signature annotations but contain local variable annotations. These are currently ignored. I think we should actually warn whenever an annotation (either a type comment or PEP 526 style) occurs in an unannotated function, since it likely reflects some kind of misunderstanding about annotations.

Or at the very least we should have an option to warn about such things.

(IIRC we recently doused a similar source of confusion, but I can't recall the details.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions