Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/graphviz/copying.py: 57%

7 statements  

« prev     ^ index     » next       coverage.py v7.2.2, created at 2023-03-26 06:43 +0000

1"""Create new instance copies with cooperative ``super()`` calls.""" 

2 

3__all__ = ['CopyBase'] 

4 

5 

6class CopyBase: 

7 """Create new instance copies with cooperative ``super()`` calls.""" 

8 

9 def copy(self): 

10 """Return a copied instance of the object. 

11 

12 Returns: 

13 An independent copy of the current object. 

14 """ 

15 kwargs = self._copy_kwargs() 

16 return self.__class__(**kwargs) 

17 

18 def _copy_kwargs(self, **kwargs): 

19 """Return the kwargs to create a copy of the instance.""" 

20 return kwargs