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
« prev ^ index » next coverage.py v7.2.7, created at 2023-07-01 06:54 +0000
1"""Sentinel class for constants with useful reprs"""
3# Copyright (c) IPython Development Team.
4# Distributed under the terms of the Modified BSD License.
7class Sentinel:
8 """Sentinel class for constants with useful reprs"""
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
17 def __repr__(self):
18 """The string repr for the sentinel."""
19 return str(self.module) + "." + self.name