🌐 AI搜索 & 代理 主页
Skip to content

Commit 16e4aaf

Browse files
generallokifilmor
authored andcommitted
Update MethodBinder.cs
1 parent cf01b18 commit 16e4aaf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/runtime/MethodBinder.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ namespace Python.Runtime
1010
{
1111
using MaybeMethodBase = MaybeMethodBase<MethodBase>;
1212

13+
/// <summary>
14+
/// Delegate for custom coercion logic during Python method binding.
15+
/// </summary>
16+
/// <param name="arguments">A dictionary containing the Python arguments passed to the method.</param>
17+
/// <param name="methods">An array of method overloads being considered for binding.</param>
18+
/// <param name="foundBinding">
19+
/// A reference to the method that was successfully bound. This can be modified by the delegate
20+
/// to override the default binding logic. The delegate can set this to null to disable the method call
21+
/// and report an error.
22+
/// </param>
1323
public delegate void MethodBinderCoerceBindDelegate(
1424
Dictionary<string, PyObject> arguments,
1525
MethodBase[] methods,
@@ -1088,8 +1098,14 @@ static internal class ParameterInfoExtensions
10881098
}
10891099
}
10901100

1101+
/// <summary>
1102+
/// Provides events related to method binding in the MethodBinder class.
1103+
/// </summary>
10911104
public static class MethodBinderEvents
10921105
{
1106+
/// <summary>
1107+
/// Event triggered to allow custom coercion logic during method binding.
1108+
/// </summary>
10931109
public static MethodBinderCoerceBindDelegate? CoerceBind;
10941110
}
10951111
}

0 commit comments

Comments
 (0)