Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyYAML: correct return type of construct_scalar() #12664

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

stevenlele
Copy link
Contributor

@stevenlele stevenlele commented Sep 15, 2024

This error was introduced in #4796.

You can verify that bool, int and others are constructed via the SafeConstructor.construct_yaml_*() methods and they all call self.construct_scalar(node) to get a string value. construct_scalar() just returns the node's value, which is a str.

This is found when adding stubs for ruamel.yaml in #12584. That PR is ready for review now. Please take a look at that too.

This PR only fixed this issue. I might port the detailed stubs to PyYAML after the ones for ruamel.yaml gets added.

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 2ccd254 into python:main Sep 16, 2024
48 checks passed
@stevenlele stevenlele deleted the pyyaml branch September 16, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants