Message262878
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 |
|
Date |
User |
Action |
Args |
2016-04-04 23:05:02 | barry | set | recipients:
+ barry, rhettinger, ethan.furman, martin.panter, serhiy.storchaka, eryksun |
2016-04-04 23:05:02 | barry | set | messageid: <1459811102.82.0.375286885882.issue26632@psf.upfronthosting.co.za> |
2016-04-04 23:05:02 | barry | link | issue26632 messages |
2016-04-04 23:05:02 | barry | create | |
|