Created by: gruns
What is this Python project?
IceCream is a small Python library that makes it easy to debug variables,
expressions, and code execution with a single, simple function: ic()
. (short
for IceCream)
With arguments, ic()
inspects itself and prints both its own arguments and
those argument's values.
from icecream import ic
def foo(i):
return i + 333
ic(foo(123))
Prints
ic| foo(123): 456
Without arguments, ic()
inspects itself and prints the calling filename and
line number.
from icecream import ic
def foo():
ic()
return 'bar'
foo()
Prints
ic| example.py:4 in foo()
See more IceCream magic and examples in IceCream's docs, here.
IceCream is well tested, permissively licensed, and supports Python 2, Python 3, PyPy2, and PyPy3.
What's the difference between this Python project and similar ones?
IceCream's closest cousin is q (https://github.com/zestyping/q), but IceCream is simpler, customizable, and actively maintained.
--
Anyone who agrees with this pull request could vote for it by adding a