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 barry
Recipients barry, eryksun, ethan.furman, martin.panter, rhettinger, serhiy.storchaka
Date 2016-04-04.23:05:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1459811102.82.0.375286885882.issue26632@psf.upfronthosting.co.za>
In-reply-to
Content
Here's my implementation based on eryksun's idea:

def public(thing=None, **kws):
    mdict = (sys._getframe(1).f_globals
             if thing is None
             else sys.modules[thing.__module__].__dict__)
    dunder_all = mdict.setdefault('__all__', [])
    if thing is not None:
        dunder_all.append(thing.__name__)
    for key, value in kws.items():
        dunder_all.append(key)
        mdict[key] = value
    return thing
History
Date User Action Args
2016-04-04 23:05:02barrysetrecipients: + barry, rhettinger, ethan.furman, martin.panter, serhiy.storchaka, eryksun
2016-04-04 23:05:02barrysetmessageid: <1459811102.82.0.375286885882.issue26632@psf.upfronthosting.co.za>
2016-04-04 23:05:02barrylinkissue26632 messages
2016-04-04 23:05:02barrycreate