icecream
icecream copied to clipboard
Make `ic` a function instead of an instance to improve distinction and intuitiveness
resolve https://github.com/gruns/icecream/issues/192
- A new function
ic_aux
, which is basically as same as the function__call__
, but adding one moref_back
aftercallFrame = inspect.currentframe().f_back
, becauseic_aux
is invoked one more level of function. - A new independent function
ic
, which initializes an instance ofIceCreamDebugger
and invokes theic_aux
function of the instance. - Comment out
__call__
function inIceCreamDebugger
.
The effect is shown in the image below. The ic
is now highlighted in the color of a function, with higher distinction and intuitiveness in user's IDE.