Commit 83730c47 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: None is an acceptable value

parent 2cd9f5ca
...@@ -162,6 +162,9 @@ class Number(props.PropertyBase): ...@@ -162,6 +162,9 @@ class Number(props.PropertyBase):
is returned unchanged. is returned unchanged.
""" """
if value is None:
return value
clamped = attributes['clamped'] clamped = attributes['clamped']
if not clamped: return value if not clamped: return value
...@@ -187,6 +190,8 @@ class Int(Number): ...@@ -187,6 +190,8 @@ class Int(Number):
"""Overrides :meth:`Number.cast`. Casts the given value to an ``int``, """Overrides :meth:`Number.cast`. Casts the given value to an ``int``,
and then passes the value to :meth:`Number.cast`. and then passes the value to :meth:`Number.cast`.
""" """
if value is None:
return value
return Number.cast(self, instance, attributes, int(value)) return Number.cast(self, instance, attributes, int(value))
...@@ -222,6 +227,8 @@ class Real(Number): ...@@ -222,6 +227,8 @@ class Real(Number):
"""Overrides :meth:`Number.cast`. Casts the given value to a ``float``, """Overrides :meth:`Number.cast`. Casts the given value to a ``float``,
and then passes the value to :meth:`Number.cast`. and then passes the value to :meth:`Number.cast`.
""" """
if value is None:
return value
return Number.cast(self, instance, attributes, float(value)) return Number.cast(self, instance, attributes, float(value))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment