MCPcopy Index your code
hub / github.com/python/cpython / BadIndex

Class BadIndex

Lib/test/test_struct.py:294–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292 # If the '__index__' method raises a type error, then
293 # '__int__' should be used with a deprecation warning.
294 class BadIndex(object):
295 def __index__(self):
296 raise TypeError
297
298 def __int__(self):
299 return 42
300
301 self.assertRaises((TypeError, struct.error),
302 struct.pack, self.format,

Callers 1

runMethod · 0.70

Calls

no outgoing calls

Tested by 1

runMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…