Commit 44ecf658 authored by gsamain's avatar gsamain Committed by Xavier Thompson

Allow is statement for cypclass (pointer comparison as with PyObjects)

parent 46953eaa
......@@ -12822,6 +12822,9 @@ class PrimaryCmpNode(ExprNode, CmpNode):
self.is_pycmp = False
entry = env.lookup_operator(self.operator, [self.operand1, self.operand2])
if entry is None:
if self.operator == "is":
self.type = PyrexTypes.c_bint_type
return
error(self.pos, "Invalid types for '%s' (%s, %s)" %
(self.operator, type1, type2))
self.type = PyrexTypes.error_type
......@@ -12915,7 +12918,7 @@ class PrimaryCmpNode(ExprNode, CmpNode):
result1, result2 = operand1.pythran_result(), operand2.pythran_result()
else:
result1, result2 = operand1.result(), operand2.result()
if operand1.type.is_cyp_class:
if operand1.type.is_cyp_class and self.operator != "is":
result1 = '*' + result1
if self.is_memslice_nonecheck:
if operand1.type.is_memoryviewslice:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment