本文整理匯總了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
示例2: lzip
# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def lzip(*args, **kwargs):
return list(zip(*args, **kwargs))
示例3: oldzip
# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def oldzip(*args, **kwargs):
return list(builtins.zip(*args, **kwargs))
示例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)
示例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
示例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)),)
示例7: lzip
# 需要導入模塊: import __builtin__ [as 別名]
# 或者: from __builtin__ import zip [as 別名]
def lzip(*args, **kwargs):
return list(zip(*args, **kwargs))