Hi,<br><br><div class="gmail_quote">2011/9/28 Łukasz Ligowski <span dir="ltr">&lt;<a href="mailto:orangewarrior@gmail.com">orangewarrior@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello,<br>
<br>
I&#39;d like to know what is the purpose of offset field on<br>
pypy.objspace.flow.model.SpaceOperation object.<br>
It is labeled as &quot;offset in code string&quot; but I have problem to find<br>
the right string.<br>
I tried with string that is returned by using string returned by<br>
FunctionGraph.getsource() but it didn&#39;t bring expected results.<br>
<br>
What I try to accomplish is to learn whether it is possible to map<br>
particular SpaceOperation with right line of original source file.<br></blockquote><div><br></div><div>The &quot;code string&quot; is very likely the bytecode of the Python function,</div><div>i.e   f.__code__.co_code.</div>
<div>It&#39;s not very easy to get back to the original source line.</div><div>f.__code__.co_firstlineno gives the first line number, and other lines</div><div>must be computed with the help of f.__code__.co_lnotab.</div>
<div>Good luck with this one. You may want to look at the &quot;dis&quot; module</div><div>to see how it is used.</div><div> </div></div>-- <br>Amaury Forgeot d&#39;Arc<br>