Arie Bovenberg
Arie Bovenberg
Also a frequent violation in typing stubs: WPS112. ```python class Copy(Protocol): def __call__(self, __origin: T) -> T: ... ``` ``` WPS 112 Found private name pattern: __origin ``` However, this...
Interesting! Note though that once you abuse one of the container interfaces (iter, getitem, contains, etc.), the others are pretty much off the table as well (otherwise you get a...
One problem with the union approach, I found, was that you can't have nice classmethods on the union. Something like `Maybe.from_optional` wouldn't be possible if `Maybe` was a union. It'd...
I'll illustrate with this example: ```python from typing import NamedTuple class User(NamedTuple): id: int nickname: Maybe[str] first_name: Maybe[str] last_name: str joined: datetime job: Maybe[str] location: Maybe[int] ``` ## Setdefault There...
@CucumisSativus Thanks for the feedback! 😉 If you don't mind though, I was actually really looking forward to implementing these, after being given the green light. I'm really interested in...
@sobolevn agree to implement all methods? - [x] `filter` - [ ] `zip` - [ ] `setdefault` -- also agree on the name? - [ ] `and_` and `or_` Then...
I'm definitely willing to defer to your preference on this matter. But let's see if I can make the case for methods... In the absence of first-class support for currying...
@CucumisSativus probably best if you pick up `zip` as well. Just like `filter` it only works on maybes. I'll pick up `setdefault`, `and_`, `or_`
@CucumisSativus Interesting! I was thinking about the signature `Result[T, U], Result[V, W] -> Result[(T, V), (U, W)]`, which would not be possible for arbitrary errors. But `Result[T, U], Result[V, W]...
Also a decision to make: if we make `zip` a standalone function, it'd conflict with Python's builtin `zip`. We need to choose one of: 1. it's up to the library...