-
Notifications
You must be signed in to change notification settings - Fork 218
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
Modified __lt__ in Marker class. #328
Merged
Merged
Conversation
This file contains 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
Can you add a test for this please? |
Mo2000
force-pushed
the
master
branch
5 times, most recently
from
February 14, 2018 02:15
c35c76a
to
7c7caca
Compare
Marker class in /voluptuous/schema_builder.py needed to have the __lt__() function modified in order to compare against regular strings as well. This will allow the usage of Voluptuous Optional objects as keys in dicts alongside strings and int.
Test has been added |
Thanks! |
This was referenced Feb 15, 2018
This was referenced Feb 22, 2018
wip-sync
pushed a commit
to NetBSD/pkgsrc-wip
that referenced
this pull request
Aug 13, 2019
Upstream changes are many minor improvements and bugfixes, plus **Changes** - [#378](alecthomas/voluptuous#378): Allow `extend()` of a `Schema` to return a subclass of a `Schema` as well. **Changes**: - [#349](alecthomas/voluptuous#349): Support Python 3.7. - [#343](alecthomas/voluptuous#343): Drop support for Python 3.3. **Changes**: - [#293](alecthomas/voluptuous#293): Support Python 3.6. - [#294](alecthomas/voluptuous#294): Drop support for Python 2.6, 3.1 and 3.2. - [#318](alecthomas/voluptuous#318): Allow to use nested schema and allow any validator to be compiled. - [#324](alecthomas/voluptuous#324): Default values MUST now pass validation just as any regular value. This is a backward incompatible change if a schema uses default values that don't pass validation against the specified schema. - [#328](alecthomas/voluptuous#328): Modify `__lt__` in Marker class to allow comparison with non Marker objects, such as str and int.
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.
Marker class in
/voluptuous/schema_builder.py
needed to have the__lt__()
functionmodified in order to compare against regular strings as well.
This will allow the usage of Voluptuous Optional objects as keys in dicts alongside
strings and int.
An example of this would be a dict as such:
Sorting the above dict without the proposed changes will result in an error similar to the one below: