💾 Archived View for dcreager.net › languages › python › black-comments.gmi captured on 2024-12-17 at 09:33:51. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Python's official grammar does not include comments in its AST. This article is a nice description of how Black (the Python linter) stores comments without having to make invasive (and hard to verify) changes to the AST structure.
How Black Handles Comments When Python's Grammar Ignores Them