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 constants or something elegant for all the magic numbers #30

Open
lawik opened this issue Jul 26, 2019 · 3 comments
Open

Use constants or something elegant for all the magic numbers #30

lawik opened this issue Jul 26, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@lawik
Copy link
Collaborator

lawik commented Jul 26, 2019

The Python Inky library is full of assorted pieces of hex and binary. And so are we. We probably wan't to collect these magic numbers as constants or some other more elegant solution that allows us to mostly update those values when the inky library updates to fix something.

@nyaray
Copy link
Collaborator

nyaray commented Jul 26, 2019

Just to clarify what I meant in our slack conversation... it is probably enough to change the magic numbers into module attributes, so that they are compile-time inlined but still named... if we even decide to do this.

Anything else is probably overkill and likely confusing to read.

@lawik
Copy link
Collaborator Author

lawik commented Jul 26, 2019

Sure, that'd be my first attempt. But I'd like to be able to use those in tests as well, which I don't believe is possible. Or we actually just duplicate those attributes that the tests need I guess. To not over-engineer things.

@nyaray
Copy link
Collaborator

nyaray commented Sep 8, 2019

just duplicate those attributes that the tests need I guess. To not over-engineer things.

This!

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

No branches or pull requests

2 participants