Avoid user assigning unimplemented fields on containers.#102
Merged
raphaelm merged 1 commit intopretix:masterfrom Nov 27, 2025
Merged
Conversation
JulienPalard
added a commit
to JulienPalard/python-drafthorse
that referenced
this pull request
Nov 21, 2025
JulienPalard
added a commit
to JulienPalard/python-drafthorse
that referenced
this pull request
Nov 21, 2025
Before:
doc.trade.settlement.payment_means.type_code = "30"
was allowed but had no effect as payemnt_means is a container.
Now it gives:
Traceback (most recent call last):
File "/home/mdk/src/python-drafthorse/test.py", line 54, in <module>
doc.trade.settlement.payment_means.type_code = "30" # Virement
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Container' object has no attribute 'type_code' and no __dict__ for setting new attributes
1cb0579 to
4c04eae
Compare
JulienPalard
added a commit
to JulienPalard/python-drafthorse
that referenced
this pull request
Nov 21, 2025
Contributor
|
@raphaelm |
hartwork
added a commit
to hartwork/python-drafthorse-fork
that referenced
this pull request
Nov 27, 2025
Contributor
Contributor
Author
The old README had an invalid line: This invalid line is detected by this PR, making the CI fail. But I had another PR to fix the README that has been merged too, with: |
Contributor
|
@JulienPalard thanks for elaborating 👍 |
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.

Before:
was allowed but had no effect as payemnt_means is a container.
Now it gives:
It allowed to find issues in the tests, but they are fixed in #100 to avoid conflicts between those two PRs:
There as a:
Instead of:
And there was a:
Instead of: