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

Don't use basestring in tempfile stub #205

Merged
merged 1 commit into from
May 24, 2016
Merged

Conversation

JukkaL
Copy link
Contributor

@JukkaL JukkaL commented May 17, 2016

Fixes #202.

TemporaryDirectory has some Any types because we have no way of inferring a precise return or attribute type in all cases. I chose to use Any instead of a union type since the latter would require a cast or isinstance() on many call sites.

Mypy has trouble with some of the definitions such as mkdtemp (python/mypy#1541) but this is acceptable since it falls back to Any instead of inferring an incorrect type.

@amirbaron
Copy link

@JukkaL Thanks!

@gvanrossum gvanrossum merged commit b98580d into master May 24, 2016
@gvanrossum gvanrossum deleted the tempfile-basestring branch June 6, 2016 01:49
momandine pushed a commit to momandine/typeshed that referenced this pull request Jul 5, 2016
(This is a little sad when using py.test, but it's the idiom used in the stdlib, and it allows testing with -O.)
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.

3 participants