icefall icon indicating copy to clipboard operation
icefall copied to clipboard

Use explicit relative imports

Open shaynemei opened this issue 3 years ago • 2 comments

  • switch from implicit relative imports to explicit relative imports as recommended by Guido: https://peps.python.org/pep-0328/#guido-s-decision
  • sort import order using isort

close #508

shaynemei avatar Aug 03 '22 01:08 shaynemei

Could you please fix the CI errors?

csukuangfj avatar Aug 03 '22 02:08 csukuangfj

Do the scripts actually run correctly when using relative imports? In my experience, if you use relative imports like that and you run the scripts in the normal way, like python3 pruned_transducer_stateless2/decode.py you get errors like "cannot use relative import because decode.py is not part of a package" (this is from memory, may not be exact). That's why I don't tend to use them.

danpovey avatar Nov 29 '22 11:11 danpovey