Skip to content

Commit 83b699a

Browse files
committed
feat: MelleaSession.powerup
1 parent 4e4e631 commit 83b699a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mellea/stdlib/session.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ def wrapper(self, *args, **kwargs):
276276

277277
setattr(cls, fn.__name__, wrapper)
278278

279+
@classmethod
280+
def powerup(cls, powerup_cls: type):
281+
"""Appends methods in a class object `powerup_cls` to MelleaSession."""
282+
for name, fn in inspect.getmembers(powerup_cls, predicate=inspect.isfunction):
283+
cls.register(fn, set_context=False)
284+
279285
# ###############################
280286
# Convenience functions
281287
# ###############################

0 commit comments

Comments
 (0)