当前位置: 首页>>代码示例>>Python>>正文


Python lists.wrapList函数代码示例

本文整理汇总了Python中typhon.objects.collections.lists.wrapList函数的典型用法代码示例。如果您正苦于以下问题:Python wrapList函数的具体用法?Python wrapList怎么用?Python wrapList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wrapList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _uncall

 def _uncall(self):
     from typhon.objects.collections.lists import wrapList
     from typhon.objects.collections.maps import EMPTY_MAP
     # [1,2,3].asSet().diverge() -> [[[1,2,3], "asSet"], "diverge"]
     rv = wrapList(self.objectSet.keys())
     return [wrapList([rv, StrObject(u"asSet"), wrapList([]), EMPTY_MAP]),
             StrObject(u"diverge"), wrapList([]), EMPTY_MAP]
开发者ID:dckc,项目名称:typhon,代码行数:7,代码来源:sets.py

示例2: _uncall

 def _uncall(self):
     from typhon.objects.makers import theMakeBytes
     from typhon.objects.collections.lists import wrapList
     from typhon.objects.collections.maps import EMPTY_MAP
     ints = [IntObject(ord(c)) for c in self._bs]
     return [theMakeBytes, StrObject(u"fromInts"),
             wrapList([wrapList(ints)]), EMPTY_MAP]
开发者ID:monte-language,项目名称:typhon,代码行数:7,代码来源:data.py

示例3: _uncall

 def _uncall(self):
     from typhon.objects.collections.lists import wrapList
     from typhon.scopes.safe import theMakeMap
     pairs = wrapList([wrapList([k, v])
                       for k, v in self.objectMap.items()])
     rv = wrapList([pairs])
     return [theMakeMap, StrObject(u"fromPairs"), rv, EMPTY_MAP]
开发者ID:monte-language,项目名称:typhon,代码行数:7,代码来源:maps.py

示例4: testListEqualityRecursion

 def testListEqualityRecursion(self):
     first = wrapList([IntObject(42), NullObject])
     # Hax.
     first.objs.append(first)
     second = wrapList([IntObject(42), NullObject])
     # Hax.
     second.objs.append(second)
     self.assertEqual(optSame(first, second), EQUAL)
开发者ID:dckc,项目名称:typhon,代码行数:8,代码来源:test_equality.py

示例5: _uncall

 def _uncall(self):
     from typhon.objects.collections.maps import EMPTY_MAP
     from typhon.scopes.safe import theSlotBinder
     return [wrapList([theSlotBinder, StrObject(u"run"),
                      wrapList([self.guard])]),
             StrObject(u"run"),
             wrapList([self.slot, NullObject]),
             EMPTY_MAP]
开发者ID:dckc,项目名称:typhon,代码行数:8,代码来源:slots.py

示例6: unsealException

def unsealException(specimen, ej):
    """
    Unseal a specimen.
    """

    if isinstance(specimen, SealedException):
        trail = wrapList([StrObject(s) for s in specimen.trail])
        return wrapList([specimen.value, trail])
    throwStr(ej, u"Cannot unseal non-thrown object")
开发者ID:dckc,项目名称:typhon,代码行数:9,代码来源:exceptions.py

示例7: unsealException

def unsealException(specimen, ej):
    """
    Unseal a specimen.
    """

    if isinstance(specimen, SealedException):
        ue = specimen.ue
        trail = wrapList([StrObject(s) for s in ue.formatTrail()])
        return wrapList([ue.getPayload(), trail])
    throwStr(ej, u"Cannot unseal non-thrown object")
开发者ID:monte-language,项目名称:typhon,代码行数:10,代码来源:exceptions.py

示例8: _uncall

 def _uncall(self):
     from typhon.objects.collections.lists import wrapList
     from typhon.objects.collections.maps import EMPTY_MAP
     return [
         makeSourceSpan, StrObject(u"run"),
         wrapList([wrapBool(self._isOneToOne), IntObject(self.startLine),
                    IntObject(self.startCol), IntObject(self.endLine),
                    IntObject(self.endCol)]), EMPTY_MAP]
开发者ID:dckc,项目名称:typhon,代码行数:8,代码来源:data.py

