#221·icecream

[Feature Request] Allow `ic()` to accept keyword arguments for `argumentToString` customization

Author: liblafCreated Oct 31, 2025Updated Aug 21, 2026
Labelsenhancement

Is your feature request related to a problem?

I really like using icecream for debugging, but currently ic() only accepts positional arguments. It does not provide a way to pass additional keyword arguments that could be used by a custom argumentToString function.

Describe the solution you'd like

I'd like to be able to define a custom argumentToString for special types (e.g., numpy arrays) and pass options to it directly from the ic() call, such as:

python
@icecream.argumentToString.register(np.ndarray)
def _format_array(arr: np.ndarray, *, short_arrays: bool = True, **_kwargs) -> str:
    if short_arrays:
        return f"{arr.dtype}{arr.shape}(numpy)"
    return repr(arr)

ic(arr)  # I want short output here
ic(arr, short_arrays=False)  # I want full output here

Describe alternatives you've considered

Currently, to switch between different formatting behaviors, I must reconfigure the output globally, which is less flexible:

python
ic.configureOutput(argToStringFunction=format_array)
ic(arr)  # short output
ic.configureOutput(argToStringFunction=icecream.argumentToString)
ic(arr)  # full output

Additional context

This feature would make icecream more flexible and ergonomic when working with complex data types and custom formatting needs.