icecream icon indicating copy to clipboard operation
icecream copied to clipboard

from icecream import ic as print

Open LogWell opened this issue 2 years ago • 5 comments

Perhaps writing this way can be perfectly compatible with existing code

LogWell avatar Aug 01 '23 02:08 LogWell

This wouldn't work cause print is a restricted keyword.

ArlinJae avatar May 26 '24 03:05 ArlinJae

As a basic usage alternative this is feasible:

a = [1, 2, 3]
print(a)  # [1, 2, 3]

from icecream import ic as print
print(a)  # ic| a: [1, 2, 3]

image

LogWell avatar May 26 '24 14:05 LogWell

I'm thinking and it looks like not a good idea to somehow replace existing built-in function as print.

@LogWell Why do you think it could be useful?

Jakeroid avatar Aug 26 '25 07:08 Jakeroid

Sometimes I just need to check it briefly, which is very convenient. I can remove this line when it's not needed. Not all projects are run in a very strict manner.

LogWell avatar Sep 13 '25 14:09 LogWell

@LogWell

Is there any issues with using from icecream import ic as print in current library version?

Jakeroid avatar Sep 14 '25 08:09 Jakeroid