# Bug report

### Bug description:

This works:

```python
class customdict(dict):
    def __missing__(self, key):
        return key

code = compile("type Alias = undefined", "test", "exec")
ns = customdict()
exec(code, ns)
Alias = ns["Alias"]
assert Alias.__value__ == "undefined"
```

But this does not:

```python
code = compile("class A: type Alias = undefined", "test", "exec")
ns = customdict()
exec(code, ns)
Alias = ns["A"].Alias
assert Alias.__value__ == "undefined"
```

This is a problem for PEP 649 because we're going to rely on a non-dict globals namespace.

### CPython versions tested on:

CPython main branch

### Operating systems tested on:

macOS

<!-- gh-linked-prs -->
### Linked PRs
* gh-119822
* gh-119889
* gh-119890
* gh-119975
<!-- /gh-linked-prs -->

Name lookup in annotation scopes in classes does not work with non-dict globals
This is a GitHub Issue
repo:cpython
owner:python
Title : Name lookup in annotation scopes in classes does not work with non-dict globals
Issue date:

--- start body ---
# Bug report

### Bug description:

This works:

```python
class customdict(dict):
    def __missing__(self, key):
        return key

code = compile("type Alias = undefined", "test", "exec")
ns = customdict()
exec(code, ns)
Alias = ns["Alias"]
assert Alias.__value__ == "undefined"
```

But this does not:

```python
code = compile("class A: type Alias = undefined", "test", "exec")
ns = customdict()
exec(code, ns)
Alias = ns["A"].Alias
assert Alias.__value__ == "undefined"
```

This is a problem for PEP 649 because we're going to rely on a non-dict globals namespace.

### CPython versions tested on:

CPython main branch

### Operating systems tested on:

macOS

<!-- gh-linked-prs -->
### Linked PRs
* gh-119822
* gh-119889
* gh-119890
* gh-119975
<!-- /gh-linked-prs -->

--- end body ---

None