Skip to content

Make tuple generic in most stubs #3767

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

Merged
merged 2 commits into from
Jul 26, 2017
Merged

Make tuple generic in most stubs #3767

merged 2 commits into from
Jul 26, 2017

Conversation

pkch
Copy link
Contributor

@pkch pkch commented Jul 26, 2017

Per @ilevkivskyi suggestion, making tuples generic in stubs to reduce incompatibility between stubs and production.

This is a carve-out from #3129.

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just two small suggestions.

@@ -11,7 +11,7 @@ class int: pass
class str: pass
class dict: pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could also fix dict and set (on next line)? There are few of them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that if you also fix few dicts and sets, then we could turn on the asserts that are now commented out.

class function: pass
class ellipsis: pass
class list: pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there is still one more tuple not fixed in isinstancelist.pyi.

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I will merge soon. The next step would be to turn on the asserts that are commented out now.

@ilevkivskyi ilevkivskyi merged commit 9104d55 into python:master Jul 26, 2017
@gvanrossum
Copy link
Member

gvanrossum commented Jul 26, 2017 via email

@ilevkivskyi
Copy link
Member

@gvanrossum

Can you please measure how much slower this made the tests?

Before: 3m7s
After: 3m9s

The full test runs two more seconds, i.e. less than 1% of total time.

@gvanrossum
Copy link
Member

OK, that's fine then. In general the tests have become slower over time, in part because mypy itself became slower; but IIRC we had a recent test speedup, and this slowdown is negligible.

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