Did I find the right examples for you? yes no

All Samples(46)  |  Call(24)  |  Derive(2)  |  Import(20)

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/annotation/unaryop.py   plexnet(Download)
 
from types import MethodType
from pypy.annotation.model import \
     SomeObject, SomeInteger, SomeBool, SomeString, SomeChar, SomeList, \
     SomeDict, SomeTuple, SomeImpossibleValue, \
        if obj.is_constant():
            if isinstance(obj, SomeInstance):
                r = SomePBC([obj.classdef.classdesc])
            else:
                r = immutablevalue(obj.knowntype)
class __extend__(SomePBC):
 
    def getattr(pbc, s_attr):
        bookkeeper = getbookkeeper()
        return bookkeeper.pbc_getattr(pbc, s_attr)
    def bind_callables_under(pbc, classdef, name):
        d = [desc.bind_under(classdef, name) for desc in pbc.descriptions]
        return SomePBC(d, can_be_None=pbc.can_be_None)
 
    def is_true_behavior(pbc, s):

src/s/y/Sypy-HEAD/annotation/unaryop.py   Sypy(Download)
 
from types import MethodType
from pypy.annotation.model import \
     SomeObject, SomeInteger, SomeBool, SomeString, SomeChar, SomeList, \
     SomeDict, SomeTuple, SomeImpossibleValue, SomeUnicodeCodePoint, \
        if obj.is_constant():
            if isinstance(obj, SomeInstance):
                r = SomePBC([obj.classdef.classdesc])
            else:
                r = immutablevalue(obj.knowntype)
class __extend__(SomePBC):
 
    def getattr(pbc, s_attr):
        bookkeeper = getbookkeeper()
        return bookkeeper.pbc_getattr(pbc, s_attr)
    def bind_callables_under(pbc, classdef, name):
        d = [desc.bind_under(classdef, name) for desc in pbc.descriptions]
        return SomePBC(d, can_be_None=pbc.can_be_None)
 
    def is_true_behavior(pbc, s):

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/annotation/classdef.py   plexnet(Download)
"""
Type inference for user-defined classes.
"""
from pypy.annotation.model import SomePBC, s_ImpossibleValue, unionof
from pypy.annotation.model import SomeInteger, isdegenerated, SomeTuple,\
 
        if d or pbc.can_be_None:
            return SomePBC(d, can_be_None=pbc.can_be_None)
        else:
            return s_ImpossibleValue
    def read_attr__class__(self):
        position = self.bookkeeper.position_key
        self.read_locations_of__class__[position] = True
        return SomePBC([subdef.classdesc for subdef in self.getallsubdefs()])
 

src/s/y/Sypy-HEAD/annotation/classdef.py   Sypy(Download)
"""
Type inference for user-defined classes.
"""
from pypy.annotation.model import SomePBC, s_ImpossibleValue, unionof
from pypy.annotation.model import SomeInteger, isdegenerated, SomeTuple,\
 
        if d or pbc.can_be_None:
            return SomePBC(d, can_be_None=pbc.can_be_None)
        else:
            return s_ImpossibleValue
    def read_attr__class__(self):
        position = self.bookkeeper.position_key
        self.read_locations_of__class__[position] = True
        return SomePBC([subdef.classdesc for subdef in self.getallsubdefs()])
 

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/annotation/bookkeeper.py   plexnet(Download)
 
from pypy.objspace.flow.model import Constant
from pypy.annotation.model import SomeString, SomeChar, SomeFloat, \
     SomePtr, unionof, SomeInstance, SomeDict, SomeBuiltin, SomePBC, \
     SomeInteger, SomeOOInstance, SomeOOObject, TLS, SomeAddress, \
                    result.knowntype = tp # at least for types this needs to be correct
                else:
                    result = SomePBC([self.getdesc(x)])
        elif hasattr(x, '_freeze_') and x._freeze_():
            # user-defined classes can define a method _freeze_(), which
            # is called when a prebuilt instance is found.  If the method
            # returns True, the instance is considered immutable and becomes
            # a SomePBC().  Otherwise it's just SomeInstance().
            result = SomePBC([self.getdesc(x)])

src/s/y/Sypy-HEAD/annotation/bookkeeper.py   Sypy(Download)
 
from pypy.objspace.flow.model import Constant
from pypy.annotation.model import SomeString, SomeChar, SomeFloat, \
     SomePtr, unionof, SomeInstance, SomeDict, SomeBuiltin, SomePBC, \
     SomeInteger, SomeOOInstance, SomeOOObject, TLS, SomeAddress, \
                    result.knowntype = tp # at least for types this needs to be correct
                else:
                    result = SomePBC([self.getdesc(x)])
        elif hasattr(x, '_freeze_') and x._freeze_():
            # user-defined classes can define a method _freeze_(), which
            # is called when a prebuilt instance is found.  If the method
            # returns True, the instance is considered immutable and becomes
            # a SomePBC().  Otherwise it's just SomeInstance().
            result = SomePBC([self.getdesc(x)])

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/annotation/builtin.py   plexnet(Download)
from pypy.annotation.model import SomeUnicodeCodePoint, SomeAddress
from pypy.annotation.model import SomeFloat, unionof, SomeUnicodeString
from pypy.annotation.model import SomePBC, SomeInstance, SomeDict
from pypy.annotation.model import SomeWeakRef
from pypy.annotation.model import SomeOOObject

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/annotation/description.py   plexnet(Download)
                s_value = s_value.bind_callables_under(classdef, name)
        elif isinstance(obj, Desc):
            from pypy.annotation.model import SomePBC
            if classdef is not None:
                obj = obj.bind_under(classdef, name)
            s_value = SomePBC([obj])
    def consider_call_site(bookkeeper, family, descs, args, s_result):
        from pypy.annotation.model import SomeInstance, SomePBC, s_None
        if len(descs) == 1:
            # call to a single class, look at the result annotation
            # in case it was specialized
    def pycall(self, schedule, args, s_previous_result):
        from pypy.annotation.model import SomePBC
        s_self = SomePBC([self.frozendesc])
        args = args.prepend(s_self)
        return self.funcdesc.pycall(schedule, args, s_previous_result)

src/s/y/Sypy-HEAD/annotation/builtin.py   Sypy(Download)
from pypy.annotation.model import SomeUnicodeCodePoint, SomeAddress
from pypy.annotation.model import SomeFloat, unionof, SomeUnicodeString
from pypy.annotation.model import SomePBC, SomeInstance, SomeDict, SomeList
from pypy.annotation.model import SomeWeakRef, SomeIterator
from pypy.annotation.model import SomeOOObject

src/s/y/Sypy-HEAD/annotation/description.py   Sypy(Download)
                s_value = s_value.bind_callables_under(classdef, name)
        elif isinstance(obj, Desc):
            from pypy.annotation.model import SomePBC
            if classdef is not None:
                obj = obj.bind_under(classdef, name)
            s_value = SomePBC([obj])
    def consider_call_site(bookkeeper, family, descs, args, s_result, op):
        from pypy.annotation.model import SomeInstance, SomePBC, s_None
        if len(descs) == 1:
            # call to a single class, look at the result annotation
            # in case it was specialized
    def pycall(self, schedule, args, s_previous_result, op=None):
        from pypy.annotation.model import SomePBC
        s_self = SomePBC([self.frozendesc])
        args = args.prepend(s_self)
        return self.funcdesc.pycall(schedule, args, s_previous_result, op)

  1 | 2  Next