Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fsleyes
fsleyes-props
Commits
83730c47
Commit
83730c47
authored
Mar 26, 2021
by
Paul McCarthy
🚵
Browse files
RF: None is an acceptable value
parent
2cd9f5ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
fsleyes_props/properties_types.py
View file @
83730c47
...
...
@@ -162,6 +162,9 @@ class Number(props.PropertyBase):
is returned unchanged.
"""
if
value
is
None
:
return
value
clamped
=
attributes
[
'clamped'
]
if
not
clamped
:
return
value
...
...
@@ -187,6 +190,8 @@ class Int(Number):
"""Overrides :meth:`Number.cast`. Casts the given value to an ``int``,
and then passes the value to :meth:`Number.cast`.
"""
if
value
is
None
:
return
value
return
Number
.
cast
(
self
,
instance
,
attributes
,
int
(
value
))
...
...
@@ -222,6 +227,8 @@ class Real(Number):
"""Overrides :meth:`Number.cast`. Casts the given value to a ``float``,
and then passes the value to :meth:`Number.cast`.
"""
if
value
is
None
:
return
value
return
Number
.
cast
(
self
,
instance
,
attributes
,
float
(
value
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment