Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/nbformat/sentinel.py: 80%
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
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
1"""Sentinel class for constants with useful reprs"""
3# Copyright (c) IPython Development Team.
4# Distributed under the terms of the Modified BSD License.
5from __future__ import annotations
8class Sentinel:
9 """Sentinel class for constants with useful reprs"""
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
18 def __repr__(self):
19 """The string repr for the sentinel."""
20 return str(self.module) + "." + self.name