private IMember GetValueFromBound(IPythonBoundType t, CallExpression expr)
        {
            switch (t.Type)
            {
            case IPythonFunctionType fn:
                return(GetValueFromFunctionType(fn, t.Self, expr));

            case IPythonPropertyType p:
                return(GetValueFromProperty(p, t.Self, expr));

            case IPythonIteratorType _ when t.Self is IPythonCollection seq:
                return(seq.GetIterator());
            }
            return(UnknownType);
        }
Пример #2
0
        public async Task <IMember> GetValueFromBoundAsync(IPythonBoundType t, CallExpression expr, CancellationToken cancellationToken = default)
        {
            switch (t.Type)
            {
            case IPythonFunctionType fn:
                return(await GetValueFromFunctionTypeAsync(fn, t.Self, expr, cancellationToken));

            case IPythonPropertyType p:
                return(await GetValueFromPropertyAsync(p, t.Self, cancellationToken));

            case IPythonIteratorType it when t.Self is IPythonCollection seq:
                return(seq.GetIterator());
            }
            return(UnknownType);
        }