Package org.python.indexer

Examples of org.python.indexer.Scope.lookupType()


        NBinding method = mtable.lookupType("MyClass").getTable().lookup("__init__");
        assertNotNull(method);
        assertEquals(NBinding.Kind.CONSTRUCTOR, method.getKind());
        assertEquals("classtype_builtins.MyClass.__init__", method.getQname());

        NType ftype = mtable.lookupType("MyClass").getTable().lookupType("__init__");
        assertTrue(ftype.isFuncType());

        NBinding c = mtable.lookup("MyClass");
        for (String special : new String[]{"im_class", "__class__", "im_self", "__self__"}) {
            NBinding attr = ftype.getTable().lookup(special);
View Full Code Here


    protected void bindNames(Scope s) throws Exception {
        Scope container = s.getScopeSymtab();
        setType(new NClassType(name.id, container));

        // If we already defined this class in this scope, don't redefine it.
        NType existing = container.lookupType(name.id);
        if (existing != null && existing.isClassType()) {
            return;
        }

        NameBinder.make(NBinding.Kind.CLASS).bind(container, name, getType());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.