-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
New attr.cmp_using helper function #787
Conversation
Hello @hynek, I've added the function It is still draft for one reason. I've used My question therefore is "how much does this matter"? If this this matters, then we need an alternative to Let me know what you think. Thanks |
Example of numpy usage:
|
Finally, I believe we should update the following warning:
If it is possible to tell that |
Oh god that's a lot more code than I hoped for. 😅 Firstly, I don't think the qualname stuff matters at all, but it seems like your Comparable creation is more complicated than it needs to be. Have you considered building a dict and then using Also you broke almost all builds. :D |
Got it, I'll simplify it then. :-)
PS: the builds are breaking intentionally, as I committed a failing test.
That is why I marked the PR as draft.
…On Wed, 14 Apr 2021 at 12:10, Hynek Schlawack ***@***.***> wrote:
Oh god that's a lot more code than I hoped for. 😅
Firstly, I don't think the qualname stuff matters at all, but it seems
like your Comparable creation is more complicated than it needs to be.
Have you considered building a dict and then using new_class() (we have a
helper in _compat for Python 2) instead of patching an existing class?
Also you broke almost all builds. :D
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#787 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMJFPAEFEZHLO57VV6L2HTTIVZZ5ANCNFSM42X3QSBQ>
.
|
cough 😇 |
…ns NotImplemented
…ns NotImplemented
So... here is a version using I even installed Python 2.7 to be sure everything worked. 😄 |
From Happy to rollback if you want. |
Yeah, |
Sure thing.
…On Sat, Apr 24, 2021, 14:19 Hynek Schlawack ***@***.***> wrote:
Yeah, __init__.pyi. I think we might be still excluding pyi files from
black? I’ll need to re-investigate. Anyhow, the removed empty lines are
nice, please give them back. :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#787 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMJFPHWCVBHPQJSEFQQAZTTKLANPANCNFSM42X3QSBQ>
.
|
Nice! This looks great to me yeah! |
Revert done. Pre-commit is not picking up any formatting error after reverting the commit, so all good. I might have caused this by running black directly rather than via pre-commit. |
Thanks! I'll write some docs and look into the warning thing! |
Big props for sticking with this @botant. |
Pull Request Check List
This is just a friendly reminder about the most common mistakes. Please make sure that you tick all boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!
If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing left to do. If your pull request is a documentation fix or a trivial typo, feel free to delete the whole thing.
.pyi
).tests/typing_example.py
.docs/api.rst
by hand.@attr.s()
have to be added by hand too.versionadded
,versionchanged
, ordeprecated
directives. Find the appropriate next version in our__init__.py
file..rst
files is written using semantic newlines.changelog.d
.If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!