News for hackers. Stuff that matters.
Re:Python’s “type hints” are a bit of a disappointment to me by Too on Friday April 22, 2022 @12:22AM (#31118190)
Mypy can be configured to ignore modules based on their names.

Though honestly I think it’s worth it to just bite the bullet and spend a full day or two to go through and fix every single error. After this you will have a much easier time navigating code base. I mean, your “new code” is probably modifications to your old code or calling your old code right? So you want to have at least the boundary between new and old typed. It’s quite satisfying anyway, as you will likely learn and discover tons of bugs on the way.

Re:Python’s “type hints” are a bit of a disappointment to me by necovek on Friday April 22, 2022 @07:34AM (#31120379)
With any large legacy Python codebase, that's usually a month-long undertaking for one engineer, if not longer!

Python by design encourages duck typing, which means that you'll have plenty of places that simply take multiple different types, and just slapping a union is usually non-trival and not very beneficial either (eg. you'd be randomly patching things with fakes and mocks in tests).

If you think it's a single day job, I am sure my company (and plenty others) would pay you gladly your single daily rate to get our codebase migrated in a day :-D

Re:Python’s “type hints” are a bit of a disappointment to me by LtWorf_ on Friday April 22, 2022 @04:14AM (#31119365)
> day or two

Your code must be quite small.

Re:Python’s “type hints” are a bit of a disappointment to me by icedchai on Friday April 22, 2022 @06:42PM (#31129126)
For any large code base, it'll go on for months, since it gets done between higher priority work. You'll discover some problems, sure. But if they were really important, you'd have hit them earlier. My experience is these sorts of efforts create a lot of busy work and not much more.