| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Interestingly for frozenset we have tight typing for the Iterable generic. That might be because it's covariant, so I wonder if we could get away with that here as well.
Sorry, something went wrong.
Yeah - we just had Any for set so wasn't totally sure. Let me give that a try. |
Sorry, something went wrong.
Actually, I think we want Any, frozenset rejects this, which seems overly strict: keys = frozenset(["foo", "bar", "baz"])
keys.isdisjoint({"baz", "qux"})
keys.isdisjoint(["baz", "qux"])
# Rejects
keys.isdisjoint([1, 2])Unless we wanted to use overloading to say that we know for certain isdisjoint returns True if the there's no intersection between the types. |
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, container overlaps are one of the relatively few places where typeshed has sometimes tried to get a little stricter than the usual "default to minimising false positives". I think typeshed also does this for e.g. set.__sub__
My instinct is to try it the stricter way and relax it if we ever get a real user complaint about it, but happy to go along with whatever others think is best
Sorry, something went wrong.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
Sounds good @hauntsaninja, @JelleZijlstra! |
Sorry, something went wrong.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add new isdisjoint method for 3.13.