icecream icon indicating copy to clipboard operation
icecream copied to clipboard

Make `ic` a function instead of an instance to improve distinction and intuitiveness

Open YunfangHou opened this issue 4 months ago • 1 comments

resolve https://github.com/gruns/icecream/issues/192

  1. A new function ic_aux, which is basically as same as the function __call__, but adding one more f_back after callFrame = inspect.currentframe().f_back, because ic_aux is invoked one more level of function.
  2. A new independent function ic, which initializes an instance of IceCreamDebugger and invokes the ic_aux function of the instance.
  3. Comment out __call__ function in IceCreamDebugger.

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.

image

YunfangHou avatar Oct 05 '24 13:10 YunfangHou