LeeeeT

Results 22 comments of LeeeeT

@Akuli why do you think there should be an error for `set[int] - set[str]`? The resulting set can only contain `int`s, regardless of the elements type of the second set.

@Akuli that makes sense. But what about `__isub__`, `__and__`, `__iand__`, `intersection`, `difference`, `intersection_update` and `difference_update`? https://github.com/python/typeshed/blob/cf9bdc2d9861cb61e76b512988d19afe232a958f/stdlib/builtins.pyi#L1101 Shouldn't they take `AbstractSet[_T | None]` (for dunder methods) and `Iterable[_T | None]` (for...

@Akuli you mentioned that when we do `set[TypeA] - set[TypeB]`, we want `TypeB` to be `AnythingThatCanBe[TypeA]`. But isn't it just any type? We can always create a subtype of `TypeB`...

My proposal is to make `__sub__` and related methods accept `AbstractSet[object]`. Passing a set of arbitrary type to these methods would never cause an error at runtime. So I think,...

What broken code are you talking about? The code in #1840 **may** be considered broken because it's no-op. But it's no-op only because we can't create a subclass of both...

When you write `set[Foo]` or `set[Bar]` you have to keep in mind that these sets can contain objects that are simultaneously `Foo` and `Bar`. The fact that you can't annotate...

Another example: ```python my_ints = {1, 2, 3} my_objs = {1, None, 'a', 2} print(my_ints - my_objs) # {3} ``` I'm getting an error for the last line. This is...

I'll note that even with the working definition of `map2`, if I try to define a function that converts the sum of two ints into a string, pyright gives me...