Skip to content

Commit 56c7308

Browse files
committed
Add missing collect_by_mro to typing stubs
Fixes #711
1 parent 48157a5 commit 56c7308

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

changelog.d/711.change.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The type stubs for ``attr.s()`` and ``attr.make_class()`` are not missing the *collect_by_mro* argument anymore.

src/attr/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ def attrs(
273273
eq: Optional[bool] = ...,
274274
order: Optional[bool] = ...,
275275
auto_detect: bool = ...,
276+
collect_by_mro = ...,
276277
getstate_setstate: Optional[bool] = ...,
277278
on_setattr: Optional[_OnSetAttrArgType] = ...,
278279
field_transformer: Optional[_FieldTransformer] = ...,
@@ -297,6 +298,7 @@ def attrs(
297298
eq: Optional[bool] = ...,
298299
order: Optional[bool] = ...,
299300
auto_detect: bool = ...,
301+
collect_by_mro = ...,
300302
getstate_setstate: Optional[bool] = ...,
301303
on_setattr: Optional[_OnSetAttrArgType] = ...,
302304
field_transformer: Optional[_FieldTransformer] = ...,
@@ -386,6 +388,7 @@ def make_class(
386388
auto_exc: bool = ...,
387389
eq: Optional[bool] = ...,
388390
order: Optional[bool] = ...,
391+
collect_by_mro = ...,
389392
on_setattr: Optional[_OnSetAttrArgType] = ...,
390393
field_transformer: Optional[_FieldTransformer] = ...,
391394
) -> type: ...

tests/typing_example.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,8 @@ class NGFrozen:
244244

245245
# XXX: needs support in mypy
246246
# ngf = NGFrozen(1)
247+
248+
249+
@attr.s(collect_by_mro=True)
250+
class MRO:
251+
pass

0 commit comments

Comments
 (0)