-
Notifications
You must be signed in to change notification settings - Fork 159
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Original bug report - Pyrefly type inference doesn't work on the raw PyYAML
library
Describe the Bug
When running a type check with pyrefy check test.py
, I expect to see no error, but I get this:
Test script:
import yaml
def test_function() -> str:
return yaml.safe_dump({'key': 'value'})
Pyrefly output:
ERROR Returned type `bytes | str | None` is not assignable to declared return type `str` [bad-return]
--> test.py:5:12
|
5 | return yaml.safe_dump({'key': 'value'})
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
INFO 1 error
Versions used:
- pyrefly: 0.36.2
- pyyaml: 6.0.3
Sandbox Link
(Only applicable for extension issues) IDE Information
No response
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested