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
{{ message }}
Repository navigation
Two objects created when calling C# constructor #2555
The default constructor SomeClass() is called twice in MetaType.tp_call , first by using NewReference obj = NativeCall.Call_3(tp_new, tp, args, kw); and then by type.Init(obj.Borrow(), args, kw).
If Python does this:
obj=SomeClass(1, "str")
Then using NewReference obj = NativeCall.Call_3(tp_new, tp, args, kw); calls the default constructor and then type.Init(obj.Borrow(), args, kw) calls the one with arguments.
Is this an expected behaviour? Is there a workaround or fix for this? I am working with a case where I really don't whant the constructor to be called twice.
Activity