-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongtopic-disallow-anyThe disallow-any-* family of flagsThe disallow-any-* family of flags
Description
Bug Report
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.12&flags=disallow-any-decorated&gist=876af123e45fe566785e35c9e0b22821
import contextlib
exit_stack = contextlib.ExitStack()
def enter_context() -> None:
if c:
@exit_stack.callback
def func1() -> None:
pass
c = [1]
enter_context()
When c
is a list, func1 is untyped after decoration
When c
is a bool or int, func1 is typed after decoration
When c
is a list defined before enter_context
, func1 is a typed after decoration
Expected Behavior
func1 is typed after decoration
Actual Behavior
func1 is untyped after decoration
Your Environment
- Mypy version used: 1.17.0
- Mypy command-line flags: disallow-any-decorated
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-disallow-anyThe disallow-any-* family of flagsThe disallow-any-* family of flags