Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dataclass to reduce boilerplate in event definitions #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cburgdorf
Copy link
Contributor

@cburgdorf cburgdorf commented Jun 14, 2019

What was wrong?

This is an alternative to #63 relying on the new @dataclass decorator that was added with Python 3.7. There's a backport for Python 3.6 available as well: https://pypi.org/project/dataclasses/

How was it fixed?

Use dataclasses in examples

Cute Animal Picture

put a cute animal picture link inside the parentheses

@cburgdorf
Copy link
Contributor Author

It fails for the py36-examples job because I haven't used the Python 3.6 fallback here but we could do that. But on the other hand, if it's easy to build our own DataEvent with a metaclass that might be even better.

@cburgdorf cburgdorf force-pushed the christoph/refactor/dataclass branch from 4b45ee4 to b789d35 Compare June 14, 2019 19:29
@cburgdorf
Copy link
Contributor Author

Ok, I went ahead and added the dataclasses backport for the py36 job. I read up a bit on https://docs.python.org/3/library/dataclasses.html and I'm leaning towards just going with that as dataclasses come with a bunch of other features and so this may just end up as the more flexible solution. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant