Change default parameters from empty lists to None. Fixes #351
parent
8810983ca0
commit
fc95b400ff
|
@ -53,7 +53,7 @@ def _custom_marking_builder(cls, type, properties, version):
|
||||||
return _CustomMarking
|
return _CustomMarking
|
||||||
|
|
||||||
|
|
||||||
def _custom_observable_builder(cls, type, properties, version, id_contrib_props=[]):
|
def _custom_observable_builder(cls, type, properties, version, id_contrib_props=None):
|
||||||
class _CustomObservable(cls, _Observable):
|
class _CustomObservable(cls, _Observable):
|
||||||
|
|
||||||
if not re.match(TYPE_REGEX, type):
|
if not re.match(TYPE_REGEX, type):
|
||||||
|
|
|
@ -966,7 +966,7 @@ class X509Certificate(_Observable):
|
||||||
self._check_at_least_one_property(att_list)
|
self._check_at_least_one_property(att_list)
|
||||||
|
|
||||||
|
|
||||||
def CustomObservable(type='x-custom-observable', properties=None, id_contrib_props=[]):
|
def CustomObservable(type='x-custom-observable', properties=None, id_contrib_props=None):
|
||||||
"""Custom STIX Cyber Observable Object type decorator.
|
"""Custom STIX Cyber Observable Object type decorator.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
@ -980,6 +980,9 @@ def CustomObservable(type='x-custom-observable', properties=None, id_contrib_pro
|
||||||
... pass
|
... pass
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if id_contrib_props is None:
|
||||||
|
id_contrib_props = []
|
||||||
|
|
||||||
def wrapper(cls):
|
def wrapper(cls):
|
||||||
_properties = list(itertools.chain.from_iterable([
|
_properties = list(itertools.chain.from_iterable([
|
||||||
[('type', TypeProperty(type))],
|
[('type', TypeProperty(type))],
|
||||||
|
|
Loading…
Reference in New Issue