return "((struct %s *)%s%s%s)->%s" % (
obj.type.vtabstruct_cname, obj_code, self.op,
obj.type.vtabslot_cname, self.member)
- else:
+ elif self.result_is_used:
return self.member
+ # Generating no code at all for unused access to optimised builtin
+ # methods fixes the problem that some optimisations only exist as
+ # macros, i.e. there is no function pointer to them, so we would
+ # generate invalid C code here.
+ return
elif obj.type.is_complex:
return "__Pyx_C%s(%s)" % (self.member.upper(), obj_code)
else:
_set = set # CPython may not define it (in Py2.3), but Cython does :)
+
def test_set_clear_bound():
"""
>>> type(test_set_clear_bound()) is _set
text = u'ab jd sdflk as sa sadas asdas fsdf '
pipe_sep = u'|'
+
@cython.test_assert_path_exists(
"//SimpleCallNode",
"//SimpleCallNode//NameNode")
"""
join = sep.join
return join(l)
+
+
+def test_unicode_join_bound_no_assignment(unicode sep):
+ """
+ >>> test_unicode_join_bound_no_assignment(text)
+ """
+ sep.join
+
+
+def test_dict_items_bound_no_assignment(dict d):
+ """
+ >>> test_dict_items_bound_no_assignment({1:2})
+ """
+ d.items