Code formatting.
[OpenColorIO-Configs.git] / aces_1.0.0 / python / aces_ocio / utilities.py
index 1d426d9..6f30f3a 100644 (file)
@@ -39,16 +39,16 @@ class ColorSpace(object):
 
     def __init__(self,
                  name,
-                 aliases=[],
+                 aliases=None,
                  description=None,
                  bit_depth=ocio.Constants.BIT_DEPTH_F32,
                  equality_group='',
                  family=None,
                  is_data=False,
-                 to_reference_transforms=[],
-                 from_reference_transforms=[],
+                 to_reference_transforms=None,
+                 from_reference_transforms=None,
                  allocation_type=ocio.Constants.ALLOCATION_UNIFORM,
-                 allocation_vars=[0, 1],
+                 allocation_vars=None,
                  aces_transform_id=None):
         """
         Object description.
@@ -64,6 +64,18 @@ class ColorSpace(object):
              Return value description.
         """
 
+        if aliases is None:
+            aliases = []
+
+        if to_reference_transforms is None:
+            to_reference_transforms = []
+
+        if from_reference_transforms is None:
+            from_reference_transforms = []
+
+        if allocation_vars is None:
+            allocation_vars = [0, 1]
+
         self.name = name
         self.aliases = aliases
         self.bit_depth = bit_depth
@@ -181,11 +193,11 @@ def replace(string, data):
 
     Examples
     --------
-    >>> patterns = {"John" : "Luke",
-    ...             "Jane" : "Anakin",
-    ...             "Doe" : "Skywalker",
-    ...             "Z6PO" : "R2D2"}
-    >>> data = "Users are: John Doe, Jane Doe, Z6PO."
+    >>> patterns = {'John' : 'Luke',
+    ...             'Jane' : 'Anakin',
+    ...             'Doe' : 'Skywalker',
+    ...             'Z6PO' : 'R2D2'}
+    >>> data = 'Users are: John Doe, Jane Doe, Z6PO.'
     >>> replace(data,patterns )
     u'Users are: Luke Skywalker, Anakin Skywalker, R2D2.'
     """
@@ -277,6 +289,5 @@ def unpack_default(iterable, length=3, default=None):
     iterable
     """
 
-    return itertools.islice(itertools.chain(iter(iterable),
-                                            itertools.repeat(default)),
-                            length)
+    return itertools.islice(
+        itertools.chain(iter(iterable), itertools.repeat(default)), length)