Skip to content

Conversation

@nswatlan
Copy link

@nswatlan nswatlan commented Dec 4, 2025

  • Recommendation to use specific PyModule/PyObject functions instead of directly manipulating a module's dict attribute
  • Warning that PyModule_GetFilename raises UnicodeEncodeError for unencodable filenames, with suggestion to use alternative function
  • Instruction to always initialize a member to PyModuleDef_HEAD_INIT
  • Explanation of memory allocation/deallocation lifecycle based on m_size when module is created and destroyed
  • Conditions under which a function is NOT called - specifically when module state is requested but not yet allocated (between creation and execution)
  • Description of PyModule_Create function that creates a new module object with default API version setting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant