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 ethan.furman
Recipients barry, ethan.furman
Date 2016-03-24.02:48:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
def public(thing, value=None):
    if isinstance(thing, str):
        mdict = sys._getframe(1).f_globals
        name = thing
        mdict[name] = thing  # no need for retyping! ;)
        mdict = sys.modules[thing.__module__].__dict__
        name = thing.__name__
    dunder_all = mdict.setdefault('__all__', [])
    return thing

def baz(a, b):
    return a+ b

public('CONST1', 3)

CONST2 = 4


On the down side, you know somebody is going to @public a class' method -- how do we check for that?
Date User Action Args
2016-03-24 02:48:08ethan.furmansetrecipients: + ethan.furman, barry
2016-03-24 02:48:08ethan.furmansetmessageid: <>
2016-03-24 02:48:08ethan.furmanlinkissue26632 messages
2016-03-24 02:48:08ethan.furmancreate