Re: [PATCH v3 4/7] qapi/expr: add typing workaround for AbstractSet

2023-02-14 Thread John Snow
On Fri, Feb 10, 2023, 11:26 AM John Snow wrote: > > > On Fri, Feb 10, 2023, 10:44 AM Markus Armbruster > wrote: > >> John Snow writes: >> >> > mypy can only narrow the type of `Mapping[str, ...].keys() & Set[str]` >> > to `AbstractSet[str]` and not a `Set[str]`. As a result, if the type of >> >

Re: [PATCH v3 4/7] qapi/expr: add typing workaround for AbstractSet

2023-02-10 Thread John Snow
On Fri, Feb 10, 2023, 10:44 AM Markus Armbruster wrote: > John Snow writes: > > > mypy can only narrow the type of `Mapping[str, ...].keys() & Set[str]` > > to `AbstractSet[str]` and not a `Set[str]`. As a result, if the type of > > an expression is changed to a Mapping[], mypy is unsure if the

Re: [PATCH v3 4/7] qapi/expr: add typing workaround for AbstractSet

2023-02-10 Thread Markus Armbruster
John Snow writes: > mypy can only narrow the type of `Mapping[str, ...].keys() & Set[str]` > to `AbstractSet[str]` and not a `Set[str]`. As a result, if the type of > an expression is changed to a Mapping[], mypy is unsure if the .pop() is > safe. > > A forthcoming commit does exactly that, so wr

[PATCH v3 4/7] qapi/expr: add typing workaround for AbstractSet

2023-02-09 Thread John Snow
mypy can only narrow the type of `Mapping[str, ...].keys() & Set[str]` to `AbstractSet[str]` and not a `Set[str]`. As a result, if the type of an expression is changed to a Mapping[], mypy is unsure if the .pop() is safe. A forthcoming commit does exactly that, so wrap the expression in a set() co