We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ef668b commit b89b874Copy full SHA for b89b874
mellea/stdlib/session.py
@@ -3,6 +3,7 @@
3
from __future__ import annotations
4
5
import contextvars
6
+import inspect
7
from copy import copy
8
from typing import Any, Literal, overload
9
@@ -804,6 +805,12 @@ async def atransform(
804
805
self.ctx = context
806
return result
807
808
+ @classmethod
809
+ def powerup(cls, powerup_cls: type):
810
+ """Appends methods in a class object `powerup_cls` to MelleaSession."""
811
+ for name, fn in inspect.getmembers(powerup_cls, predicate=inspect.isfunction):
812
+ setattr(cls, name, fn)
813
+
814
# ###############################
815
# Convenience functions
816
0 commit comments