-
Notifications
You must be signed in to change notification settings - Fork 6
Generic types and 3.4 compatibility #16
Conversation
- Refactors the annotation support for test_attrs - Refactors errors and types into their own modules.
- Correct some issues with get_generic_origin.
- Remove black and dephell as dev dependencies. - Add dephell config to easily generate docker - Require a newer version of attrs.
README.md
Outdated
|
|
||
| There is experimental support for deriving from `typing.Generic`. An `attrs` or `dataclass` | ||
| may declare itself a generic class. If another class invokes it as `YourGeneric[Param, Param]`, | ||
| those `Param` types will be substituted into the fields during encoded. This is useful to construct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm being nit-picky, but should "during encoded" be "during encoding"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah, good catch.
| .git | ||
| htmlcov | ||
| max-line-length = 120 | ||
| max-line-length = 92 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious what this max-line-length applies to (this repo, all repos, JSONs formed from code, etc?) and what the motivation was for this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these tools search up the directory hierarchy, so this would only affect this repo, and it specifically applies to flake8's warning about line length.
I was setting that so that flake8 is more consistent with black.
|
My approval comment got lost in a different tab, but I was also curious how we know when this repo needs to be updated and if anything that happens in engine causes json-syntax to need changes. |
Part of the design is that it shouldn't need to. We already have a few extra rules in the engine that aren't in this library because they seemed very peculiar to our use case. Feature should go in here if they seem like they could have a broad appeal. For instance, I wanted dynamodb support, and it's fairly popular, and it demonstrated how you can write custom rules, so it made sense to put that in this library under extras. And per semantic versioning, breaking changes bump the major version. |
Adding support for generic types, planning this to be in 2.2.0.
Turns out to be super easy to test in docker using dephell.