Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/nbformat/sentinel.py: 88%

8 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-01 06:54 +0000

1"""Sentinel class for constants with useful reprs""" 

2 

3# Copyright (c) IPython Development Team. 

4# Distributed under the terms of the Modified BSD License. 

5 

6 

7class Sentinel: 

8 """Sentinel class for constants with useful reprs""" 

9 

10 def __init__(self, name, module, docstring=None): 

11 """Initialize the sentinel.""" 

12 self.name = name 

13 self.module = module 

14 if docstring: 

15 self.__doc__ = docstring 

16 

17 def __repr__(self): 

18 """The string repr for the sentinel.""" 

19 return str(self.module) + "." + self.name