Currently, the prefix parameter of the configureOutput function is annotated as follows:
prefix: Union[str, Literal[Sentinel.absent]] = Sentinel.absent,
Defining a prefix as a function results in a type validation error.
$ cat /tmp/a.py
#!/usr/bin/env python3
from icecream import ic
from datetime import datetime
ic.configureOutput(prefix=lambda: datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
ic("hello")
$ mypy /tmp/a.py
/tmp/a.py:5: error: Argument "prefix" to "configureOutput" of "IceCreamDebugger" has incompatible type "Callable[[], str]"; expected "str | Literal[Sentinel.absent]" [arg-type]
Found 1 error in 1 file (checked 1 source file)
Currently, the
prefixparameter of theconfigureOutputfunction is annotated as follows:prefix: Union[str, Literal[Sentinel.absent]] = Sentinel.absent,Defining a prefix as a function results in a type validation error.