This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: symtable.Symbol.is_global() is strange
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jhylton Nosy List: astrand, benjamin.peterson, jhylton
Priority: normal Keywords:

Created on 2004-02-12 21:08 by astrand, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg19975 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2004-02-12 21:08
The symtable.Symbol.is_global() returns false for
symbols in plain functions:

If the source looks like this:

foo = 1

def fie():
    print foo

Calling is_global() for the "foo" name returns False
(using the fie functions SymbolTable).

With a method, however, it works as expected:

foo = 1

class C:
    def fie(self):
        print foo

msg19976 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2004-08-01 12:50
Logged In: YES 
user_id=344921

I would appreciate if someone could take a look at this.
This problem makes the development of pyobfuscate harder:
Basically, I'm guessing how things are supposed to work. Bug
896052 is, of course, also relevant. 
msg71416 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-08-19 13:12
This has finally been fixed.
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39933
2008-08-19 13:12:15benjamin.petersonsetstatus: open -> closed
nosy: + benjamin.peterson
resolution: fixed
messages: + msg71416
2004-02-12 21:08:25astrandcreate