Skip to content

Enable mypy's disallow_untyped_decorators #131429

@aorenste

Description

@aorenste

🐛 Describe the bug

We should enable mypy's disallow_untyped_decorators mode. Untyped decorators strip the types from their decorated functions.

Notes re: fixup PRs

In the PRs to remove the "# mypy: allow-untyped-decorators" I focused more on making sure the decorators had proper type annotations. This caused a bunch of "fallout" since now decorated functions were typed - so callers which pass bad types will now have type errors. Mostly I just marked the newly offending lines as "type: ignore".

Enable:
#131428

Fixups:
#131590
#131589
#131588
#131587
#131586
#131585
#131584
#131583
#131582
#131581
#131580
#131579
#131578
#131577
#131576
#131575
#131574
#131573
#131572
#131571
#131570
#131569
#131568
#131567
#131566
#131565
#131564

Versions

main

cc @ezyang @malfet @xuzhao9 @gramster

Metadata

Metadata

Assignees

Labels

better-engineeringRelatively self-contained tasks for better engineering contributorsmodule: typingRelated to mypy type annotationstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions