-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove some uses of overload #665
Conversation
e748deb
to
4863d53
Compare
Yeah, I had a bunch of errors, too. I'm fixing them... |
What the heck? I think I managed to crash mypy!? Those Travis build results are screwed up... |
flags: int = 0) -> AnyStr: pass | ||
@overload | ||
def sub(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], | ||
def sub(pattern: AnyStr, repl: Union[AnyStr, Callable[[Match[AnyStr]]]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're missing the return type here for Callable
. I think this is causing the failing tests.
Of course, mypy shouldn't crash in this way as a result of a missing argument. I've made issue #673 for this. |
@spkersten Thanks! I didn't realize that! What exactly do you mean by a default argument for |
Wow, a single PR causing two mypy crashes! You found some code paths that don't have good test coverage. Narrowed down the second crash: #674 Life is busy currently, but I'll try to find some time this week to debug the issue. |
Fixed #674. Started another build -- hopefully it passes now. |
@kirbyfan64 You van ignore the comment about default for string. I was misreading the diff and thought that one of the original signatures didn't have the string argument. |
Looks good! Thanks for the PR! |
This fixes #432 and removes some other uses of
@overload
that were pretty simple.