Skip to content
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

Merged
merged 2 commits into from
May 16, 2015
Merged

Remove some uses of overload #665

merged 2 commits into from
May 16, 2015

Conversation

refi64
Copy link
Contributor

@refi64 refi64 commented May 12, 2015

This fixes #432 and removes some other uses of @overload that were pretty simple.

@refi64 refi64 force-pushed the stub-fixes branch 2 times, most recently from e748deb to 4863d53 Compare May 12, 2015 15:49
@refi64
Copy link
Contributor Author

refi64 commented May 12, 2015

Yeah, I had a bunch of errors, too. I'm fixing them...

@refi64
Copy link
Contributor Author

refi64 commented May 14, 2015

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]]]],
Copy link
Contributor

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.

@spkersten
Copy link
Contributor

Of course, mypy shouldn't crash in this way as a result of a missing argument. I've made issue #673 for this.

@refi64
Copy link
Contributor Author

refi64 commented May 14, 2015

@spkersten Thanks! I didn't realize that!

What exactly do you mean by a default argument for string? re.sub doesn't have a default there...

@JukkaL
Copy link
Collaborator

JukkaL commented May 15, 2015

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.

@JukkaL
Copy link
Collaborator

JukkaL commented May 15, 2015

Fixed #674. Started another build -- hopefully it passes now.

@spkersten
Copy link
Contributor

@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.

@JukkaL
Copy link
Collaborator

JukkaL commented May 16, 2015

Looks good! Thanks for the PR!

JukkaL added a commit that referenced this pull request May 16, 2015
@JukkaL JukkaL merged commit 5f5250e into python:master May 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use typevar with values rather than overloading in 'struct' stubs
3 participants