Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icecream should return it's args #2

Closed
Boscillator opened this issue Feb 15, 2018 · 2 comments
Closed

Icecream should return it's args #2

Boscillator opened this issue Feb 15, 2018 · 2 comments

Comments

@Boscillator
Copy link

The ic function should return it's argument. That way, you can slap it in the middle of an expression to debug.

For example, if you had this foo(bar(x)) and you suspected the bar function was misbehaving, you could do foo(ic(bar(x))) and it would print the result of bar.

@gruns
Copy link
Owner

gruns commented Feb 15, 2018

Magnificent suggestion.

I will add this in the next version, v0.5.

@gruns
Copy link
Owner

gruns commented Feb 16, 2018

Now implemented in IceCream v0.5.

>>> def foo(i):
>>>     return i / 2
>>> b = ic(foo(6))
ic| foo(6): 3
>>> ic(b)
ic| b: 3

Upgrade with

$ pip install icecream --upgrade

Thank you, again, for your suggestion, @Boscillator. Don't hesitate to let me know if there's anything else I can do for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants