Bugs item #1166714, was opened at 2005-03-20 00:14 Message generated for change (Comment added) made by jpe You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1166714&group_id=5470
Category: Parser/Compiler Group: AST Status: Open Resolution: None Priority: 5 Submitted By: John Ehresman (jpe) Assigned to: Brett Cannon (bcannon) Summary: [ast branch] fatal error when compiling test_bool.py Initial Comment: When using the ast-branch compiler, python exits with a fatal error when compiling test_bool.py or the symplified test case that I'll attach. The immediate problem is that when the compiler is in make_closure after compiling the lambda, self is found to be a LOCAL reference type and make_closure assumes it's a FREE reference if it's not a CELL reference in the enclosing scope. I don't know if self is supposed to be a LOCAL reference or if make_closure should handle LOCAL references. ---------------------------------------------------------------------- >Comment By: John Ehresman (jpe) Date: 2005-03-22 21:37 Message: Logged In: YES user_id=22785 The issue seems to be that in symtable_analyze, a free dictionary is created for the entire module and if a name is found to be free in any function, it is not converted from a LOCAL to a CELL is any context seen afterwards. I think the free variables need to be recorded on a function-by-function basis. ---------------------------------------------------------------------- Comment By: Brett Cannon (bcannon) Date: 2005-03-22 20:34 Message: Logged In: YES user_id=357491 An short example of the failure:: def outer(a): def first(): a def last(a): pass This leads to a fatal Python error. The issue is having a being a local or parameter (can make 'a' be 'a = 1' and not a parameter and still have it fail), the first closure reference it, and then the second one use it as a parameter. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1166714&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com