Commit e1bce912 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

replace __nonzero__ by __bool__

parent 2d0df95c
......@@ -542,8 +542,8 @@ class BoolParameter(int, AbstractParameter):
val.is_None = False if default != None else True
for attr in bool.__dict__:
func = getattr(bool, attr)
if isinstance(func, collections.Callable) and attr not in ["__new__", "__init__", "__bool__", "__getattribute__", "__setattribute__",
"__eq__", "__ne__", "__nonzero__", "__str__", "__repr__", "__getnewargs__"]:
if isinstance(func, collections.Callable) and attr not in ["__new__", "__init__", "__getattribute__", "__setattribute__",
"__eq__", "__ne__", "__bool__", "__str__", "__repr__", "__getnewargs__"]:
setattr(BoolParameter, attr, none_decorator(func))
return val
......@@ -591,8 +591,8 @@ class IntParameter(int, AbstractParameter):
val.is_None = False if default != None else True
for attr in int.__dict__:
func = getattr(int, attr)
if isinstance(func, collections.Callable) and attr not in ["__new__", "__init__", "__int__", "__bool__", "__getattribute__", "__setattribute__",
"__eq__", "__ne__", "__nonzero__", "__str__", "__repr__", "__getnewargs__"]:
if isinstance(func, collections.Callable) and attr not in ["__new__", "__init__", "__int__", "__getattribute__", "__setattribute__",
"__eq__", "__ne__", "__bool__", "__str__", "__repr__", "__getnewargs__"]:
setattr(IntParameter, attr, none_decorator(func))
return val
......@@ -641,7 +641,7 @@ class FloatParameter(float, AbstractParameter):
for attr in float.__dict__:
func = getattr(float, attr)
if isinstance(func, collections.Callable) and attr not in ["__new__", "__init__", "__float__", "__getattribute__", "__setattribute__",
"__eq__", "__ne__", "__nonzero__", "__str__", "__repr__", "__getnewargs__"]:
"__eq__", "__ne__", "__bool__", "__str__", "__repr__", "__getnewargs__"]:
setattr(FloatParameter, attr, none_decorator(func))
return val
......@@ -690,7 +690,7 @@ class StrParameter(str, AbstractParameter):
for attr in str.__dict__:
func = getattr(str, attr)
if isinstance(func, collections.Callable) and attr not in ["__new__", "__init__", "__str__", "__getattribute__", "__setattribute__",
"__eq__", "__ne__", "__nonzero__", "__repr__", "__getnewargs__"]:
"__eq__", "__ne__", "__bool__", "__repr__", "__getnewargs__"]:
setattr(StrParameter, attr, none_decorator(func))
return val
......@@ -745,7 +745,7 @@ class DateParameter(datetime.datetime, AbstractParameter):
for attr in datetime.datetime.__dict__:
func = getattr(datetime.datetime, attr)
if isinstance(func, collections.Callable) and attr not in ["__new__", "__init__", "__getattribute__", "__setattribute__",
"__eq__", "__ne__", "__nonzero__", "__str__", "__repr__", "__getnewargs__"]:
"__eq__", "__ne__", "__bool__", "__str__", "__repr__", "__getnewargs__"]:
setattr(DateParameter, attr, none_decorator(func))
return val
......
Markdown is supported
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