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

Class MyStruct

Lib/test/test_struct.py:838–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836 def test_custom_struct_init(self):
837 # Regression test for https://github.com/python/cpython/issues/112358
838 class MyStruct(struct.Struct):
839 def __init__(self, *args, **kwargs):
840 super().__init__('>h')
841
842 my_struct = MyStruct('>h')
843 self.assertEqual(my_struct.pack(12345), b'\x30\x39')

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…