black breaking changes
Updated December 4, 2026
On this page
Latest version 26.10.1, released October 10, 2026. Source repository
Its 22.1.0 release drops Python 2. Python end of life dates.
- From 25.1.0 to 26.10.1: 75 breaking changes in 3 versions.
- From 22.1.0 to 26.10.1: 165 breaking changes in 6 versions.
black 26.10.1 breaking changes
- Removed
black.linegen.LineGenerator.visit_paramspec
LineGenerator.visit_paramspec was removed in black 26.10.1 pypi.org - Removed
black.linegen.LineGenerator.visit_typeparams
LineGenerator.visit_typeparams was removed in black 26.10.1 pypi.org - Removed
black.linegen.LineGenerator.visit_typevartuple
LineGenerator.visit_typevartuple was removed in black 26.10.1 pypi.org - Removed
black.LineGenerator.visit_paramspec
LineGenerator.visit_paramspec was removed in black 26.10.1 pypi.org - Removed
black.LineGenerator.visit_typeparams
LineGenerator.visit_typeparams was removed in black 26.10.1 pypi.org - Removed
black.LineGenerator.visit_typevartuple
LineGenerator.visit_typevartuple was removed in black 26.10.1 pypi.org - Removed
black.nodes.CACHE_DIR
black.nodes.CACHE_DIR was removed in black 26.10.1 pypi.org - Behavior changed
tool.black.required-version
The Black GitHub Action only accepts released Black versions in tool.black.required-version and now rejects other values such as URL references. Users with such values must change them to a released version. github.com - Signature changed
black.cache.Cache.read
Was @classmethod def read(cls, mode: Mode) -> Self; now @classmethod def read(cls, mode: Mode, cache_dir: Path = CACHE_DIR) -> Self. pypi.org - Signature changed
black.cache.get_cache_dir
Was def get_cache_dir() -> Path; now def get_cache_dir(cache_dir: Path | None = None) -> Path. pypi.org - Signature changed
black.cache.get_cache_file
Was def get_cache_file(mode: Mode) -> Path; now def get_cache_file(mode: Mode, cache_dir: Path) -> Path. pypi.org - Signature changed
black.Cache.read
Was @classmethod def read(cls, mode: Mode) -> Self; now @classmethod def read(cls, mode: Mode, cache_dir: Path = CACHE_DIR) -> Self. pypi.org - Signature changed
black.concurrency.reformat_many
Was def reformat_many(sources: set[Path], fast: bool, write_back: WriteBack, mode: Mode, report: Report, workers: int | None, no_cache: bool = False) -> None; now def reformat_many(sources: set[Path], fast: bool, write_back: WriteBack... pypi.org - Signature changed
black.concurrency.schedule_formatting
Was async def schedule_formatting(sources: set[Path], fast: bool, write_back: WriteBack, mode: Mode, report: Report, loop: asyncio.AbstractEventLoop, executor: Executor, no_cache: bool = False) -> None; now async def... pypi.org - Signature changed
black.main
Was def main(ctx: click.Context, code: str | None, line_length: int, target_version: list[TargetVersion], check: bool, diff: bool, line_ranges: Sequence[str], color: bool, fast: bool, pyi: bool, ipynb: bool, python_cell_magics... pypi.org - Signature changed
black.reformat_one
Was def reformat_one(src: Path, fast: bool, write_back: WriteBack, mode: Mode, report: Report, *, lines: Collection[tuple[int, int]] = (), no_cache: bool = False) -> None; now def reformat_one(src: Path, fast: bool, write_back: WriteBack... pypi.org - Signature changed
blib2to3.pygram.initialize
Was def initialize(cache_dir: Union[str, os.PathLike[str], None] = None) -> None; now def initialize(cache_dir: Union[str, os.PathLike[str], None] = None, *, save: bool = True) -> None. pypi.org
black 26.10.0 breaking changes
- Removed
black.nodes.RARROW
black.nodes.RARROW was removed in black 26.10.0 pypi.org - Removed
migrate-black
The migrate-black script is removed. Stop calling it; no replacement is named. github.com - Behavior changed
A t-string as the first statement of a module, class or function is no longer treated as a docstring. Code relying on it as a docstring will change. github.com - Behavior changed
Parser failures are now reported as path:line:column locations, so tools parsing the old error output may need updating. github.com - Behavior changed
Form feeds and similar characters in docstrings are kept rather than converted to newlines. github.com - Configuration changed
tool.black.force-exclude
Non-string force-exclude values in pyproject.toml are now rejected. Make sure the force-exclude value is a string. github.com - Configuration changed
tool.black.include
Non-string include values in pyproject.toml are now rejected. Make sure the include value is a string. github.com - Signature changed
black.comments.convert_one_fmt_off_pair
Was def convert_one_fmt_off_pair(node: Node, mode: Mode, lines: Collection[tuple[int, int]]) -> bool; now def convert_one_fmt_off_pair(node: Node, leaves: list[Leaf], start: int, mode: Mode, lines: Collection[tuple[int, int]]... pypi.org - Signature changed
black.comments.generate_comments
Was def generate_comments(leaf: LN, mode: Mode) -> Iterator[Leaf]; now def generate_comments(leaf: LN, mode: Mode, *, preserve_comment_formatting: bool = False, line_ranges_first_lineno: int = 0, line_ranges_selected: set[int] | None =... pypi.org - Signature changed
black.comments.ProtoComment.__init__
Was def __init__(self, type: int, value: str, newlines: int, consumed: int, form_feed: bool, leading_whitespace: str) -> None; now def __init__(self, type: int, value: str, newlines: int, consumed: int, form_feed: bool, leading_whitespace... pypi.org
And 23 more in this version. Sign up to see every change
black 26.1.0 breaking changes
- Removed
black.comments.Preview
black.comments.Preview was removed in black 26.1.0 pypi.org - Removed
black.lines.Preview
black.lines.Preview was removed in black 26.1.0 pypi.org - Removed
black.nodes.Preview
black.nodes.Preview was removed in black 26.1.0 pypi.org - Removed
black.Preview.always_one_newline_after_import
Preview.always_one_newline_after_import was removed in black 26.1.0 pypi.org - Removed
black.Preview.fix_fmt_skip_in_one_liners
Preview.fix_fmt_skip_in_one_liners was removed in black 26.1.0 pypi.org - Removed
black.Preview.fix_module_docstring_detection
Preview.fix_module_docstring_detection was removed in black 26.1.0 pypi.org - Removed
black.Preview.fix_type_expansion_split
Preview.fix_type_expansion_split was removed in black 26.1.0 pypi.org - Removed
black.Preview.multiline_string_handling
Preview.multiline_string_handling was removed in black 26.1.0 pypi.org - Removed
black.Preview.normalize_cr_newlines
Preview.normalize_cr_newlines was removed in black 26.1.0 pypi.org - Removed
black.Preview.remove_parens_around_except_types
Preview.remove_parens_around_except_types was removed in black 26.1.0 pypi.org
And 15 more in this version. Sign up to see every change
black 25.1.0 breaking changes
- Removed
black.comments.Preview
black.comments.Preview was removed in black 25.1.0 pypi.org - Removed
black.handle_ipynb_magics.TOKEN_HEX
black.handle_ipynb_magics.TOKEN_HEX was removed in black 25.1.0 pypi.org - Removed
black.nodes.Preview
black.nodes.Preview was removed in black 25.1.0 pypi.org - Removed
black.Preview.docstring_check_for_newline
Preview.docstring_check_for_newline was removed in black 25.1.0 pypi.org - Removed
black.Preview.hex_codes_in_unicode_sequences
Preview.hex_codes_in_unicode_sequences was removed in black 25.1.0 pypi.org - Removed
black.Preview.is_simple_lookup_for_doublestar_expression
Preview.is_simple_lookup_for_doublestar_expression was removed in black 25.1.0 pypi.org - Removed
black.Preview.no_normalize_fmt_skip_whitespace
Preview.no_normalize_fmt_skip_whitespace was removed in black 25.1.0 pypi.org - Removed
black.Preview.parens_for_long_if_clauses_in_case_block
Preview.parens_for_long_if_clauses_in_case_block was removed in black 25.1.0 pypi.org - Removed
black.Preview.pep646_typed_star_arg_type_var_tuple
Preview.pep646_typed_star_arg_type_var_tuple was removed in black 25.1.0 pypi.org - Removed
black.Preview.remove_redundant_guard_parens
Preview.remove_redundant_guard_parens was removed in black 25.1.0 pypi.org
And 13 more in this version. Sign up to see every change
black 24.1.0 breaking changes
- Removed
--experimental-string-processing
The flag is gone. Use --preview with --enable-unstable-feature string_processing instead. github.com - Removed
black.comments.Preview.accept_raw_docstrings
Preview.accept_raw_docstrings was removed in black 24.1.0 pypi.org - Removed
black.comments.Preview.add_trailing_comma_consistently
Preview.add_trailing_comma_consistently was removed in black 24.1.0 pypi.org - Removed
black.comments.Preview.allow_empty_first_line_in_block
Preview.allow_empty_first_line_in_block was removed in black 24.1.0 pypi.org - Removed
black.comments.Preview.allow_form_feeds
Preview.allow_form_feeds was removed in black 24.1.0 pypi.org - Removed
black.comments.Preview.blank_line_after_nested_stub_class
Preview.blank_line_after_nested_stub_class was removed in black 24.1.0 pypi.org - Removed
black.comments.Preview.blank_line_between_nested_and_def_stub_file
Preview.blank_line_between_nested_and_def_stub_file was removed in black 24.1.0 pypi.org - Removed
black.comments.Preview.dummy_implementations
Preview.dummy_implementations was removed in black 24.1.0 pypi.org - Removed
black.comments.Preview.fix_power_op_line_length
Preview.fix_power_op_line_length was removed in black 24.1.0 pypi.org - Removed
black.comments.Preview.improved_async_statements_handling
Preview.improved_async_statements_handling was removed in black 24.1.0 pypi.org
And 30 more in this version. Sign up to see every change
black 23.1.0 breaking changes
- Removed
black.linegen.Preview.annotation_parens
Preview.annotation_parens was removed in black 23.1.0 pypi.org - Removed
black.linegen.Preview.empty_lines_before_class_or_def_with_leading_comments
Preview.empty_lines_before_class_or_def_with_leading_comments was removed in black 23.1.0 pypi.org - Removed
black.linegen.Preview.handle_trailing_commas_in_head
Preview.handle_trailing_commas_in_head was removed in black 23.1.0 pypi.org - Removed
black.linegen.Preview.long_docstring_quotes_on_newline
Preview.long_docstring_quotes_on_newline was removed in black 23.1.0 pypi.org - Removed
black.linegen.Preview.normalize_docstring_quotes_and_prefixes_properly
Preview.normalize_docstring_quotes_and_prefixes_properly was removed in black 23.1.0 pypi.org - Removed
black.linegen.Preview.one_element_subscript
Preview.one_element_subscript was removed in black 23.1.0 pypi.org - Removed
black.linegen.Preview.remove_block_trailing_newline
Preview.remove_block_trailing_newline was removed in black 23.1.0 pypi.org - Removed
black.linegen.Preview.remove_redundant_parens
Preview.remove_redundant_parens was removed in black 23.1.0 pypi.org - Removed
black.lines.Preview
black.lines.Preview was removed in black 23.1.0 pypi.org - Removed
black.trans.BracketMatchError
black.trans.BracketMatchError was removed in black 23.1.0 pypi.org
And 17 more in this version. Sign up to see every change
Older versions
5 older versions, each with its first changes. Sign up to see every change
Show 5 older versions
black 22.1.0 breaking changes
- Removed
Black no longer supports running on or formatting for Python 2. Users still on Python 2 must stay on an earlier release. github.com - Behavior changed
Formatting now rewrites string prefixes into a normalized order, changing output for existing code. github.com
And 4 more in this version.
black 21.5b2 breaking changes
- Behavior changed
Formatting no longer inserts a space into empty docstrings, so output for those files changes. github.com
black 20.8b1 breaking changes
- Configuration changed
Black no longer works with Click versions older than 7.0; install Click 7.1.2 or newer. github.com
black 20.8b0 breaking changes
- Removed
--py36
The deprecated --py36 option is removed; use --target-version instead. github.com - Behavior changed
Black now exits with code 2 when a specified configuration file does not exist. github.com
And 1 more in this version.
black 18.3a4 breaking changes
- Behavior changed
--check
Black stopped returning exit code 1 for ordinary runs; only --check triggers it. Scripts relying on the old exit code must change. github.com
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.