MCPcopy Create free account
hub / github.com/ipython/ipython / _enumerate

Method _enumerate

IPython/lib/pretty.py:278–286  ·  view source on GitHub ↗

like enumerate, but with an upper limit on the number of items

(self, seq)

Source from the content-addressed store, hash-verified

276 self.indentation += indent
277
278 def _enumerate(self, seq):
279 """like enumerate, but with an upper limit on the number of items"""
280 for idx, x in enumerate(seq):
281 if self.max_seq_length and idx >= self.max_seq_length:
282 self.text(',')
283 self.breakable()
284 self.text('...')
285 return
286 yield idx, x
287
288 def end_group(self, dedent=0, close=''):
289 """End a group. See `begin_group` for more details."""

Callers 1

innerFunction · 0.80

Calls 2

textMethod · 0.95
breakableMethod · 0.95

Tested by

no test coverage detected