Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Enable strict_bytes by default
  • Loading branch information
hauntsaninja committed Dec 30, 2024
commit c39f0265dbad7658d9d1c9407db7cbe93b19d68b
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