gruns / icecream

🍦 Never use print() to debug again.
MIT License
9.22k stars 187 forks source link

Emoji prefix inconsistent whitespace #104

Closed Mathemmagician closed 3 years ago

Mathemmagician commented 3 years ago

Fun issue I'm πŸ‘bserving. Trying to use emojis as prefix makes lines 2+ a bit inconsistent (shifted back by 1 space).

Setup: Jupyter Lab, macOS Catalina

from icecream import ic
ic.configureOutput(outputFunction=print,  prefix='πŸ‘ πŸ‘ ')

random_text = 'First very long text'
random_text2 = 'Second very long text'
random_text3 = 'Third very long text'

ic(random_text, random_text2, random_text3)
Screen Shot 2021-08-09 at 2 50 46 PM

Using a prefix without emojis:

Screen Shot 2021-08-09 at 2 51 30 PM
alexmojaki commented 3 years ago
πŸ‘οΈabc
Xabc

I think it's just that the fixed width font doesn't render emojis in the fixed width

Mathemmagician commented 3 years ago

Interesting. I guess I need fixed width emojis?

alexmojaki commented 3 years ago

i think you need to not use emojis lol

Mathemmagician commented 3 years ago

Not using emojis in 2021? Not gonna happen lol. I think I'll just live with this inconsistency.

For the reference, I'm using "πŸ‘ πŸ‘ " to indicate information that needs to be double checked in the notebook, which makes the output really standout. So the use case is pretty legit

alexmojaki commented 3 years ago
from icecream import ic
ic.configureOutput(outputFunction=print)

random_text = 'First very long text'
random_text2 = 'Second very long text'
random_text3 = 'Third very long text'

ic('πŸ‘', random_text, random_text2, random_text3)
ic| 'πŸ‘': 'πŸ‘'
    random_text: 'First very long text'
    random_text2: 'Second very long text'
    random_text3: 'Third very long text'

Literals are actually only supposed to be shown once but that doesn't work with multiline output (https://github.com/gruns/icecream/issues/84). In this case it works out OK though lol

Mathemmagician commented 3 years ago

ic| 'πŸ‘': 'πŸ‘'

That's funny!

gruns commented 3 years ago

For the reference, I'm using "eye eye " to indicate information that needs to be double checked in the notebook, which makes the output really standout.

that's cute 😊. i like it