You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added type parameter to attrs.field() function (#1107)
* Added `type` parameter to `attrs.field` and test
* Added notice in examples.md
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Added changelog entry
* Fixed docs
* Apply suggestions from code review
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hynek Schlawack <hs@ox.cx>
Copy file name to clipboardExpand all lines: docs/examples.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -471,7 +471,7 @@ If you're the author of a third-party library with *attrs* integration, please s
471
471
472
472
## Types
473
473
474
-
*attrs* also allows you to associate a type with an attribute using either the *type* argument to {func}`attr.ib` or using {pep}`526`-annotations:
474
+
*attrs* also allows you to associate a type with an attribute using either the *type* argument to {func}`attr.ib`and {func}`attr.field`or using {pep}`526`-annotations:
475
475
476
476
```{doctest}
477
477
>>> @define
@@ -626,11 +626,13 @@ Sometimes you may want to create a class programmatically.
0 commit comments