On 2022-10-30 20:43:23 +0100, Peter Otten wrote: > On 30/10/2022 14:37, Peter J. Holzer wrote: > > On 2022-10-30 09:23:27 -0400, Thomas Passin wrote: > > > On 10/30/2022 6:26 AM, Peter J. Holzer wrote: > > > > On 2022-10-29 23:59:44 +0100, Paulo da Silva wrote: > > > > > The funny thing is that if I replace foos by Foos it works because it > > > > > gets > > > > > known by the initial initialization :-) ! [...] > > > > Yes. I was referring to the code as written. Why does that work? I don't > > think it should. > > For me it makes sense. I think mypy should refrain from trying to figure > out order of execution.
I was unclear, sorry. What I meant was "why does replacing foos by Foos make the error disappear?" not "why do forward references work?". But may have misunderstood what Paulo meant as I cannot reproduce his results. So maybe the behaviour I don't understand (and would consider buggy) doesn't actually exist. hp -- _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | h...@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"
signature.asc
Description: PGP signature
-- https://mail.python.org/mailman/listinfo/python-list