The guidelines for using AI tools when contributing to CPython has just been updated.
These guidelines apply for all forms of contributions in the python GitHub org.
Whether you’re an aspiring contributor or an experienced contributor, and whether or not you use generative AI, please take a moment to read through it:
https://devguide.python.org/getting-started/ai-tools/
The short version
You are responsible for what you submit. Whether an issue or PR was drafted with help from an AI tool or written entirely by hand, the person submitting it is accountable for its content. Generative AI can produce output quickly, but discretion, good judgment, and critical thinking remain the foundation of every good contribution.
Some highlights:
-
Review AI output carefully before opening a PR or filing an issue
-
Be able to explain your changes in your own words. Maintainers may ask.
-
Disclosure of AI tool use is appreciated (though not required). If you do disclose, be prepared to describe how the tool was used and what it changed.
-
Keep changes minimal and focused. Follow existing style, write tests that actually exercise the change, and keep backwards compatibility in mind.
-
Pay close attention to AI-generated test recommendations. It is not acceptable to alter or bypass existing tests, or to remove desired functionality, in order to make a failing test pass. That is not a real fix.
Acceptable uses
Several uses that are generally welcome, including:
-
Help with writing comments, especially for non-native English speakers
-
Building understanding of unfamiliar code
-
Supplementing your own knowledge when working on code, tests, or documentation
Unacceptable uses
Maintainers may close issues and PRs that are not useful or productive, regardless of whether AI tools were involved.
Contributors who repeatedly open unproductive issues or PRs may be blocked, because that pattern is disruptive and disrespectful of maintainers’ time.
Why this matters
The goal here isn’t to discourage anyone from using tools that help them contribute. The goal is to keep the signal-to-noise ratio healthy for the maintainers and reviewers who read every issue and PR. A thoughtful contribution, AI-assisted or not, is always welcome. A flood of unreviewed AI output is not.
Thanks to everyone who reviewed and commented on the devguide PR! It was a long and thoughtful discussion, and the guidelines are stronger for it.
Note that this is not a final word. AI tooling is changing quickly, and we expect these guidelines to continue evolving as the community gains experience with what works and what doesn’t. Feedback, questions, and suggestions are very welcome. Feel free to reply here, open new discussion item, or open an issue or PR against the devguide repo.
Thanks!