當前位置: 首頁>>代碼示例>>Python>>正文


Python __builtin__.zip方法代碼示例

本文整理匯總了Python中__builtin__.zip方法的典型用法代碼示例。如果您正苦於以下問題:Python __builtin__.zip方法的具體用法?Python __builtin__.zip怎麽用?Python __builtin__.zip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在__builtin__的用法示例。


在下文中一共展示了__builtin__.zip方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _get_conditional_content

# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def _get_conditional_content(self, fname, spans, conditions, contents):
        out = []
        ieval = []
        peval = []
        multiline = (spans[0][0] != spans[-1][1])
        for condition, content, span in zip(conditions, contents, spans):
            try:
                cond = bool(self._evaluate(condition, fname, span[0]))
            except Exception as exc:
                msg = "exception occurred when evaluating '{0}'"\
                      .format(condition)
                raise FyppFatalError(msg, fname, span, exc)
            if cond:
                if self._linenums and not self._diverted and multiline:
                    out.append(linenumdir(span[1], fname))
                outcont, ievalcont, pevalcont = self._render(content)
                ieval += _shiftinds(ievalcont, len(out))
                peval += pevalcont
                out += outcont
                break
        if self._linenums and not self._diverted and multiline:
            out.append(linenumdir(spans[-1][1], fname))
        return out, ieval, peval 
開發者ID:aradi,項目名稱:fypp,代碼行數:25,代碼來源:fypp.py

示例2: lzip

# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
開發者ID:Soft8Soft,項目名稱:verge3d-blender-addon,代碼行數:4,代碼來源:__init__.py

示例3: oldzip

# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def oldzip(*args, **kwargs):
        return list(builtins.zip(*args, **kwargs)) 
開發者ID:remg427,項目名稱:misp42splunk,代碼行數:4,代碼來源:noniterators.py

示例4: _coconut_igetitem

# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def _coconut_igetitem(iterable, index):
    if isinstance(iterable, (_coconut_reversed, _coconut_map, _coconut.zip, _coconut_enumerate, _coconut_count, _coconut.abc.Sequence)):
        return iterable[index]
    if not _coconut.isinstance(index, _coconut.slice):
        if index < 0:
            return _coconut.collections.deque(iterable, maxlen=-index)[0]
        return _coconut.next(_coconut.itertools.islice(iterable, index, index + 1))
    if index.start is not None and index.start < 0 and (index.stop is None or index.stop < 0) and index.step is None:
        queue = _coconut.collections.deque(iterable, maxlen=-index.start)
        if index.stop is not None:
            queue = _coconut.list(queue)[:index.stop - index.start]
        return queue
    if (index.start is not None and index.start < 0) or (index.stop is not None and index.stop < 0) or (index.step is not None and index.step < 0):
        return _coconut.list(iterable)[index]
    return _coconut.itertools.islice(iterable, index.start, index.stop, index.step) 
開發者ID:evhub,項目名稱:pyprover,代碼行數:17,代碼來源:__coconut__.py

示例5: __new__

# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def __new__(cls, *iterables):
        new_zip = _coconut.zip.__new__(cls, *iterables)
        new_zip.iters = iterables
        return new_zip 
開發者ID:evhub,項目名稱:pyprover,代碼行數:6,代碼來源:__coconut__.py

示例6: __repr__

# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def __repr__(self):
        return "zip(%s)" % (", ".join((_coconut.repr(i) for i in self.iters)),) 
開發者ID:evhub,項目名稱:pyprover,代碼行數:4,代碼來源:__coconut__.py

示例7: lzip

# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def lzip(*args, **kwargs):
        return list(zip(*args, **kwargs)) 
開發者ID:nccgroup,項目名稱:Splunking-Crime,代碼行數:4,代碼來源:python.py


注:本文中的__builtin__.zip方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。