[Python-Dev] more timely detection of unbound locals (original) (raw)
Eli Bendersky eliben at gmail.com
Mon May 9 17:06:18 CEST 2011
- Previous message: [Python-Dev] more timely detection of unbound locals
- Next message: [Python-Dev] more timely detection of unbound locals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
x = 5 def foo (): print (x) if bar (): x = 1 print (x)
I wish you'd annotate this code sample, what do you intend it to demonstrate?
It probably shows the original complaint even more strongly. As for being a problem with the suggested solution, I suppose you're right, although it doesn't make it much different. Still, before a possible assignment to 'x', it should be loaded as LOAD_NAME since it was surely not bound as local, yet.
Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20110509/82d1a583/attachment.html>
- Previous message: [Python-Dev] more timely detection of unbound locals
- Next message: [Python-Dev] more timely detection of unbound locals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]