From 56c73081c5d767e30f529ac4f15a6bdd43e23d9f Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Tue, 3 Nov 2020 10:05:33 +0100 Subject: [PATCH] Add missing collect_by_mro to typing stubs Fixes #711 --- changelog.d/711.change.rst | 1 + src/attr/__init__.pyi | 3 +++ tests/typing_example.py | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 changelog.d/711.change.rst 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