mirror of
https://github.com/openvswitch/ovs
synced 2025-10-25 15:07:05 +00:00
python: Change 'clone' function names to 'copy'.
It seems that 'copy' is the proper name for this kind of function in Python, based on the existence of dict.copy().
This commit is contained in:
@@ -241,7 +241,7 @@ class Datum(object):
|
|||||||
def __contains__(self, item):
|
def __contains__(self, item):
|
||||||
return item in self.values
|
return item in self.values
|
||||||
|
|
||||||
def clone(self):
|
def copy(self):
|
||||||
return Datum(self.type, dict(self.values))
|
return Datum(self.type, dict(self.values))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -220,8 +220,8 @@ class BaseType(object):
|
|||||||
json['refType'] = self.ref_type
|
json['refType'] = self.ref_type
|
||||||
return json
|
return json
|
||||||
|
|
||||||
def clone(self):
|
def copy(self):
|
||||||
return BaseType(self.type, self.enum.clone(), self.min, self.max,
|
return BaseType(self.type, self.enum.copy(), self.min, self.max,
|
||||||
self.min_length, self.max_length, self.ref_table)
|
self.min_length, self.max_length, self.ref_table)
|
||||||
|
|
||||||
def is_valid(self):
|
def is_valid(self):
|
||||||
@@ -378,12 +378,12 @@ class Type(object):
|
|||||||
self.n_min = n_min
|
self.n_min = n_min
|
||||||
self.n_max = n_max
|
self.n_max = n_max
|
||||||
|
|
||||||
def clone(self):
|
def copy(self):
|
||||||
if self.value is None:
|
if self.value is None:
|
||||||
value = None
|
value = None
|
||||||
else:
|
else:
|
||||||
value = self.value.clone()
|
value = self.value.copy()
|
||||||
return Type(self.key.clone(), value, self.n_min, self.n_max)
|
return Type(self.key.copy(), value, self.n_min, self.n_max)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if not isinstance(other, Type):
|
if not isinstance(other, Type):
|
||||||
|
|||||||
Reference in New Issue
Block a user