python: Change 'clone' function names to 'copy'.
authorBen Pfaff <blp@nicira.com>
Thu, 15 Sep 2011 22:31:12 +0000 (15:31 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 23 Sep 2011 16:10:45 +0000 (09:10 -0700)
It seems that 'copy' is the proper name for this kind of function in
Python, based on the existence of dict.copy().

python/ovs/db/data.py
python/ovs/db/types.py

index 15a715135f2fc3bbbbd3edc42d2c3059125b3d6b..334c261419f77e1313a245c386d043b972de4c70 100644 (file)
@@ -241,7 +241,7 @@ class Datum(object):
     def __contains__(self, item):
         return item in self.values
 
-    def clone(self):
+    def copy(self):
         return Datum(self.type, dict(self.values))
 
     @staticmethod
index 95632116000bcfce70ead0ee18f762c2c0563acd..08dfa0ae9a48bdc4245961e4f040502384f0ccf8 100644 (file)
@@ -220,8 +220,8 @@ class BaseType(object):
                     json['refType'] = self.ref_type
         return json
 
-    def clone(self):
-        return BaseType(self.type, self.enum.clone(), self.min, self.max,
+    def copy(self):
+        return BaseType(self.type, self.enum.copy(), self.min, self.max,
                         self.min_length, self.max_length, self.ref_table)
 
     def is_valid(self):
@@ -378,12 +378,12 @@ class Type(object):
         self.n_min = n_min
         self.n_max = n_max
 
-    def clone(self):
+    def copy(self):
         if self.value is None:
             value = None
         else:
-            value = self.value.clone()
-        return Type(self.key.clone(), value, self.n_min, self.n_max)
+            value = self.value.copy()
+        return Type(self.key.copy(), value, self.n_min, self.n_max)
 
     def __eq__(self, other):
         if not isinstance(other, Type):