Skip to content

refactor: simplify and modernize mkdoc_lib - #63

Open
henryiii wants to merge 1 commit into
masterfrom
refactor-mkdoc-cleanup
Open

refactor: simplify and modernize mkdoc_lib#63
henryiii wants to merge 1 commit into
masterfrom
refactor-mkdoc-cleanup

Conversation

@henryiii

@henryiii henryiii commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Addresses the simplification and modernization items from the review in #59. Cleanup only, the generated headers stay identical.

  • param_arg_re and raises_arg_re were the same pattern, so they are now one named_arg_re.
  • extract() mixed return 0 and return None, but no caller reads the value. The returns are gone.
  • CPP_OPERATORS uses a plain dict, which keeps insertion order since Python 3.7. The sort by length stays.
  • The d() helper decoded bytes for Python 2. The python3 cindex bindings give str, so it and its call sites are removed.
  • write_header uses an f-string, and sanitize_name uses str.removesuffix.
  • The inline re.sub patterns of process_comment are precompiled module-level constants.

Cleanup only, no behavior change:

- merge the identical param_arg_re and raises_arg_re into named_arg_re
- drop the unused return values from extract()
- use a plain dict for CPP_OPERATORS, which keeps the by-length order
- remove the Python 2 d() decode helper; cindex gives str
- use an f-string in write_header and str.removesuffix in sanitize_name
- precompile the inline regexes of process_comment at module level

Assisted-by: ClaudeCode:claude-fable-5
@henryiii
henryiii marked this pull request as draft August 6, 2026 18:18
@henryiii
henryiii marked this pull request as ready for review August 6, 2026 20:11
@henryiii henryiii closed this Aug 7, 2026
@henryiii henryiii reopened this Aug 7, 2026
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