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.

Author CendioOssman
Recipients CendioOssman
Date 2020-09-23.12:22:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600863724.98.0.825702411391.issue41840@roundup.psfhosted.org>
In-reply-to
Content
So Issue40196 (and PR 19391) broke things for us here as Symbol.is_local() no longer works properly for symbols on the global/module scope.

Previously it would return True for all global symbols that were bound. Now it only returns True when the symbol is not used in any other scope. This means we cannot tell the difference between globals that are from the module itself, and globals that come in via imports.

This also seems to contradict this part of the language reference:

"(The variables of the module code block are local and global.)"

https://docs.python.org/3/reference/executionmodel.html

I don't see any clean workaround as there is no Symbol.is_bound() that could be used instead.

(inb4 https://xkcd.com/1172/)
History
Date User Action Args
2020-09-23 12:22:05CendioOssmansetrecipients: + CendioOssman
2020-09-23 12:22:04CendioOssmansetmessageid: <1600863724.98.0.825702411391.issue41840@roundup.psfhosted.org>
2020-09-23 12:22:04CendioOssmanlinkissue41840 messages
2020-09-23 12:22:04CendioOssmancreate