Skip to content

Commit

Permalink
Add missing collect_by_mro to typing stubs
Browse files Browse the repository at this point in the history
Fixes #711
  • Loading branch information
hynek committed Nov 3, 2020
1 parent 48157a5 commit 56c7308
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions 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.
3 changes: 3 additions & 0 deletions src/attr/__init__.pyi
Expand Up @@ -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] = ...,
Expand All @@ -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] = ...,
Expand Down Expand Up @@ -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: ...
Expand Down
5 changes: 5 additions & 0 deletions tests/typing_example.py
Expand Up @@ -244,3 +244,8 @@ class NGFrozen:

# XXX: needs support in mypy
# ngf = NGFrozen(1)


@attr.s(collect_by_mro=True)
class MRO:
pass

0 comments on commit 56c7308

Please sign in to comment.