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/2002-April/023462.html below:

[Python-Dev] LOAD_NAME & classes

[Python-Dev] LOAD_NAME & classes [Python-Dev] LOAD_NAME & classesAlex Martelli aleax@aleax.it
Tue, 23 Apr 2002 17:47:30 +0200
On Tuesday 23 April 2002 05:30 pm, Steve Holden wrote:
	...
> Might it make more sense to issue a warning at compile time to the effect
> that a variable is being used before it's assigned? How completely are

Hard to make sure, so, it would always be "MIGHT be used before
assignment".  E.g.,

def f():
    for i in range(6):
        if i>0: print x,
        x = str(i)

this is OK... no UnboundNameError.  Now, change the if's guard to
        if SolveTuringHaltingProblem(i): print x,
to see why it's hard to make sure about this at compile time.

A warning might still be OK of course, even though it may need to
be worded in wishy-washy "might" terms -- this IS peculiar usage.


Alex




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