-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Description
Issue Statement
When doing a coercion on a singleton or list the expected type casting is done. In the case of a set the original type is returned and no exception is raised.
Expectation
Either sets can't do coercions and a schema error is raised or sets correctly return a set with the modified types.
Steps to reproduction
from ipaddress import IPv4Address
from voluptuous import Coerce, Schema
test_schema = Schema(Coerce(IPv4Address))
test_schema('192.0.0.2')
# Returns IPv4Address('192.0.0.2')
test_schema = Schema([Coerce(IPv4Address)])
test_schema(['192.0.0.2'])
# Returns [IPv4Address('192.0.0.2')]
test_schema = Schema({Coerce(IPv4Address)})
test_schema({'192.0.0.2'})
# Returns {'192.0.0.2'}
>>>
Versions
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
Python==3.7.2
voluptuous==0.11.5
Suor
Metadata
Metadata
Assignees
Labels
No labels