Re: [myhdl-list] MEP-108 Bundle
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2012-06-25 08:56:20
|
On 06/24/2012 06:46 PM, Christopher Felton wrote: > On 6/15/12 4:07 AM, Jan Decaluwe wrote: >> On 06/01/2012 03:35 AM, Christopher Felton wrote: >> >>>> I think we should have a go at MEP 108 to remove the >>>> confusing "class attribute" terminology. Perhaps the >>>> explanations make it less clear than just stating what >>>> this MEP is about. Perhaps we should just >>>> talk about a method at the top level - I understand >>>> methods at lower levels already worked without this MEP. >>>> >>> >>> Sounds good, I should have some time tomorrow to work >>> through the modifications you suggested. >> >> About the "self" argument: the MEP says that the >> implementation looks for this argument and assumes it >> has the usual meaning. This is just fine with me, >> provided it is the *first* argument as per convention. >> Probably this is what the implemenation does? If not, >> it should, and the documentation should be adapated >> also. >> >> > > There are two locations in the code that were modified. First, the > top-level visitor. These modifications didn't require the use of the > "self". > > The second in the extract hierarchy , the original code uses a different > mechanism (not ast) to determine if user defined code is present. The > modifications here do not enforce the "self" as the first argument. The > code where the changes were added uses the python profile extraction to > identify a function on a return event. For a method, the "func" from > the global space would be None, if that was the case then self was > retrieved from the local space and funcname was checked as an attribute. > > What does this all mean, it means it doesn't enforce "self" to be the > first position but it will only use self if it has the /function/ that > it is looking for (funcname). If the code fails to find the funcname in > the global space or as an attribute (method) of "self" in the localspace. Perhaps that is an indirect check of the conventional use of self, including the position? > I will investigate if there is a mechanism to also verify "self" is the > first argument. I tried to find a means to not use "self" but with the > profile extraction I was not successful. Mm, in any case it looks like a very minor issue (if any) and I don't want to cause too much extra effort on it. -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com World-class digital design: http://www.easics.com |