[New-bugs-announce] [issue42320] unexpected difference between map and list

Pierre van de Laar report at bugs.python.org
Wed Nov 11 03:54:28 EST 2020


New submission from Pierre van de Laar <pierre.van.de.laar at gmail.com>:

On windows, with python 3.9, with unittests,

My test case fails when I use the following lines of code
```
result = map(lambda x: self.substitute_in_expression(x),
                     sequence.sequence)
```
It works fine with
```
result = list()
for x in sequence.sequence:
     result.append(self.substitute_in_expression(x))
```

Note that result is used as input for an inherited class instantiation:
```
        sequence_type = type(sequence)
        return sequence_type(result)
```
The classes are constructed using the dataclass decorator!


I have unfortunately not have time to make a small reproducer.
So I just send the whole project.

----------
files: bug.zip
messages: 380742
nosy: Pierre van de Laar
priority: normal
severity: normal
status: open
title: unexpected difference between map and list
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49591/bug.zip

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


More information about the New-bugs-announce mailing list