##// END OF EJS Templates
Get widgets from function annotations and default arguments....
Get widgets from function annotations and default arguments. Also, preserve the order of function parameters from the signature where possible. This uses a backport of the Python 3.3 signature machinery that @minrk found and improved.

File last commit:

r9190:20a102a5
r15137:7b115517
Show More
hb_gil.py
31 lines | 574 B | text/x-python | PythonLexer
MinRK
add test notebook and script for #1260 (GIL-related heartbeat failures)...
r5885 """
Run this script in the qtconsole with one of:
Matthias BUSSONNIER
remove references to loadpy...
r6765 %load hb_gil.py
MinRK
add test notebook and script for #1260 (GIL-related heartbeat failures)...
r5885
or
%run hb_gil.py
Holding the GIL for too long could disrupt the heartbeat.
See Issue #1260: https://github.com/ipython/ipython/issues/1260
"""
import sys
import time
from cython import inline
def gilsleep(t):
"""gil-holding sleep with cython.inline"""
code = '\n'.join([
'from posix cimport unistd',
'unistd.sleep(t)',
])
while True:
inline(code, quiet=True, t=t)
Thomas Kluyver
Update print syntax in parallel examples.
r6455 print(time.time())
MinRK
add test notebook and script for #1260 (GIL-related heartbeat failures)...
r5885 sys.stdout.flush() # this is important
gilsleep(5)