gh-141647: attribute breaks __eq__ behaviour of IPv4Network and IPv6Network#141651
gh-141647: attribute breaks __eq__ behaviour of IPv4Network and IPv6Network#141651yihong0618 wants to merge 5 commits into
Conversation
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
picnixz
left a comment
There was a problem hiding this comment.
Actually, we also have a similar issue in _BaseNetwork.__contains__. version is being checked before the other type. Likewise, _BaseNetwork.address_exclude checks version before checking the type of other. And there are many more methods which check other.version before checking other. I will take care of this separately.
Thank you very much again. |
|
Urhg, there are other places where |
of course its fine, I like that. |
|
closing as discuss~ cc @picnixz |
|
Actually, it's even more complex... we have mixed type equalities that are allowed, so we cannot just check with |
yes, also think about that, but old code check it, so in my patch I think its fine. and this is not doc, I wonder user own their risk? |
compore to other
__eq__always use subclass check.versionattribute inipaddressclasses break many methods #141647