Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-33961: Adjusted docs to correct exceptions raised. #7917
Conversation
This comment has been minimized.
This comment has been minimized.
the-knights-who-say-ni
commented
Jun 25, 2018
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. When your account is ready, please add a comment in this pull request Thanks again for your contribution, we look forward to reviewing it! |
This comment has been minimized.
This comment has been minimized.
CLA has been signed. |
Thanks! |
24d74bd
into
python:3.7
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jul 2, 2018
Thanks @chmarr for the PR, and @ericvsmith for merging it |
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jul 2, 2018
Sorry, @chmarr and @ericvsmith, I could not cleanly backport this to |
This comment has been minimized.
This comment has been minimized.
Hi @chmarr @ericvsmith, I was looking at the dataclasses docs and it seems to me that this PR has been merged into 3.7 only, but should be backported to 3.8 and to master. Thanks, |
This comment has been minimized.
This comment has been minimized.
Just looking at the history of this PR, it looks like the change was made to 3.8 (so presumably is also in 3.9), but wasn't backported to 3.7. I haven't had time yet to verify that. But if you verify it, and you can check that 3.7 works the same as 3.8 with regard to this exception, then we should create a PR that updates 3.7. |
This comment has been minimized.
This comment has been minimized.
Hi, I've found the behavior to be consistent across 3.7 and 3.8 (I haven't tried with 3.9): from dataclasses import dataclass
from unittest import TestCase
class OrderedDataclassTestCase(TestCase):
def test_lt(self):
with self.assertRaises(TypeError):
@dataclass(order=True)
class C:
def __lt__(self, other):
return self
def test_le(self):
with self.assertRaises(TypeError):
@dataclass(order=True)
class C:
def __le__(self, other):
return self
def test_gt(self):
with self.assertRaises(TypeError):
@dataclass(order=True)
class C:
def __gt__(self, other):
return self
def test_ge(self):
with self.assertRaises(TypeError):
@dataclass(order=True)
class C:
def __ge__(self, other):
return self As far as this PR is concerned, I don't find any indication about it originally targeting 3.8 https://docs.python.org/3.7/library/dataclasses.html#module-level-decorators-classes-and-functions (correct: https://docs.python.org/3.8/library/dataclasses.html#module-level-decorators-classes-and-functions (wrong: https://docs.python.org/3.9/library/dataclasses.html#module-level-decorators-classes-and-functions (wrong: Thanks for your time, I hope I haven't missed something obvious. |
This comment has been minimized.
This comment has been minimized.
Hmm, but the PR was, in fact, merged on the 3.7 branch so the 3.7 backport label was useless and that's why it's still there. I guess we didn't notice that the original PR was submitted against 3.7 rather than master. So it may need to be forward ported to master and 3.8. |
This comment has been minimized.
This comment has been minimized.
@ned-deily yes, that's the conclusion I've come to as well. I'm willing to open any PRs to fix this if you want; it would be my first contribution to CPython though, and I'm not sure if there are any other standard workflows that better address cases like this. |
This comment has been minimized.
This comment has been minimized.
I guess I didn't notice that this was against 3.7: no wonder it wouldn't backport! @sanjioh : I think you can just make a new PR for the original issue, against master. |
This comment has been minimized.
This comment has been minimized.
@ericvsmith Done, see #17677 |
chmarr commentedJun 25, 2018
•
edited by bedevere-bot
https://bugs.python.org/issue33961