diff options
author | Walter Bender <walter.bender@gmail.com> | 2013-01-16 23:29:03 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2013-01-16 23:29:03 (GMT) |
commit | 04986566b5d2bc0cd6982f8cb7dc19eac529e8ec (patch) | |
tree | 48a0d39bfc66ed33ab184ae0007cbc588fb9ce08 /plugins/turtle_blocks_extras | |
parent | 5e1e531ed7a3e57e32714ba3e9407439725dee4e (diff) |
cast ints as floats when passing args to Python block
Diffstat (limited to 'plugins/turtle_blocks_extras')
-rw-r--r-- | plugins/turtle_blocks_extras/turtle_blocks_extras.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py index 183c4ac..43703a7 100644 --- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py +++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py @@ -1084,6 +1084,9 @@ bullets')) def _prim_myfunction(self, f, x): """ Programmable block """ + for i, v in enumerate(x): + if type(v) == int: # Pass float values to Python block + x[i] = float(v) try: y = myfunc(f, x) if str(y) == 'nan': |