Skip to content

Commit 64c9058

Browse files
committed
add flag to enable_fasttco() to be able to switch it back off.
1 parent 2cf8c26 commit 64c9058

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

unpythonic/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ def _init_fploop(reload=False):
5656
_init_tco()
5757
_init_fploop()
5858

59-
def enable_fasttco():
60-
"""Switch to the fast TCO implementation.
59+
def enable_fasttco(b=True):
60+
"""Switch the fast TCO implementation on/off.
6161
6262
It is 2-5x faster, but pickier about its syntax, hence not the default.
6363
See ``unpythonic.fasttco`` for details.
6464
"""
65-
rc._tco_impl = "fast"
65+
rc._tco_impl = "fast" if b else "exc"
6666

6767
_init_tco()
6868
_init_fploop(reload=True)

0 commit comments

Comments
 (0)