-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
If an inner typed function which returns something other than None is nested within an untyped function then an error is generated about returning Any from the inner function.
To Reproduce
Expected Behavior
bug.py:7: note: Revealed type is "pathlib.Path"
bug.py:15: note: Revealed type is "pathlib.Path"
bug.py:26: note: Revealed type is "pathlib.Path"
Success: no issues found in 1 source file
Actual Behavior
main.py:7: note: Revealed type is "pathlib.Path"
main.py:15: note: Revealed type is "pathlib.Path"
main.py:26: note: Revealed type is "Any"
main.py:27: error: Returning Any from function declared to return "str" [no-any-return]
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used:1.19.1
- Mypy command-line flags: --warn-return-any
- Mypy configuration options from
mypy.ini(and other config files): none - Python version used: 3.13
wyattscarpenter
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong