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/2000-April/003200.html below:

[Python-Dev] python -O weirdness

[Python-Dev] python -O weirdness [Python-Dev] python -O weirdnessVladimir Marangozov Vladimir.Marangozov@inrialpes.fr
Fri, 7 Apr 2000 04:02:22 +0200 (CEST)
Strange. Can somebody confirm/refute, explain this behavior?

-------------[ bug.py ]------------
def f():
	pass

def g():
	a = 1
	b = 2

def h(): pass

def show(func):
	c = func.func_code
	print "(%d) %s: %d -> %s" % \
		(c.co_firstlineno, c.co_name, len(c.co_lnotab), repr(c.co_lnotab))

show(f)
show(g)
show(h)
-----------------------------------

~> python bug.py
(1) f: 2 -> '\003\001'
(4) g: 4 -> '\003\001\011\001'
(8) h: 2 -> '\003\000'

~> python -O bug.py
(1) f: 2 -> '\000\001'
(4) g: 4 -> '\000\001\006\001'
(1) f: 2 -> '\000\001'                   <=== ???

-- 
       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