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 con-f-use
Recipients avraf, con-f-use, r.david.murray
Date 2020-03-04.22:12:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583359977.61.0.378639876187.issue27793@roundup.psfhosted.org>
In-reply-to
Content
I would argue to reopen this. Seeing I and other people run into that issue (e.g. https://stackoverflow.com/q/40883083/789308) quiet frequently.

Especially since it breaks the `global` keyword, e.g.:

__superprivate = "mahog"

class AClass(object):
    def __init__(self, value):
        global __superprivate
        __superprivate = value

    @staticmethod
    def get_sp():
        return __superprivate

if __name__ == "__main__":
    print(__superprivate)  # mahog
    try:
        print(AClass.get_sp()) 
    except NameError as e:
        print(e)           # NameError: name '_AClass__superprivate' is not defined'
    cl = AClass("bla")
    print(cl.get_sp())     # bla
    __superprivate = 1
    print(cl.get_sp())     # bla
    print(AClass.get_sp()) # bla
History
Date User Action Args
2020-03-04 22:12:57con-f-usesetrecipients: + con-f-use, r.david.murray, avraf
2020-03-04 22:12:57con-f-usesetmessageid: <1583359977.61.0.378639876187.issue27793@roundup.psfhosted.org>
2020-03-04 22:12:57con-f-uselinkissue27793 messages
2020-03-04 22:12:57con-f-usecreate