How do you type a function that takes a module as an input? #1408
Answered
by
Gobot1234
Jacob-Flasheye
asked this question in
Q&A
-
I want to create a function that takes a module as an input: import foo
def register_module(module: ???):
...
register_module(foo) and I've tried looking around but cannot find anything about typing modules as input, probably because it's a uncommon use-case. I'll just on with using |
Beta Was this translation helpful? Give feedback.
Answered by
Gobot1234
May 31, 2023
Replies: 1 comment 5 replies
-
You are looking for types.ModuleType |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
Jacob-Flasheye
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are looking for types.ModuleType