Ejemplo n.º 1
0
 internal override bool IsOfType(IAnalysisSet klass)
 {
     if (_original == null)
     {
         return(false);
     }
     return(_original.IsOfType(klass));
 }
        public override IAnalysisSet GetDescriptor(Node node, AnalysisValue instance, AnalysisValue context, AnalysisUnit unit)
        {
            if (_function.IsStatic || instance.IsOfType(ProjectState.ClassInfos[BuiltinTypeId.NoneType]))
            {
                return(base.GetDescriptor(node, instance, context, unit));
            }
            else if (_method == null)
            {
                _method = new BuiltinMethodInfo(_function, PythonMemberType.Method, ProjectState);
            }

            return(_method.GetDescriptor(node, instance, context, unit));
        }
Ejemplo n.º 3
0
        private BuiltinTypeId GetTypeId(AnalysisValue v)
        {
            if (v.TypeId != BuiltinTypeId.Type)
            {
                return(v.TypeId);
            }

            if (v.MemberType == PythonMemberType.Instance &&
                v.IsOfType(_analysis.ProjectState.ClassInfos[BuiltinTypeId.Type]))
            {
                return(BuiltinTypeId.Type);
            }

            return(BuiltinTypeId.Unknown);
        }