[issue42320] unexpected difference between map and list

2020-11-11 Thread Pierre van de Laar


Pierre van de Laar  added the comment:

Not a bug: tuple is an iterator but an iterator is not a tuple.
Yet iterators are often accepted during initialization...

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42320] unexpected difference between map and list

2020-11-11 Thread Pierre van de Laar


Pierre van de Laar  added the comment:

Zip didn't contain the test cases from the tests directory (sorry for that)

--
Added file: https://bugs.python.org/file49592/tests.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42320] unexpected difference between map and list

2020-11-11 Thread Pierre van de Laar


New submission from Pierre van de Laar :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com