Skip to content

Meta issue: improve documentation for implementation of the PEP 3118 in Python #149402

@skirpichev

Description

@skirpichev

Documentation

Recent d.p.o discussion thread and SC decision reveal some problems with current docs. Affected parts are the memoryview and struct/array/ctypes modules. I'll list issues in a random order with a hope that people will extend/correct this list:

  • The struct module docs has Format Characters section. Though, some type codes now have more than one character. We should rename this section and use some different term. Format Codes?
  • array docs says: The type is specified at object creation time by using a type code, which is a single character.
  • memoryview docs are too vague in their references to the struct module:
    • "format" described as being "in struct module style"
    • it might be not clear that means "single element native format" (C type with native byte size, native endianness, and native alignment)
  • ctypes has no documentation for the buffer protocol support at all; though, it's probably most advanced across of the stdlib, see Lib/test/test_ctypes/test_pep3118.py.
  • ctypes._SimpleCData._type_ docs says "Class attribute that contains an internal type code, as a single-character string. See Fundamental data types for a summary."

Metadata

Metadata

Assignees

Labels

docsDocumentation in the Doc dirextension-modulesC modules in the Modules dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions