diff --git a/changelog.d/711.change.rst b/changelog.d/711.change.rst new file mode 100644 index 00000000..66865e8b --- /dev/null +++ b/changelog.d/711.change.rst @@ -0,0 +1 @@ +The type stubs for ``attr.s()`` and ``attr.make_class()`` are not missing the *collect_by_mro* argument anymore. diff --git a/src/attr/__init__.pyi b/src/attr/__init__.pyi index f9034500..65672027 100644 --- a/src/attr/__init__.pyi +++ b/src/attr/__init__.pyi @@ -273,6 +273,7 @@ def attrs( eq: Optional[bool] = ..., order: Optional[bool] = ..., auto_detect: bool = ..., + collect_by_mro = ..., getstate_setstate: Optional[bool] = ..., on_setattr: Optional[_OnSetAttrArgType] = ..., field_transformer: Optional[_FieldTransformer] = ..., @@ -297,6 +298,7 @@ def attrs( eq: Optional[bool] = ..., order: Optional[bool] = ..., auto_detect: bool = ..., + collect_by_mro = ..., getstate_setstate: Optional[bool] = ..., on_setattr: Optional[_OnSetAttrArgType] = ..., field_transformer: Optional[_FieldTransformer] = ..., @@ -386,6 +388,7 @@ def make_class( auto_exc: bool = ..., eq: Optional[bool] = ..., order: Optional[bool] = ..., + collect_by_mro = ..., on_setattr: Optional[_OnSetAttrArgType] = ..., field_transformer: Optional[_FieldTransformer] = ..., ) -> type: ... diff --git a/tests/typing_example.py b/tests/typing_example.py index 11f527bd..e486dcad 100644 --- a/tests/typing_example.py +++ b/tests/typing_example.py @@ -244,3 +244,8 @@ class NGFrozen: # XXX: needs support in mypy # ngf = NGFrozen(1) + + +@attr.s(collect_by_mro=True) +class MRO: + pass