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

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

9 statements  

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. 

5from __future__ import annotations 

6 

7 

8class Sentinel: 

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

10 

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

12 """Initialize the sentinel.""" 

13 self.name = name 

14 self.module = module 

15 if docstring: 

16 self.__doc__ = docstring 

17 

18 def __repr__(self): 

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

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