I added YAMLWizard to some code using plumbum's cli, and after added the required __future__ line I discovered that my main function wouldn't typecheck its command line arguments anymore. Picture something like this:
from __future__ import annotations
from plumbum import cli
# import YAMLWizard # skipped for simplicity
class app(cli.Application):
def main(self, *dirs: cli.ExistingDirectory):
pass
I hope it's clear what's expected here. Anyhow, what will actually happen due to the annotations feature is that the annotations get processed differently, and apparently don't work the same way. So instead of typechecking the command line as expected, the program always terminates with a runtime error that "str object is not callable."
Workarounds:
Just separate cli.Application and future.annotation use into separate modules. It's what I'm doing now.
Don't typecheck the command line. I did that for a bit, but it's annoying.
I added
YAMLWizard
to some code using plumbum'scli
, and after added the required__future__
line I discovered that mymain
function wouldn't typecheck its command line arguments anymore. Picture something like this:I hope it's clear what's expected here. Anyhow, what will actually happen due to the
annotations
feature is that the annotations get processed differently, and apparently don't work the same way. So instead of typechecking the command line as expected, the program always terminates with a runtime error that "str object is not callable."Workarounds: