Skip to content

Add a .gitignore file to each __pycache__ folder #141081

@gvanrossum

Description

@gvanrossum

Feature or enhancement

Proposal:

When creating a __pycache__ folder, add a .gitignore file with the content

# Created by CPython
*

I've seen this pattern appear in a few places (coverage.py's htmlcov folder, .venv, .pytest_cache) and it saves projects from having to add such things to their main .gitignore.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-importlibtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions