@@ -674,7 +674,7 @@ static Type TryComputeClrArgumentType(Type parameterType, IntPtr argument, bool
674674 /// <summary>
675675 /// Check whether the number of Python and .NET arguments match, and compute additional arg information.
676676 /// </summary>
677- /// <param name="pynargs ">Number of positional args passed from Python.</param>
677+ /// <param name="positionalArgumentCount ">Number of positional args passed from Python.</param>
678678 /// <param name="parameters">Parameters of the specified .NET method.</param>
679679 /// <param name="kwargDict">Keyword args passed from Python.</param>
680680 /// <param name="isOperator">True if the parameters' method is an operator.</param>
@@ -683,7 +683,7 @@ static Type TryComputeClrArgumentType(Type parameterType, IntPtr argument, bool
683683 /// <param name="kwargsMatched">Number of kwargs from Python that are also present in the .NET method.</param>
684684 /// <param name="defaultsNeeded">Number of non-null defaultsArgs.</param>
685685 /// <returns></returns>
686- static bool MatchesArgumentCount ( int pynargs , ParameterInfo [ ] parameters ,
686+ static bool MatchesArgumentCount ( int positionalArgumentCount , ParameterInfo [ ] parameters ,
687687 Dictionary < string , IntPtr > kwargDict ,
688688 bool isOperator ,
689689 out bool paramsArray ,
@@ -696,11 +696,11 @@ static bool MatchesArgumentCount(int pynargs, ParameterInfo[] parameters,
696696 paramsArray = parameters . Length > 0 ? Attribute . IsDefined ( parameters [ parameters . Length - 1 ] , typeof ( ParamArrayAttribute ) ) : false ;
697697 kwargsMatched = 0 ;
698698 defaultsNeeded = 0 ;
699- if ( pynargs == parameters . Length && kwargDict . Count == 0 )
699+ if ( positionalArgumentCount == parameters . Length && kwargDict . Count == 0 )
700700 {
701701 match = true ;
702702 }
703- else if ( pynargs < parameters . Length && ( ! paramsArray || pynargs == parameters . Length - 1 ) )
703+ else if ( positionalArgumentCount < parameters . Length && ( ! paramsArray || positionalArgumentCount == parameters . Length - 1 ) )
704704 {
705705 match = true ;
706706 // operator methods will have 2 CLR args but only one Python arg,
@@ -715,7 +715,7 @@ static bool MatchesArgumentCount(int pynargs, ParameterInfo[] parameters,
715715 // a corresponding keyword arg or a default param, unless the method
716716 // method accepts a params array (which cannot have a default value)
717717 defaultArgList = new ArrayList ( ) ;
718- for ( var v = pynargs ; v < parameters . Length ; v ++ )
718+ for ( var v = positionalArgumentCount ; v < parameters . Length ; v ++ )
719719 {
720720 if ( kwargDict . ContainsKey ( parameters [ v ] . Name ) )
721721 {
@@ -740,7 +740,7 @@ static bool MatchesArgumentCount(int pynargs, ParameterInfo[] parameters,
740740 }
741741 }
742742 }
743- else if ( pynargs > parameters . Length && parameters . Length > 0 &&
743+ else if ( positionalArgumentCount > parameters . Length && parameters . Length > 0 &&
744744 Attribute . IsDefined ( parameters [ parameters . Length - 1 ] , typeof ( ParamArrayAttribute ) ) )
745745 {
746746 // This is a `foo(params object[] bar)` style method
0 commit comments