1- # displayhooks
1+ <details >
2+ <summary >ⓘ</summary >
23
34[ ![ Downloads] ( https://static.pepy.tech/badge/displayhooks/month )] ( https://pepy.tech/project/displayhooks )
45[ ![ Downloads] ( https://static.pepy.tech/badge/displayhooks )] ( https://pepy.tech/project/displayhooks )
5- [ ![ Coverage Status] ( https://coveralls.io/repos/github/pomponchik /displayhooks/badge.svg?branch=main )] ( https://coveralls.io/github/pomponchik /displayhooks?branch=main )
6- [ ![ Lines of code] ( https://sloc.xyz/github/pomponchik /displayhooks/?category=code )] ( https://github.com/boyter/scc/ )
7- [ ![ Hits-of-Code] ( https://hitsofcode.com/github/pomponchik /displayhooks?branch=main )] ( https://hitsofcode.com/github/pomponchik /displayhooks/view?branch=main )
8- [ ![ Test-Package] ( https://github.com/pomponchik /displayhooks/actions/workflows/tests_and_coverage.yml/badge.svg )] ( https://github.com/pomponchik /metronomes/actions/workflows/tests_and_coverage.yml )
6+ [ ![ Coverage Status] ( https://coveralls.io/repos/github/mutating /displayhooks/badge.svg?branch=main )] ( https://coveralls.io/github/mutating /displayhooks?branch=main )
7+ [ ![ Lines of code] ( https://sloc.xyz/github/mutating /displayhooks/?category=code )] ( https://github.com/boyter/scc/ )
8+ [ ![ Hits-of-Code] ( https://hitsofcode.com/github/mutating /displayhooks?branch=main )] ( https://hitsofcode.com/github/mutating /displayhooks/view?branch=main )
9+ [ ![ Test-Package] ( https://github.com/mutating /displayhooks/actions/workflows/tests_and_coverage.yml/badge.svg )] ( https://github.com/mutating /metronomes/actions/workflows/tests_and_coverage.yml )
910[ ![ Python versions] ( https://img.shields.io/pypi/pyversions/displayhooks.svg )] ( https://pypi.python.org/pypi/displayhooks )
1011[ ![ PyPI version] ( https://badge.fury.io/py/displayhooks.svg )] ( https://badge.fury.io/py/displayhooks )
1112[ ![ Checked with mypy] ( http://www.mypy-lang.org/static/mypy_badge.svg )] ( http://mypy-lang.org/ )
1213[ ![ Ruff] ( https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json )] ( https://github.com/astral-sh/ruff )
14+ [ ![ DeepWiki] ( https://deepwiki.com/badge.svg )] ( https://deepwiki.com/mutating/displayhooks )
1315
16+ </details >
1417
15- It's a micro library for manipulating [ ` sys.displayhook ` ] ( https://docs.python.org/3/library/sys.html#sys.displayhook ) .
18+ ![ logo ] ( https://raw.githubusercontent.com/mutating/displayhooks/develop/docs/assets/logo_1.svg )
1619
17- When you need to change the standard behavior of ` displayhook ` , with this library you will do it:
20+
21+ It's a micro-library for customizing [ ` sys.displayhook ` ] ( https://docs.python.org/3/library/sys.html#sys.displayhook ) .
22+
23+ If you need to change the default behavior of ` sys.displayhook ` , this library lets you do it:
1824
1925- 💎 declaratively
2026- 🫥 compactly
@@ -24,7 +30,7 @@ When you need to change the standard behavior of `displayhook`, with this librar
2430## Table of contents
2531
2632- [ ** Quick start** ] ( #quick-start )
27- - [ ** Change the displayed value ** ] ( #change-the- displayed-value )
33+ - [ ** Transform displayed values ** ] ( #transform- displayed-values )
2834- [ ** Prohibiting the display of certain types of values** ] ( #prohibiting-the-display-of-certain-types-of-values )
2935- [ ** Automatic recovery of the default hook** ] ( #automatic-recovery-of-the-default-hook )
3036
@@ -37,7 +43,7 @@ Install it:
3743pip install displayhooks
3844```
3945
40- And use:
46+ Then use it:
4147
4248``` python
4349import sys
@@ -51,9 +57,9 @@ sys.displayhook(666)
5157# [nothing!]
5258```
5359
54- ## Change the displayed value
60+ ## Transform displayed values
5561
56- You can declaratively declare a converter function for the printed values. What it returns will be used to call the original ` displayhook ` function.
62+ You can declaratively define a converter function for displayed values. Its return value will be passed to the original ` displayhook ` function.
5763
5864``` python
5965import sys
@@ -67,8 +73,7 @@ sys.displayhook("What’s gone with that boy, I wonder? You TOM!")
6773# > 'what’s gone with that boy, i wonder? you tom!'
6874```
6975
70- If your function returns ` None ` , nothing will be printed.
71-
76+ If your function returns ` None ` , nothing is displayed.
7277
7378## Prohibiting the display of certain types of values
7479
0 commit comments