Skip to content

Instantly share code, notes, and snippets.

@eltjpm
Created July 19, 2013 19:34
Show Gist options
  • Save eltjpm/6041799 to your computer and use it in GitHub Desktop.
Save eltjpm/6041799 to your computer and use it in GitHub Desktop.
Index: numba/type_inference/infer.py
===================================================================
--- numba/type_inference/infer.py (revision 80685)
+++ numba/type_inference/infer.py (revision 80686)
@@ -850,7 +850,11 @@
["is_int", 'is_object', 'is_bool'])
v1, v2 = node.left.variable, node.right.variable
- promotion_type = self.promote(v1, v2)
+ # Handle string formatting with %
+ if isinstance(node.op, ast.Mod) and v1.type.is_c_string:
+ promotion_type = object_
+ else:
+ promotion_type = self.promote(v1, v2)
if (v1.type.is_pointer or v2.type.is_pointer):
self._verify_pointer_type(node, v1, v2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment