Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

<lilo> I've always wanted to have a web site with a big picture of a carrot on it


devel / comp.lang.python / from __future__ import annotations bug?

SubjectAuthor
o from __future__ import annotations bug?Joseph Garvin

1
from __future__ import annotations bug?

<mailman.152.1688164551.23016.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23728&group=comp.lang.python#23728

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: k04j...@gmail.com (Joseph Garvin)
Newsgroups: comp.lang.python
Subject: from __future__ import annotations bug?
Date: Fri, 30 Jun 2023 17:35:36 -0500
Lines: 16
Message-ID: <mailman.152.1688164551.23016.python-list@python.org>
References: <CAH=MJ4YZ+dvT8Hbfgh9701rxH-wsLE-0LG6=BB8B_Z1RhA+JeQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de vfotr8lbX7Two+fXhWPhBAE2rsS4B0acbgH2dEFcCZuQ==
Return-Path: <k04jg02@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=la+iAHqW;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.040
X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'despite': 0.05; 'pep':
0.07; 'subject:import': 0.07; 'subject:bug': 0.09; 'import': 0.15;
'649': 0.16; '__future__': 0.16; 'cpython': 0.16; 'received:mail-
ot1-x329.google.com': 0.16; 'typing': 0.16; 'to:addr:python-list':
0.20; "isn't": 0.27; 'realize': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; 'mean': 0.34;
'received:google.com': 0.34; 'trying': 0.35;
'from:addr:gmail.com': 0.35; 'subject:from': 0.37; "it's": 0.37;
'class': 0.37; 'though': 0.37; 'error,': 0.38; 'still': 0.40;
'forward': 0.62; 'here': 0.62; 'skip:b 10': 0.63; 'look': 0.65;
'skip:t 20': 0.66; '8bit%:25': 0.80; 'prevented': 0.84;
'supposedly': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20221208; t=1688164548; x=1690756548;
h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
:date:message-id:reply-to;
bh=8ZV7cURJ/O9/oE+x+EtW9+4jSn5zzSqpxf7oeY40Le0=;
b=la+iAHqW+a4aaMdFJUlh/YMGtwCuwmQflI4VBaIFAfmu0KBPCPwjpkCgu9IWW1tBIP
NUezSPuEWLIP1MIYTGvL8d4L/oNhPatpQt+z2/eKEnyqv91IwX+qXK2QAE3krUc8wX0b
ZXatJpDdxA9Bfhpf1nwCkunVEGLTMHiXXUWo1eYhlrC7kBr4nL1dE6IyV+o0MSwmr+OS
A4xX+VXHt8nYG1So1G02vLiQDbdpLEH0FLHUenZrXcdoukYILw35AV2E20eTBZ7xoeQ/
A0NNxornRpkpqGjqQ2alvq99hPO7j72PvIm8+orLXwLqZcpWyUfp9hiUkVQUYBjUBZgH
1weQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20221208; t=1688164548; x=1690756548;
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=8ZV7cURJ/O9/oE+x+EtW9+4jSn5zzSqpxf7oeY40Le0=;
b=jQxe1Dks7aKTedJ3K6zyFkvwK+go6G2mVapfUiHk+UdxRACOruOmI4GkmdywLi7cwQ
kTUAcXjoc7/VOwQiWh9OodnYZvZZcL6KwI0XqMMqnMJLwjwtjPxOagrrsiDxxxkNmlVs
M5xyz39N9CAmBz/fV+T2nP2fS8uloyk6bdDCCjJAJ2uMVD7r6cKCjyRLjYgJ2EcBTL89
M079Qc4dHoN3bN7JTt1O0aep1kE882ug/8kFuA5v1uq8MPmI667yo9RVt+h1ZaMnkL+6
UYs1W3nrWgsISYUVrBDFWM1Q6DMFkGcHd8kSqacqw0VjHfIbwSHo/iZQt70OeTWTJPwH
buoA==
X-Gm-Message-State: AC+VfDyE9rvjl7bux+jH3OFE559sDxE5aWQcOzz/Mg214S5frClTU2c7
Ky714SxF6VZ7nwh2pkcvnLHT61l0bO2yg8Sx46XnUWuGQ14=
X-Google-Smtp-Source: ACHHUZ57fwad/8j0oEZPFaPcVMgC5t+p6urw7Dhd61Nh67YKGqU3tZ3p7GeAXqf3RATu0hMPzLGevy4wvQYOPNFjwH4=
X-Received: by 2002:a05:6830:159:b0:6b2:940b:dcf2 with SMTP id
j25-20020a056830015900b006b2940bdcf2mr4518511otp.24.1688164548229; Fri, 30
Jun 2023 15:35:48 -0700 (PDT)
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAH=MJ4YZ+dvT8Hbfgh9701rxH-wsLE-0LG6=BB8B_Z1RhA+JeQ@mail.gmail.com>
 by: Joseph Garvin - Fri, 30 Jun 2023 22:35 UTC

```
from __future__ import annotations
from typing import Generic, TypeVar

T = TypeVar("T")
class Foo(Generic[T]): ...
class Bar(Foo[Buzz]): ... # NameError here
class Buzz: ...
```

This will error, despite the __future__ import, because cpython is trying
to look up Buzz before it's defined, even though we have supposedly
prevented annotations from being processed. I realize that Class[Args] is
allowed in that area in general and isn't always type annotation related,
but does this mean that even with PEP 649 that forward references will
still be needed?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor