-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Open
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-ctypestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
# Add a code block here, if required
def test_set_type_updates_format(self):
# to match the element type's format
with self.assertWarns(DeprecationWarning):
lp = POINTER("node")
class node(Structure):
_fields_ = [("value", c_int)]
# Get the expected format before set_type
node_format = memoryview(node()).format
expected_format = "&" + node_format
lp.set_type(node)
# Create instance to check format via memoryview
n = node(42)
p = lp(n)
actual_format = memoryview(p).format
# After set_type, the pointer's format should be "&<element_format>"
self.assertEqual(actual_format, expected_format)CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-ctypestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error