You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this is a bug in your code: except * means "can raise a Python exception with any return value". Since you wouldn't expect __pyx_v_codec to be assigned if the function raises a Python exception then the code generated is correct.
OK sorry I misunderstood. The existence of the temporary is right, because it's matching the following Python behaviour:
a = f()
# "a" shouldn't be assigned here
If the temporary didn't exist then a would be assigned directly exception or not and the behaviour would be incorrect. I think we both agree on this bit, but just making sure.
I'm not 100% sure what C++ standard Cython targets as a baseline. I'm pretty sure it still targets C89, so on that basis I'd assume it aims for the earliest possible C++ standard, and that std::move might not be acceptable for generated code. But I don't know this for certain so I'll stop commenting now.