Re: [myhdl-list] Setting of enum values
Brought to you by:
jandecaluwe
From: Christopher F. <chr...@gm...> - 2015-01-08 14:20:27
|
On 1/7/2015 6:23 AM, Henry Gomersall wrote: > On 06/01/15 20:50, Henry Gomersall wrote: >> On 29/12/14 18:26, Christopher Felton wrote: >>>>>>>> AFAICT it doesn't acquire any state from the enum function so it could >>>>>>>> just as easily be at the module level, allowing more flexible usage when >>>>>>>> needing to fit the enum to an existing definition. >>>> I am sure there are many ways to implement it, this may >>>> not have been a use case envision or desired. We can >>>> propose a modification to have the "Enum" class public >>>> and then various custom functions can be created to >>>> implement the codedicts, etc. I think this would provide >>>> flexibility but also maintain a minimal / logical enum. >> I'm keen on this. I don't see any reason why Enum should be so hard to >> access. I agree enum should be kept as is. > Further to this, why not just extend the existing python Enum: > > https://pypi.python.org/pypi/enum34 > > Cheers, > > Henry > I think this is a reasonable request, I think the next steps would be to create a feature request in the main bitbucket repository [1]. For the near term, create a fork and move the Enum object(s) outside of the function, add Enum to __init__ (so it can be imported), and see how it works ... Regards, Chris [1] https://bitbucket.org/jandecaluwe/myhdl/issues?status=new&status=open |