diff --git a/src/black/lines.py b/src/black/lines.py index e9abdaa..d0a7e6d 100644 --- a/src/black/lines.py +++ b/src/black/lines.py @@ -275,8 +275,7 @@ def has_magic_trailing_comma( - it's not a single-element subscript Additionally, if ensure_removable: - it's not from square bracket indexing - (specifically, single-element square bracket indexing with - Preview.skip_magic_trailing_comma_in_subscript) + (specifically, single-element square bracket indexing) """ if not ( closing.type in CLOSING_BRACKETS @@ -308,18 +307,16 @@ def has_magic_trailing_comma( comma = self.leaves[-1] if comma.parent is None: return False - if Preview.skip_magic_trailing_comma_in_subscript in self.mode: - return ( - comma.parent.type != syms.subscriptlist - or closing.opening_bracket is None - or not is_one_sequence_between( - closing.opening_bracket, - closing, - self.leaves, - brackets=(token.LSQB, token.RSQB), - ) + return ( + comma.parent.type != syms.subscriptlist + or closing.opening_bracket is None + or not is_one_sequence_between( + closing.opening_bracket, + closing, + self.leaves, + brackets=(token.LSQB, token.RSQB), ) - return comma.parent.type == syms.listmaker + ) if self.is_import: return True diff --git a/src/black/mode.py b/src/black/mode.py index aef9c1b..8510b94 100644 --- a/src/black/mode.py +++ b/src/black/mode.py @@ -151,7 +151,6 @@ class Preview(Enum): long_docstring_quotes_on_newline = auto() string_processing = auto() - skip_magic_trailing_comma_in_subscript = auto() class Deprecated(UserWarning):