Skip to content

Commit

Permalink
Enable strict_bytes by default
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Dec 30, 2024
1 parent ac6151a commit c39f026
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,9 @@ def add_invertible_flag(
)

add_invertible_flag(
"--strict-bytes",
default=False,
strict_flag=False,
"--no-strict-bytes",
default=True,
dest="strict_bytes",
help="Disable treating bytearray and memoryview as subtypes of bytes",
group=strictness_group,
)
Expand Down
6 changes: 3 additions & 3 deletions mypy/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def __init__(self) -> None:
self.strict_equality = False

# Disable treating bytearray and memoryview as subtypes of bytes
self.strict_bytes = False
self.strict_bytes = True

# Deprecated, use extra_checks instead.
self.strict_concatenate = False
Expand Down Expand Up @@ -386,8 +386,8 @@ def __init__(self) -> None:
# (undocumented feature).
self.export_ref_info = False

self.disable_bytearray_promotion = False
self.disable_memoryview_promotion = False
self.disable_bytearray_promotion = True
self.disable_memoryview_promotion = True
self.force_uppercase_builtins = False
self.force_union_syntax = False

Expand Down
4 changes: 2 additions & 2 deletions mypy/test/testargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from mypy.main import infer_python_executable, process_options
from mypy.options import Options
from mypy.test.helpers import Suite, assert_equal
from mypy.test.helpers import Suite


class ArgSuite(Suite):
Expand All @@ -21,7 +21,7 @@ def test_coherence(self) -> None:
_, parsed_options = process_options([], require_targets=False)
# FIX: test this too. Requires changing working dir to avoid finding 'setup.cfg'
options.config_file = parsed_options.config_file
assert_equal(options.snapshot(), parsed_options.snapshot())
assert options.snapshot() == parsed_options.snapshot()

def test_executable_inference(self) -> None:
"""Test the --python-executable flag with --python-version"""
Expand Down

0 comments on commit c39f026

Please sign in to comment.