mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
17 lines
273 B
Python
17 lines
273 B
Python
from functools import singledispatch
|
||
|
||
|
||
@singledispatch
|
||
def to_description(ob):
|
||
return str(ob)
|
||
|
||
|
||
@to_description.register(type(None))
|
||
def none_to_description(_):
|
||
return '–'
|
||
|
||
|
||
@to_description.register(bool)
|
||
def bool_to_description(b):
|
||
return '✓' if b else ''
|