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 }}
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.
I create a very simple class derived from DynamicObject and set the breakpoint
in TryInvokeMember
public class TestProxy : DynamicObject
{
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
{
return base.TryInvokeMember(binder, args, out result);
}
}
I create a script scope and do scope.SetVariable("test", new TestProxy());
Then I execute the string test.Something() and expected to hit the breakpoint.
However it seems that IronPython considers Something is an attribute and call
TryGetMember. If test is a regular C# object, everything works as usual so it
seems to have difficulty with DynamicObject.
As I have been using DynamicObject to create proxies, I cannot use it in a
hosted ironpython session...
Work Item Details
Original CodePlex Issue:Issue 35679 Status: Proposed Reason Closed: Unassigned Assigned to: Unassigned Reported on: Nov 13 at 4:07 PM Reported by: domtop Updated on: Nov 14 at 12:57 PM Updated by: MarkusSchaber
The text was updated successfully, but these errors were encountered:
On 2014-11-14 20:57:20 UTC, MarkusSchaber commented:
As far as I know, IronPython always uses TryGetMember, and then tries to invoke what it gets there. This is according to the python semantics, where member access and calling are two separate steps.
Maybe you can appropriately override TryGetMember to support your use case?
Using IronPython 2.7.4 (nuget)
I create a very simple class derived from DynamicObject and set the breakpoint
in TryInvokeMember
public class TestProxy : DynamicObject
I create a script scope and do scope.SetVariable("test", new TestProxy());
Then I execute the string test.Something() and expected to hit the breakpoint.
However it seems that IronPython considers Something is an attribute and call
TryGetMember. If test is a regular C# object, everything works as usual so it
seems to have difficulty with DynamicObject.
As I have been using DynamicObject to create proxies, I cannot use it in a
hosted ironpython session...
Work Item Details
Original CodePlex Issue: Issue 35679
Status: Proposed
Reason Closed: Unassigned
Assigned to: Unassigned
Reported on: Nov 13 at 4:07 PM
Reported by: domtop
Updated on: Nov 14 at 12:57 PM
Updated by: MarkusSchaber
The text was updated successfully, but these errors were encountered: