Commit 112dd1d
authored
Expose effective class construction properties (#1454)
* Implement _AttrsParams
ref #602
* Set __attrs_base_of_slotted__ for unused base classes
* Rename to ClassProps
This reflects that the instance is NOT just the parameters as passed to
the decorator, but how the class is actually constructed.
* Start renaming fields so it's clearer these aren't just arguments
* Reorder
* Dont's expose has_custom_setattr
* Make KeywordOnly an Enum
And make Hashability public
* Make cache_hash part of the Hashability Enum
* Add attrs.inspect()
* Refactor enums into class since they're only used by that class
* Docs
* Move back, rip out type hints
* Revert "Move back, rip out type hints"
This reverts commit 84bb6da.
* Use internal mechanisms instead of NamedTuple
Mostly to prevent Mypy from looking at our code, but sadly it wasn't
enough courtesy of enums for some reason.
* Add news fragment
* Document it's experimental
* Improve ClassProps documentation
* Add type information to docs
* Improve field names
To make it clearer these are derived values and nothing you can pass
into define/attr.s
* Avoid repeated attribute lookups
* More more helpful field names
* Add warning to class too
* Add explanation
* Add to changelog, too
* Nicer phrasing
* Grammar
* docs
* Consistency
* Make inspect/ClassProps NG-only
* Remove stray empty line
* Don't half-ass next_gen-ing
_funcs is terribly generic too
* Avoid attribute lookups in hot loop
* Add field access type tests
* A docstring is not appropriate here
* Move typing example to baseline1 parent 4737f0e commit 112dd1d
File tree
11 files changed
+665
-139
lines changed- changelog.d
- docs
- src
- attrs
- attr
- tests
- typing-examples
11 files changed
+665
-139
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
193 | 211 | | |
194 | 212 | | |
195 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments