Re: [myhdl-list] List Of Constants
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2015-03-18 13:07:20
|
On 3/18/15 2:36 AM, Josy Boelen wrote: > Christopher Felton <chris.felton <at> gmail.com> writes: > >> >> >>> But I welcome your MEP-lite. Just wish you hadn't used the word *rom*, > I >>> feel that name is a bit ambiguous to describe what is going on there. >>> >> >> It can be change and probably should. I agree, in this case >> we want a constant and not a read-only look-up. I will change >> it. >> > Chris, > > while you're at it, can you put the 'constants' in upper-case? A PEP8 > recommendation ;) > I disagree, we have a reference to a `tuple` not a module level constant. # module level constant from myhdl import * MAX_LEVELS = 4 # reference to a tuple coef = (1,2,3,4) Module-level constants are fairly rare. The python documentation [1] does not use cap names for references to tuples (can't say I have seen other that does) Regards, Chris [1] https://docs.python.org/2/tutorial/datastructures.html#tuples-and-sequences |