Skip to content

Commit b04229d

Browse files
authored
Merge pull request #217 from un4gt/master
make ic's install configurable before installation
2 parents 6939e3f + 6c1ba29 commit b04229d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

icecream/builtins.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010
# License: MIT
1111
#
1212

13+
from typing import Optional
1314
import icecream
1415

1516
builtins = __import__('builtins')
1617

1718

18-
def install(ic: str='ic') -> None:
19-
setattr(builtins, ic, icecream.ic)
19+
def install(ic: str='ic', configured_ic: Optional[icecream.IceCreamDebugger] = None) -> None:
20+
if configured_ic is None:
21+
configured_ic = icecream.ic
22+
setattr(builtins, ic, configured_ic)
2023

2124

2225
def uninstall(ic: str='ic') -> None:

0 commit comments

Comments
 (0)