[chirp_devel] [PATCH] [ft4]rework code for progkeys [#6583]

Dan Clemmensen
Wed Mar 13 11:47:09 PDT 2019


OK, sorry. But we modify class variables during class definitions all the
time. In fact, all of the code in the two radio classes consists of
"self-modification of class variables", since all top-level (single-indent)
code in a class is class-level code: each such python statement gets
executed When the Python interpreter imports the module, as I understand
it. (Newbie Python is showing here.)

On Wed, Mar 13, 2019 at 11:26 AM Dan Smith via chirp_devel <
chirp_devel at intrepid.danplanet.com> wrote:

> > My apologies. I did not actually intend to commit the
> directory.register. It was there for testing and I just did not see it. I
> don't really know to resubmit a patch starting from where I am now, but I
> will puzzle it out somehow.
>
> If you're using mq, just qpop until the one you want is on top and then
> "hg email tip" If not, just "hg email $rev" where rev is the thing you want
> to send.
>
> > Is the .img file acceptable?
>
> I assume? I'll just throw that in the tree when we do register the thing
> so it'll get tested too.
>
> > About "class scope": it really is an official part of Python: I did not
> make it up. It's exactly what we wanted to use here: a variable that is
> only accessible within a class, but not in its superclasses, but is a
> single variable shared amongst all members of the class.  I am new to
> Python, so I do not know which language constructs are conventionally
> simply not used by developers. I will change this to conform to norms. Note
> that many of the scalars (e.g., MAX_MEM_SLOT) are a class scope, not
> instance scope.
>
> No, I realize it does work, I'm just saying it's so unconventional I
> wouldn't have been sure without trying it myself. It's really the
> self-modification of the class variable during the definition of the class
> that is weird. If you can just move that part to module scope and then
> assign it to the class during definition that would be appreciated.
>
> Thanks!
>
> --Dan
> _______________________________________________
> chirp_devel mailing list
> chirp_devel at intrepid.danplanet.com
> http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
> Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20190313/abdb1417/attachment-0001.html 


More information about the chirp_devel mailing list