Skip to content

Commit d16744e

Browse files
committed
Remove flag completely
1 parent d3d4806 commit d16744e

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ Support for this will be dropped in the first half of 2026!
1111

1212
Contributed by Marc Mueller (PR [20156](https://github.com/python/mypy/pull/20156)).
1313

14-
### Deprecated Flag: `--force-union-syntax`
14+
### Removed Flag: `--force-union-syntax`
1515

16-
Mypy only supports Python 3.10+. The `--force-union-syntax` flag is now
17-
deprecated, and a no-op. It will be removed in a future version.
16+
Mypy only supports Python 3.10+. Removed the `--force-union-syntax` flag as it's no longer necessary.
1817

1918
Contributed by Marc Mueller (PR [20405](https://github.com/python/mypy/pull/20405))
2019

mypy/main.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -820,11 +820,6 @@ def add_invertible_flag(
820820
"--force-uppercase-builtins", default=False, help=argparse.SUPPRESS, group=none_group
821821
)
822822

823-
# This flag is deprecated, Mypy only supports Python 3.10+
824-
add_invertible_flag(
825-
"--force-union-syntax", default=False, help=argparse.SUPPRESS, group=none_group
826-
)
827-
828823
lint_group = parser.add_argument_group(
829824
title="Configuring warnings",
830825
description="Detect code that is sound but redundant or problematic.",
@@ -1545,9 +1540,6 @@ def set_strict_flags() -> None:
15451540
if options.force_uppercase_builtins:
15461541
print("Warning: --force-uppercase-builtins is deprecated; mypy only supports Python 3.9+")
15471542

1548-
if options.force_union_syntax:
1549-
print("Warning: --force-union-syntax is deprecated; mypy only supports Python 3.10+")
1550-
15511543
# Set target.
15521544
if special_opts.modules + special_opts.packages:
15531545
options.build_type = BuildType.MODULE

mypy/options.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ def __init__(self) -> None:
412412
self.disable_memoryview_promotion = False
413413
# Deprecated, Mypy only supports Python 3.9+
414414
self.force_uppercase_builtins = False
415-
self.force_union_syntax = False
416415

417416
# Sets custom output format
418417
self.output: str | None = None
@@ -431,14 +430,6 @@ def use_lowercase_names(self) -> bool:
431430
)
432431
return True
433432

434-
def use_or_syntax(self) -> bool:
435-
warnings.warn(
436-
"options.use_or_syntax() is deprecated and will be removed in a future version",
437-
DeprecationWarning,
438-
stacklevel=2,
439-
)
440-
return True
441-
442433
def use_star_unpack(self) -> bool:
443434
return self.python_version >= (3, 11)
444435

0 commit comments

Comments
 (0)