Commit 5c13dd01 authored by gsamain's avatar gsamain Committed by Xavier Thompson

Cypclass is and is not

parent 6ffac2ce
......@@ -12868,7 +12868,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":
if self.operator in ("is", "is_not")\
and (type1.is_ptr or type1.is_cyp_class)\
and (type2.is_ptr or type2.is_cyp_class):
self.type = PyrexTypes.c_bint_type
return
error(self.pos, "Invalid types for '%s' (%s, %s)" %
......@@ -12964,7 +12966,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 and self.operator != "is":
if operand1.type.is_cyp_class and self.operator not in ("is", "is_not"):
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