Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Conversation

@bsamuel-ui
Copy link
Contributor

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.

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

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"?

Copy link
Contributor Author

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

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

Copy link
Contributor Author

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.

@rebeccamelkerson-zz
Copy link

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.

@bsamuel-ui
Copy link
Contributor Author

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.

@bsamuel-ui bsamuel-ui merged commit 7afbf29 into master Jan 16, 2020
@CalMlynarczyk CalMlynarczyk deleted the generic-types branch June 22, 2021 18:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants