本文整理汇总了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))