Use the un-underscored name if no alias attribute is there.#416
Merged
Tinche merged 2 commits intopython-attrs:mainfrom Sep 23, 2023
Merged
Use the un-underscored name if no alias attribute is there.#416Tinche merged 2 commits intopython-attrs:mainfrom
Tinche merged 2 commits intopython-attrs:mainfrom
Conversation
Member
|
Ah, cool. Can you add a changelog note? And a simple test would be great so it doesn't happen again. |
Contributor
Author
|
Actually -- given that |
Member
|
Howdy, any progress on this? Trying to plan the next release. |
Contributor
Author
|
Whoops, sorry - forgot about this PR, working on an updated version now! |
This modern version of `attrs` provides the `alias` attribute on fields that contains the name we should use here. Also add a test to verify that structuring and unstructuring aliased attributes (which can be triggered by prefixing an attribute with an underscore) works as expected.
Tinche
requested changes
Sep 3, 2023
tests/test_converter.py
Outdated
| A class with an aliased attribute can be unstructured and structured. | ||
| """ | ||
|
|
||
| converter = Converter() |
Member
There was a problem hiding this comment.
I think you should be testing this with a BaseConverter to hit the changed code path, the Converter uses different machinery.
Member
|
Just a small note, I'll be away for the next 3 weeks on a family trip and I can continue reviewing this after I'm back! |
Member
|
I want to get the next release out so I fixed this myself. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This appears to be caused by a thinko in #391, this fixes it again.