Deep-Software-Analytics/SweSetupBench-lite huggingface dataset:
Repository: pallets/click

Problem statement:
Validate *args passed to `click.option`
See https://github.com/pallets/click/issues/568



Hints:

Patch:
diff --git a/click/core.py b/click/core.py
--- a/click/core.py
+++ b/click/core.py
@@ -1324,7 +1324,7 @@ def __init__(self, param_decls=None, type=None, required=False,
         self.is_eager = is_eager
         self.metavar = metavar
         self.envvar = envvar
-        self.autocompletion =  autocompletion
+        self.autocompletion = autocompletion
 
     @property
     def human_readable_name(self):
@@ -1355,7 +1355,6 @@ def get_default(self, ctx):
     def add_to_parser(self, parser, ctx):
         pass
 
-
     def consume_value(self, ctx, opts):
         value = opts.get(self.name)
         if value is None:
@@ -1805,11 +1804,9 @@ def _parse_decls(self, decls, expose_value):
         if len(decls) == 1:
             name = arg = decls[0]
             name = name.replace('-', '_').lower()
-        elif len(decls) == 2:
-            name, arg = decls
         else:
-            raise TypeError('Arguments take exactly one or two '
-                            'parameter declarations, got %d' % len(decls))
+            raise TypeError('Arguments take exactly one '
+                            'parameter declaration, got %d' % len(decls))
         return name, [arg], []
 
     def get_usage_pieces(self, ctx):


Test patch:
diff --git a/tests/test_arguments.py b/tests/test_arguments.py
--- a/tests/test_arguments.py
+++ b/tests/test_arguments.py
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+import pytest
 import click
 from click._compat import PY2
 
@@ -287,3 +288,11 @@ def cmd(a):
     result = runner.invoke(cmd, ['3'])
     assert result.exception is not None
     assert 'argument a takes 2 values' in result.output
+
+
+def test_multiple_param_decls_not_allowed(runner):
+    with pytest.raises(TypeError):
+        @click.command()
+        @click.argument('x', click.Choice(['a', 'b']))
+        def copy(x):
+            click.echo(x)
Repository: pallets/click

Problem statement:
Automatically dedent help text of options?
```
import click

@click.command()
@click.option('--foo', help="""
    heyho

    i am

    multiline
""")
def cli(foo):
    click.echo(foo)

cli()
```

This currently does not remove the leading whitespace from each paragraph in the help text for `--foo`:

```
untitaker@untibox:~/projects/click, branch master
$ python lol.py --help
Usage: lol.py [OPTIONS]

Options:
  --foo TEXT
                  heyho

                  i am

                  multiline
  --help      Show this message and exit.
```

Although i am not sure if help texts for options are even supposed to get that
complex.



Hints:
From what i can see in `write_dl`, this seems to be a bug.


Patch:
diff --git a/click/decorators.py b/click/decorators.py
--- a/click/decorators.py
+++ b/click/decorators.py
@@ -150,6 +150,8 @@ def option(*param_decls, **attrs):
     :attr:`Command.params` list.
     """
     def decorator(f):
+        if 'help' in attrs:
+            attrs['help'] = inspect.cleandoc(attrs['help'])
         _param_memo(f, Option(param_decls, **attrs))
         return f
     return decorator


Test patch:
diff --git a/tests/test_options.py b/tests/test_options.py
--- a/tests/test_options.py
+++ b/tests/test_options.py
@@ -169,3 +169,23 @@ def cmd(foo):
     assert result.exit_code == 2
     assert 'Error: Missing option "--foo".  Choose from foo, bar.' \
         in result.output
+
+
+def test_multiline_help(runner):
+    @click.command()
+    @click.option('--foo', help="""
+        hello
+
+        i am
+
+        multiline
+    """)
+    def cmd(foo):
+        click.echo(foo)
+
+    result = runner.invoke(cmd, ['--help'])
+    assert result.exit_code == 0
+    out = result.output.splitlines()
+    assert '  --foo TEXT  hello' in out
+    assert '              i am' in out
+    assert '              multiline' in out
Repository: reduxjs/redux-toolkit

Problem statement:
`TypedUseMutationTrigger` should not contain the word "Use"
`TypedUseMutationTrigger` is a helpful wrapper for `MutationTrigger` (thanks for adding it by the way! It resolved an issue I was facing). However, the name is inconsistent. `TypedUseMutation` is a wrapper for `UseMutation`. The extra `Use` breaks the parallel naming structure.


Hints:

Patch:
diff --git a/packages/toolkit/src/query/react/buildHooks.ts b/packages/toolkit/src/query/react/buildHooks.ts
--- a/packages/toolkit/src/query/react/buildHooks.ts
+++ b/packages/toolkit/src/query/react/buildHooks.ts
@@ -589,7 +589,7 @@ export type MutationTrigger<D extends MutationDefinition<any, any, any, any>> =
     (arg: QueryArgFrom<D>): MutationActionCreatorResult<D>
   }
 
-export type TypedUseMutationTrigger<
+export type TypedMutationTrigger<
   ResultType,
   QueryArg,
   BaseQuery extends BaseQueryFn,
diff --git a/packages/toolkit/src/query/react/index.ts b/packages/toolkit/src/query/react/index.ts
--- a/packages/toolkit/src/query/react/index.ts
+++ b/packages/toolkit/src/query/react/index.ts
@@ -21,7 +21,7 @@ export type {
   TypedLazyQueryTrigger,
   TypedUseLazyQuery,
   TypedUseMutation,
-  TypedUseMutationTrigger,
+  TypedMutationTrigger,
   TypedUseQueryState,
   TypedUseQuery,
   TypedUseQuerySubscription,


Test patch:
diff --git a/packages/toolkit/src/query/tests/unionTypes.test-d.ts b/packages/toolkit/src/query/tests/unionTypes.test-d.ts
--- a/packages/toolkit/src/query/tests/unionTypes.test-d.ts
+++ b/packages/toolkit/src/query/tests/unionTypes.test-d.ts
@@ -10,7 +10,7 @@ import type {
   TypedUseLazyQuery,
   TypedUseLazyQuerySubscription,
   TypedUseMutation,
-  TypedUseMutationTrigger,
+  TypedMutationTrigger,
   TypedUseQuerySubscription,
   TypedUseQuery,
 } from '@reduxjs/toolkit/query/react'
@@ -838,7 +838,7 @@ describe('"Typed" helper types', () => {
     const [trigger, result] = api.endpoints.mutation.useMutation()
 
     expectTypeOf<
-      TypedUseMutationTrigger<string, void, typeof baseQuery>
+      TypedMutationTrigger<string, void, typeof baseQuery>
     >().toMatchTypeOf(trigger)
 
     expectTypeOf<
Repository: reduxjs/redux-toolkit

Problem statement:
Clarifying error message about type in addCase
I am newbie in RTK and when I met error `'builder.addCase' cannot be called with two reducers for the same action type` I cannot recognize which one of my types is duplcated.
I solved my problem with devtools logpoint but it's not convenient at all
![image](https://github.com/reduxjs/redux-toolkit/assets/1235286/45847738-0573-40de-a5d6-48f59e053028)
![image](https://github.com/reduxjs/redux-toolkit/assets/1235286/8278f088-a35d-49e6-bf25-540d2dd9258c)

It would be great if error will contain type. For example:
`'builder.addCase' cannot be called with two reducers for the same action type ${type}`


Hints:
Sure, makes sense. Can you file a PR to tweak that?
@markerikson Sure!

Patch:
diff --git a/packages/toolkit/src/mapBuilders.ts b/packages/toolkit/src/mapBuilders.ts
--- a/packages/toolkit/src/mapBuilders.ts
+++ b/packages/toolkit/src/mapBuilders.ts
@@ -166,7 +166,7 @@ export function executeReducerBuilderCallback<S>(
       }
       if (type in actionsMap) {
         throw new Error(
-          '`builder.addCase` cannot be called with two reducers for the same action type'
+          `\`builder.addCase\` cannot be called with two reducers for the same action type '${type}'`
         )
       }
       actionsMap[type] = reducer


Test patch:
diff --git a/packages/toolkit/src/tests/createReducer.test.ts b/packages/toolkit/src/tests/createReducer.test.ts
--- a/packages/toolkit/src/tests/createReducer.test.ts
+++ b/packages/toolkit/src/tests/createReducer.test.ts
@@ -460,7 +460,7 @@ describe('createReducer', () => {
             .addCase(decrement, (state, action) => state - action.payload)
         )
       ).toThrowErrorMatchingInlineSnapshot(
-        '"`builder.addCase` cannot be called with two reducers for the same action type"'
+        '"`builder.addCase` cannot be called with two reducers for the same action type \'increment\'"'
       )
       expect(() =>
         createReducer(0, (builder) =>
@@ -470,7 +470,7 @@ describe('createReducer', () => {
             .addCase(decrement, (state, action) => state - action.payload)
         )
       ).toThrowErrorMatchingInlineSnapshot(
-        '"`builder.addCase` cannot be called with two reducers for the same action type"'
+        '"`builder.addCase` cannot be called with two reducers for the same action type \'increment\'"'
       )
     })
Repository: reduxjs/redux-toolkit

Problem statement:
BaseQuery meta types stripped when using retry()
When I wrap the base query into `retry()`, the resulting api is unaware of the meta types.



Hints:

Patch:
diff --git a/packages/toolkit/src/query/baseQueryTypes.ts b/packages/toolkit/src/query/baseQueryTypes.ts
--- a/packages/toolkit/src/query/baseQueryTypes.ts
+++ b/packages/toolkit/src/query/baseQueryTypes.ts
@@ -54,7 +54,8 @@ export type BaseQueryEnhancer<
   BaseQueryArg<BaseQuery> & AdditionalArgs,
   BaseQueryResult<BaseQuery>,
   BaseQueryError<BaseQuery>,
-  BaseQueryExtraOptions<BaseQuery> & AdditionalDefinitionExtraOptions
+  BaseQueryExtraOptions<BaseQuery> & AdditionalDefinitionExtraOptions,
+  NonNullable<BaseQueryMeta<BaseQuery>>
 >
 
 export type BaseQueryResult<BaseQuery extends BaseQueryFn> = UnwrapPromise<


Test patch:
diff --git a/packages/toolkit/src/query/tests/baseQueryTypes.typetest.ts b/packages/toolkit/src/query/tests/baseQueryTypes.typetest.ts
new file mode 100644
--- /dev/null
+++ b/packages/toolkit/src/query/tests/baseQueryTypes.typetest.ts
@@ -0,0 +1,33 @@
+import { createApi, fetchBaseQuery, retry } from '@reduxjs/toolkit/query'
+
+/**
+ * Test: BaseQuery meta types propagate to endpoint callbacks
+ */
+{
+  createApi({
+    baseQuery: fetchBaseQuery(),
+    endpoints: (build) => ({
+      getDummy: build.query<null, undefined>({
+        query: () => 'dummy',
+        onCacheEntryAdded: async (arg, { cacheDataLoaded }) => {
+          const { meta } = await cacheDataLoaded
+          const { request, response } = meta! // Expect request and response to be there
+        },
+      }),
+    }),
+  })
+
+  const baseQuery = retry(fetchBaseQuery()) // Even when wrapped with retry
+  createApi({
+    baseQuery,
+    endpoints: (build) => ({
+      getDummy: build.query<null, undefined>({
+        query: () => 'dummy',
+        onCacheEntryAdded: async (arg, { cacheDataLoaded }) => {
+          const { meta } = await cacheDataLoaded
+          const { request, response } = meta! // Expect request and response to be there
+        },
+      }),
+    }),
+  })
+}
Repository: python-attrs/attrs

Problem statement:
unhelpful message "ValueError: Type annotation and type argument cannot both be present"
Getting this message because I both have the type annotation and type defined on a custom attribute class which is reasonable considering the ambiguity.

However I think the message itself could be more helpful by displaying the name of the attribute to eliminate the variable hunt.

My suggested change is:

https://github.com/python-attrs/attrs/blob/2afd663bf40e4a8209986accdfb1e2d53afc15e2/src/attr/_make.py#L2354
```python
    @classmethod
    def from_counting_attr(cls, name, ca, type=None):
        # type holds the annotated value. deal with conflicts:
        if type is None:
            type = ca.type
        elif ca.type is not None:
            raise ValueError(
                f"Type annotation and type argument for {name} cannot both be present"
            )
        inst_dict = {
            k: getattr(ca, k)
            for k
            in Attribute.__slots__
            if k not in (
                "name", "validator", "default", "type", "convert",
            )  # exclude methods and deprecated alias
        }
        return cls(
            name=name, validator=ca._validator, default=ca._default, type=type,
            **inst_dict
        )
 ```


Hints:

Patch:
diff --git a/src/attr/_make.py b/src/attr/_make.py
--- a/src/attr/_make.py
+++ b/src/attr/_make.py
@@ -2491,7 +2491,7 @@ def from_counting_attr(cls, name: str, ca: _CountingAttr, type=None):
         if type is None:
             type = ca.type
         elif ca.type is not None:
-            msg = "Type annotation and type argument cannot both be present"
+            msg = f"Type annotation and type argument cannot both be present for '{name}'."
             raise ValueError(msg)
         return cls(
             name,


Test patch:
diff --git a/tests/test_annotations.py b/tests/test_annotations.py
--- a/tests/test_annotations.py
+++ b/tests/test_annotations.py
@@ -62,7 +62,7 @@ class C:
                 x: int = attr.ib(type=int)
 
         assert (
-            "Type annotation and type argument cannot both be present",
+            "Type annotation and type argument cannot both be present for 'x'.",
         ) == e.value.args
 
     def test_typing_annotations(self):
Repository: python-attrs/attrs

Problem statement:
AttrsInstance is only a Protocol in mypy
`__init__.pyi` defines AttrsInstance as follows:
```
class AttrsInstance(AttrsInstance_, Protocol):
    pass
```

So the following typechecks correctly:
```
import attr
from typing import Protocol

class Foo(attr.AttrsInstance, Protocol):
    def attribute(self) -> int:
        ...


def bar(foo: Foo) -> int:
    return foo.attribute()

@attr.define
class CFoo:
    a: int

    def attribute(self) -> int:
        return self.a

bar(CFoo(15))
```

But if you run it you get:

`TypeError: Protocols can only inherit from other protocols, got <class 'attr.AttrsInstance'>`

Because in `__init__.py` it's defined as:
```
class AttrsInstance:
    pass
```

instead of 
```
class AttrsInstance(Protocol):
    pass
```


Hints:
Ah. Looks like a workaround is to do:

```
class Foo(Protocol):
    __attrs_attrs__: ClassVar[Any]
   def attribute(self) -> int:
        ...
```
Is this anything we can fix in attrs?
I think just the small change I said, I can make a PR. But probably not until next week.

It should just be:
```
from typing import Protocol

class AttrsInstance(Protocol):
    pass
```


Patch:
diff --git a/src/attr/__init__.py b/src/attr/__init__.py
--- a/src/attr/__init__.py
+++ b/src/attr/__init__.py
@@ -9,6 +9,7 @@
 
 from . import converters, exceptions, filters, setters, validators
 from ._cmp import cmp_using
+from ._compat import Protocol
 from ._config import get_run_validators, set_run_validators
 from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
 from ._make import (
@@ -31,7 +32,7 @@
 dataclass = partial(attrs, auto_attribs=True)  # happy Easter ;)
 
 
-class AttrsInstance:
+class AttrsInstance(Protocol):
     pass
 
 
diff --git a/src/attr/_compat.py b/src/attr/_compat.py
--- a/src/attr/_compat.py
+++ b/src/attr/_compat.py
@@ -18,6 +18,15 @@
 PY_3_12_PLUS = sys.version_info[:2] >= (3, 12)
 
 
+if sys.version_info < (3, 8):
+    try:
+        from typing_extensions import Protocol
+    except ImportError:  # pragma: no cover
+        Protocol = object
+else:
+    from typing import Protocol  # noqa: F401
+
+
 def just_warn(*args, **kw):
     warnings.warn(
         "Running interpreter doesn't sufficiently support code object "


Test patch:
diff --git a/tests/test_compat.py b/tests/test_compat.py
--- a/tests/test_compat.py
+++ b/tests/test_compat.py
@@ -4,6 +4,8 @@
 
 import pytest
 
+import attr
+
 
 @pytest.fixture(name="mp")
 def _mp():
@@ -50,3 +52,13 @@ def test_immutable(self, mp):
 
         with pytest.raises(AttributeError, match="no attribute 'setdefault'"):
             mp.setdefault("x")
+
+
+def test_attrsinstance_subclass_protocol():
+    """
+    It's possible to subclass AttrsInstance and Protocol at once.
+    """
+
+    class Foo(attr.AttrsInstance, attr._compat.Protocol):
+        def attribute(self) -> int:
+            ...
Repository: python-attrs/attrs

Problem statement:
Optional validator should handle a tuple of validators
See relevant discussion in this discussion:
https://github.com/python-attrs/attrs/pull/925#discussion_r827665676


Hints:

Patch:
diff --git a/src/attr/validators.py b/src/attr/validators.py
--- a/src/attr/validators.py
+++ b/src/attr/validators.py
@@ -270,15 +270,16 @@ def optional(validator):
     which can be set to ``None`` in addition to satisfying the requirements of
     the sub-validator.
 
-    :param validator: A validator (or a list of validators) that is used for
-        non-``None`` values.
-    :type validator: callable or `list` of callables.
+    :param Callable | tuple[Callable] | list[Callable] validator: A validator
+        (or validators) that is used for non-``None`` values.
 
     .. versionadded:: 15.1.0
     .. versionchanged:: 17.1.0 *validator* can be a list of validators.
+    .. versionchanged:: 23.1.0 *validator* can also be a tuple of validators.
     """
-    if isinstance(validator, list):
+    if isinstance(validator, (list, tuple)):
         return _OptionalValidator(_AndValidator(validator))
+
     return _OptionalValidator(validator)
 
 


Test patch:
diff --git a/tests/test_validators.py b/tests/test_validators.py
--- a/tests/test_validators.py
+++ b/tests/test_validators.py
@@ -384,7 +384,12 @@ def test_repr(self, ifoo):
 
 
 @pytest.mark.parametrize(
-    "validator", [instance_of(int), [always_pass, instance_of(int)]]
+    "validator",
+    [
+        instance_of(int),
+        [always_pass, instance_of(int)],
+        (always_pass, instance_of(int)),
+    ],
 )
 class TestOptional:
     """
@@ -437,6 +442,11 @@ def test_repr(self, validator):
                 "<optional validator for _AndValidator(_validators=[{func}, "
                 "<instance_of validator for type <class 'int'>>]) or None>"
             ).format(func=repr(always_pass))
+        elif isinstance(validator, tuple):
+            repr_s = (
+                "<optional validator for _AndValidator(_validators=({func}, "
+                "<instance_of validator for type <class 'int'>>)) or None>"
+            ).format(func=repr(always_pass))
         else:
             repr_s = (
                 "<optional validator for <instance_of validator for type "
diff --git a/tests/typing_example.py b/tests/typing_example.py
--- a/tests/typing_example.py
+++ b/tests/typing_example.py
@@ -236,6 +236,15 @@ class Validated:
     p: Any = attr.ib(
         validator=attr.validators.not_(attr.validators.in_("abc"), msg=None)
     )
+    q: Any = attr.ib(
+        validator=attrs.validators.optional(attrs.validators.instance_of(C))
+    )
+    r: Any = attr.ib(
+        validator=attrs.validators.optional([attrs.validators.instance_of(C)])
+    )
+    s: Any = attr.ib(
+        validator=attrs.validators.optional((attrs.validators.instance_of(C),))
+    )
 
 
 @attr.define
Repository: python-attrs/attrs

Problem statement:
Couldn't use numpy arrays as defaults on attrs 19.2
The following code stops working when upgrading from attrs 19.1 to 19.2:

```
@attr.s(auto_attribs=True)
class NumParams:
    N = 3
    alpha = np.zeros((N, Ng))
```

Seems that change #556 requires that default attributes should implement `__eq__`, which is not the case for numpy arrays.

Taceback is:
```
    @attr.s(auto_attribs=True)
../../../../miniconda/envs/attests/lib/python3.6/site-packages/attr/_make.py:1010: in wrap
    return builder.build_class()
../../../../miniconda/envs/attests/lib/python3.6/site-packages/attr/_make.py:498: in build_class
    return self._patch_original_class()
../../../../miniconda/envs/attests/lib/python3.6/site-packages/attr/_make.py:512: in _patch_original_class
    and getattr(cls, name, _sentinel) != _sentinel
E   ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
```


Hints:
the issue can be resolved by switching the sentinel check from equality to is

Patch:
diff --git a/src/attr/_make.py b/src/attr/_make.py
--- a/src/attr/_make.py
+++ b/src/attr/_make.py
@@ -509,7 +509,7 @@ def _patch_original_class(self):
             for name in self._attr_names:
                 if (
                     name not in base_names
-                    and getattr(cls, name, _sentinel) != _sentinel
+                    and getattr(cls, name, _sentinel) is not _sentinel
                 ):
                     try:
                         delattr(cls, name)


Test patch:
diff --git a/tests/test_annotations.py b/tests/test_annotations.py
--- a/tests/test_annotations.py
+++ b/tests/test_annotations.py
@@ -282,3 +282,18 @@ class C:
 
         with pytest.raises(AttributeError):
             C.y
+
+    def test_non_comparable_defaults(self):
+        """
+        Regression test for #585: objects that are not directly comparable
+        (for example numpy arrays) would cause a crash when used as
+        default values of an attrs auto-attrib class.
+        """
+
+        class NonComparable:
+            def __eq__(self, other):
+                raise ValueError
+
+        @attr.s(auto_attribs=True)
+        class C:
+            x: typing.Any = NonComparable()
Repository: python-attrs/attrs

Problem statement:
Can't overide a __super__'s attrib.
Hi.

Is it not possible to do this? Let's say I want to change the default for arg 'p' in the inherited Class, B:
```
@attr.s
class A(object):
    p=attr.ib(default='old')

@attr.s
class B(A):
    p=attr.ib(default='new')

B().p
```

I get farts:

```
Traceback (most recent call last):
  File "E:/D/OneDrive/PyCharm/attrs_test/01.py", line 44, in <module>
    class B(A):
  File "E:\D\OneDrive\Miniconda3\envs\dev\lib\site-packages\attr\_make.py", line 391, in attributes
    return wrap(maybe_cls)
  File "E:\D\OneDrive\Miniconda3\envs\dev\lib\site-packages\attr\_make.py", line 364, in wrap
    cls = _add_init(cls, effectively_frozen)
  File "E:\D\OneDrive\Miniconda3\envs\dev\lib\site-packages\attr\_make.py", line 569, in _add_init
    bytecode = compile(script, unique_filename, "exec")
  File "<attrs generated init 6e95dcc9478c7a8b8784f6244afbff55f563f7c6>", line 1
SyntaxError: duplicate argument 'p' in function definition
```

Thanks.


Hints:
Yes that’s a bug that got mentioned in a different ticket and asked the reporter to file a new bug but he didn’t get around to it so it got lost.

Patch:
diff --git a/src/attr/_make.py b/src/attr/_make.py
--- a/src/attr/_make.py
+++ b/src/attr/_make.py
@@ -181,11 +181,6 @@ def _transform_attrs(cls, these):
 
     If *these* is passed, use that and don't look for them on the class.
     """
-    super_cls = []
-    for c in reversed(cls.__mro__[1:-1]):
-        sub_attrs = getattr(c, "__attrs_attrs__", None)
-        if sub_attrs is not None:
-            super_cls.extend(a for a in sub_attrs if a not in super_cls)
     if these is None:
         ca_list = [(name, attr)
                    for name, attr
@@ -201,6 +196,17 @@ def _transform_attrs(cls, these):
         for attr_name, ca
         in sorted(ca_list, key=lambda e: e[1].counter)
     ]
+
+    super_cls = []
+    non_super_names = set(a.name for a in non_super_attrs)
+    for c in reversed(cls.__mro__[1:-1]):
+        sub_attrs = getattr(c, "__attrs_attrs__", None)
+        if sub_attrs is not None:
+            super_cls.extend(
+                a for a in sub_attrs
+                if a not in super_cls and a.name not in non_super_names
+            )
+
     attr_names = [a.name for a in super_cls + non_super_attrs]
 
     AttrsClass = _make_attr_tuple_class(cls.__name__, attr_names)


Test patch:
diff --git a/tests/test_dark_magic.py b/tests/test_dark_magic.py
--- a/tests/test_dark_magic.py
+++ b/tests/test_dark_magic.py
@@ -271,3 +271,15 @@ def compute(self):
                 return self.x + 1
 
         assert C(1, 2) == C()
+
+    @pytest.mark.parametrize("slots", [True, False])
+    @pytest.mark.parametrize("frozen", [True, False])
+    def test_attrib_overwrite(self, slots, frozen):
+        """
+        Subclasses can overwrite attributes of their superclass.
+        """
+        @attr.s(slots=slots, frozen=frozen)
+        class SubOverwrite(Super):
+            x = attr.ib(default=attr.Factory(list))
+
+        assert SubOverwrite([]) == SubOverwrite()