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

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

8 statements  

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