inky icon indicating copy to clipboard operation
inky copied to clipboard

Use constants or something elegant for all the magic numbers

Open lawik opened this issue 5 years ago • 3 comments

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.

lawik avatar Jul 26 '19 11:07 lawik

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.

nyaray avatar Jul 26 '19 11:07 nyaray

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.

lawik avatar Jul 26 '19 11:07 lawik

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

This!

nyaray avatar Sep 08 '19 09:09 nyaray