-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml] Dump stringable objects #57528
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
Conversation
Test failure appears to be from |
Can you please add a test case? thanks |
I am not really convinced about adding this as it would mean that we would dump something that couldn't be parsed back into the object that we had before. |
I share @xabbuh's concern. This PR makes the assumption that the string representation of an object is meant for serialization which is not necessarily the case. |
How about putting this behind an option flag as with other similar dumping alternatives? |
An option flag might work, WDYT @xabbuh? |
I am still not convinced that supporting to dump something that cannot be parsed back into the initial structure is a good idea. But in any case making this an opt-in feature would be a must-have. |
Closing as 2 core team members expressed valid concerns about this PR. |
The YAML dumper should be able to respond to an object being
Stringable
and dump accordingly.