[New-bugs-announce] [issue36070] Enclosing scope not visible from within list comprehension

Nathan Woods report at bugs.python.org
Thu Feb 21 18:25:38 EST 2019


New submission from Nathan Woods <charlesnwoods at gmail.com>:

The following code works in an interactive shell or in a batch file, but not when executed as part of a unittest suite or pdb:

from random import random
out = [random() for ind in range(3)]

It can be made to work using pdb interact, but this doesn't help with unittest.

Tested in Python 3.7.2

----------
messages: 336270
nosy: woodscn
priority: normal
severity: normal
status: open
title: Enclosing scope not visible from within list comprehension
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36070>
_______________________________________


More information about the New-bugs-announce mailing list