Hacker News new | ask | show | jobs
by AnkhMorporkian 3957 days ago
Sorry it took so long for me to get back to you; I only check HN from time to time.

1. No, afaik there's no way to omit the import. Sadly there's little in the way of macros or preprocessors in the python world at this point.

2. I'm fairly sure there's ways to use module stubs, but all my mypy work has dealt with the stdlib which presents no issue.

1 comments

Thanks for your reply! There aren't preprocessors, that's true, but I think the way MyPy does things is a bit unnecessary. They could have avoided the typing module and just used bare annotations, and made MyPy a static type checker. Still, this just avoids the dependency, which isn't such a big deal.