Redefining type annotation for a member of a class defined in 3rd party library #1161
Answered
by
Gobot1234
dmi-dmi-dmi
asked this question in
Q&A
|
Hi guys. I have quite large legacy codebase which uses a 3rd-party framework with type annotations. Most part of the codebase looks like this The problem is that Is there a way to redefine type annotation for |
Answered by
Gobot1234
Apr 23, 2022
Replies: 1 comment 1 reply
from framework import BaseClass
class CustomHandler(BaseClass):
app: MyCustomApp
def process(self, data):
params = self.app.registry.get_params()
self.app.added_in_runtime_property.handle_complex_case(parms, data)Should work, app wouldn't do anything to BaseClass.app (which would still be where python looks for the definition) |
1 reply
Answer selected by
dmi-dmi-dmi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should work, app wouldn't do anything to BaseClass.app (which would still be where python looks for the definition)