A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/1999-August/000673.html below:

[Python-Dev] about line numbers

[Python-Dev] about line numbers [Python-Dev] about line numbersVladimir Marangozov Vladimir.Marangozov@inrialpes.fr
Thu, 12 Aug 1999 19:22:06 +0100 (NFT)
Just curious:

Is python with vs. without "-O" equivalent today regarding line numbers?
Are SET_LINENO opcodes a plus in some situations or not?

Next, I see quite often several SET_LINENO in a row in the beginning
of code objects due to doc strings, etc. Since I don't think that
folding them into one SET_LINENO would be an optimisation (it would
rather be avoiding the redundancy), is it possible and/or reasonable
to do something in this direction?

A trivial example:

>>> def f():
...     "This is a comment about f"   
...     a = 1
... 
>>> import dis
>>> dis.dis(f)
          0 SET_LINENO          1

          3 SET_LINENO          2

          6 SET_LINENO          3
          9 LOAD_CONST          1 (1)
         12 STORE_FAST          0 (a)
         15 LOAD_CONST          2 (None)
         18 RETURN_VALUE   
>>>

Can the above become something like this instead:

          0 SET_LINENO          3
          3 LOAD_CONST          1 (1)
          6 STORE_FAST          0 (a)
          9 LOAD_CONST          2 (None)
         12 RETURN_VALUE


-- 
       Vladimir MARANGOZOV          | Vladimir.Marangozov@inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4