-
Notifications
You must be signed in to change notification settings - Fork 23
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
Ban defining __repr__
and __str__
in stubs
#109
Conversation
I've realised that I actually have no idea whether this is compatible with Python 2 or not. |
|
That's only if you use old-style classes. If you use a new-style class (with |
Are we 100% sure that all Python 2 classes in typeshed are new-style classes? |
Probably not. But it doesn't really matter anyway, removing |
typeshed PR here: python/typeshed#6968 |
Okay, I have a test case that I only want to run on 3.8+ (the code I've written is 3.7-compatible, but the test I've written for the 3.8+ case isn't). @Akuli, any thoughts on the simplest way to do that? |
I added this in python#6968 to make the CI go green for PyCQA/flake8-pyi#109, but we've since decided that we only want to raise errors for `__str__` and `__repr__` if the signature is an exact match for `object.__str__`/`object.__repr__`. So this `# noqa` shouldn't be necessary.
(Closing and reopening to check that typeshed-primer still passes after python/typeshed#6979.) |
I have deleted the Python 3.7-incompatible test case for now, and created #111. |
No description provided.