Skip to content

Commit

Permalink
Document target version inference (#4048)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedGuy12 committed Nov 17, 2023
1 parent 1b6b0bf commit 5773d5c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/usage_and_configuration/the_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ In a [configuration file](#configuration-via-a-file), you can write:
target-version = ["py38", "py39", "py310", "py311"]
```

By default, Black will infer target versions from the project metadata in
`pyproject.toml`, specifically the `[project.requires-python]` field. If this does not
yield conclusive results, Black will use per-file auto-detection.

_Black_ uses this option to decide what grammar to use to parse your code. In addition,
it may use it to decide what style to use. For example, support for a trailing comma
after `*args` in a function call was added in Python 3.5, so _Black_ will add this comma
Expand Down

0 comments on commit 5773d5c

Please sign in to comment.