Ejemplo n.º 1
0
 public ConstantInfo(object value, PythonAnalyzer projectState)
     : base((BuiltinClassInfo)projectState.GetNamespaceFromObjects(projectState.GetTypeFromObject(value)))
 {
     _value       = value;
     _memberType  = PythonMemberType.Constant;
     _builtinInfo = ((BuiltinClassInfo)projectState.GetNamespaceFromObjects(_type)).Instance;
 }
Ejemplo n.º 2
0
 public ConstantInfo(IPythonConstant value, PythonAnalyzer projectState)
     : base((BuiltinClassInfo)projectState.GetNamespaceFromObjects(value.Type))
 {
     _value       = value;
     _memberType  = value.MemberType;
     _builtinInfo = ((BuiltinClassInfo)projectState.GetNamespaceFromObjects(value.Type)).Instance;
 }
Ejemplo n.º 3
0
        internal static ISet <Namespace> GetReturnTypes(IPythonFunction func, PythonAnalyzer projectState)
        {
            var result = new HashSet <Namespace>();
            var found  = new HashSet <IPythonType>();

            foreach (var target in func.Overloads)
            {
                var pyType = target.ReturnType;
                if (!found.Contains(pyType))
                {
                    result.Add(((BuiltinClassInfo)projectState.GetNamespaceFromObjects(pyType)).Instance);
                    found.Add(pyType);
                }
            }
            return(result);
        }