-2

I would like to use a mathematical serie to define a constant inside a class. I would like to know whether this is compliant with the PEP8. Thank you in advance. Please see image below

enter image description here

lucky luke
  • 17
  • 1
  • 1
    Please don't post images of code. Copy and paste the code instead. – Brian McCutchon Sep 28 '20 at 16:31
  • Look also [here](https://stackoverflow.com/questions/5096025/should-class-specific-constants-still-be-declared-at-module-level) – Timus Sep 28 '20 at 16:35
  • This almost feels like an XY-problem. Why do you need such a "constant"? Constants are usually numbers or strings... What do you do with that `SIZE`? – Tomerikoo Sep 28 '20 at 16:42

1 Answers1

0

That looks fine but SIZE = [2 ** i for i in range(5)] is probably cleaner.

theEpsilon
  • 1,800
  • 17
  • 30