# PEP 667 -- Consistent views of namespaces

**URL:** <https://discuss.python.org/t/pep-667-consistent-views-of-namespaces/46631>\
**Category:** PEPs\
**Created:** [February 22, 2024, 11:39am UTC](https://discuss.python.org/t/pep-667-consistent-views-of-namespaces/46631 "2024-02-22T11:39:37Z")\
**Posts on this page:** 1\
**Showing post:** 36

<div class="post-metadata">

**Author:** ![bluetech](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/bluetech/32/8859_2.png) [@bluetech](https://discuss.python.org/u/bluetech)\
**Post date:** [May 17, 2024, 7:43am UTC](https://discuss.python.org/t/pep-667-consistent-views-of-namespaces/46631/36 "2024-05-17T07:43:02Z")

</div>

Pytest has some non-critical (and kinda terrifying) [testing code](https://github.com/pytest-dev/pytest/blob/fdf3aa3fc35ee6d336eafef5016f308b5e57bddb/src/_pytest/pytester.py#L288-L298) like this (paraphrasing):

```py
backlocals = sys._getframe(1).f_locals
eval(..., backlocals, ...)

```

which started failing in Python 3.13 beta with “TypeError: globals must be a real dict; try eval(expr, {}, mapping)”.

I am changing this to `backlocals = dict(sys._getframe(1).f_locals)`, just wanted to leave a note in case this was somehow not intended.

---

_[View the full topic](https://discuss.python.org/t/pep-667-consistent-views-of-namespaces/46631)._