示例9: runMatchers

    def runMatchers(self, atom, args, namedArgs):
        message = wrapList([StrObject(atom.verb), wrapList(args),
                            namedArgs])
        for matcher in self.getMatchers():
            with Ejector() as ej:
                try:
                    return self.runMatcher(matcher, message, ej)
                except Ejecting as e:
                    if e.ejector is ej:
                        # Looks like unification failed. On to the next
                        # matcher!
                        continue
                    else:
                        # It's not ours, cap'n.
                        raise

        raise Refused(self, atom, args)
开发者ID:dckc,项目名称:typhon,代码行数:17,代码来源:user.py

示例10: sendAll

 def sendAll(self, atom, args, namedArgs):
     if self.checkSlot():
         ref = self.resolutionBox.get()
         return send(ref, atom, args, namedArgs)
     else:
         return send(self.handler, HANDLESEND_3, [StrObject(atom.verb),
                                                  wrapList(args),
                                                  namedArgs], EMPTY_MAP)
开发者ID:monte-language,项目名称:typhon,代码行数:8,代码来源:proxy.py

示例11: getAddrInfo

def getAddrInfo(node, service):
    node = unwrapBytes(node)
    service = unwrapBytes(service)
    vat = currentVat.get()
    p, r = makePromise()
    emptyAI = nullptr(ruv.s.addrinfo)
    with io:
        ai = emptyAI
        try:
            ai = ruv.magic_getAddrInfo(vat, node, service)
        except object as err:
            smash(r, StrObject(u"libuv error: %s" % err))
        else:
            resolve(r, wrapList(walkAI(ai)[:]))
    return p
开发者ID:monte-language,项目名称:typhon,代码行数:15,代码来源:dns.py

示例12: connectStream

    def connectStream(self):
        vat = currentVat.get()
        stream = ruv.alloc_tcp(vat.uv_loop)

        source, sourceResolver = makePromise()
        sink, sinkResolver = makePromise()

        # Ugh, the hax.
        resolvers = wrapList([sourceResolver, sinkResolver])
        ruv.stashStream(ruv.rffi.cast(ruv.stream_tp, stream),
                        (vat, resolvers))

        # Make the actual connection.
        ruv.tcpConnect(stream, self.host, self.port, connectStreamCB)

        # Return the promises.
        return [source, sink]
开发者ID:dckc,项目名称:typhon,代码行数:17,代码来源:endpoints.py

示例13: connect

    def connect(self):
        vat = currentVat.get()
        stream = ruv.alloc_tcp(vat.uv_loop)

        fount, fountResolver = makePromise()
        drain, drainResolver = makePromise()

        # Ugh, the hax.
        resolvers = wrapList([fountResolver, drainResolver])
        ruv.stashStream(ruv.rffi.cast(ruv.stream_tp, stream),
                        (vat, resolvers))

        # Make the actual connection.
        ruv.tcpConnect(stream, self.host, self.port, connectCB)

        # Return the promises.
        return [fount, drain]
开发者ID:dckc,项目名称:typhon,代码行数:17,代码来源:endpoints.py

示例14: connectStream

    def connectStream(self):
        """
        Connect this endpoint, returning a `[source, sink]` pair.of vows.
        """

        vat = currentVat.get()
        stream = ruv.alloc_tcp(vat.uv_loop)

        source, sourceResolver = makePromise()
        sink, sinkResolver = makePromise()

        # Ugh, the hax.
        resolvers = wrapList([sourceResolver, sinkResolver])
        ruv.stashStream(ruv.rffi.cast(ruv.stream_tp, stream),
                        (vat, resolvers))
        vat.enqueueEvent(ConnectStreamIOEvent(
            vat, stream, self.host, self.port, self.inet_type))
        # Return the promises.
        return [source, sink]
开发者ID:monte-language,项目名称:typhon,代码行数:19,代码来源:endpoints.py

示例15: uncall

 def uncall(self):
     return wrapList([self._test, self._then, self._otherwise])
开发者ID:dckc,项目名称:typhon,代码行数:2,代码来源:nodes.py


注:本文中的typhon.objects.collections.lists.wrapList函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。