Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/IPython/utils/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

10 statements  

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

2from __future__ import annotations 

3 

4# Copyright (c) IPython Development Team. 

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

6 

7 

8class Sentinel: 

9 def __init__(self, name: str, module: str, docstring: str | None = None) -> None: 

10 self.name = name 

11 self.module = module 

12 if docstring: 

13 self.__doc__ = docstring 

14 

15 def __repr__(self) -> str: 

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