Às 18:16 de 03/11/22, Chris Angelico escreveu:
On Fri, 4 Nov 2022 at 05:03, Paulo da Silva
<p_d_a_s_i_l_v_a...@nonetnoaddress.pt> wrote:
Changing def foos(self) -> list[int]: to
def foos(self) -> Union[list[int]]:
fixes the problem.
Not so elegant, however!
Wait, what?!
Union[X, Y] means "X or Y"
Union[X] means "X, but don't complain if it's a @property".
Is that how it goes?
I'm sorry. A bad transposition of the text. I meant
def foos(self) -> Union[list[int],int]:
Regards.
Paulo
--
https://mail.python.org/mailman/listinfo/python-list