Ho un problema che voglio risolvere con itertools.imap(). Tuttavia, dopo aver importato itertools nella shell IDLE e chiamato itertools.imap(), la shell IDLE mi ha detto che itertools non ha l'attributo imap. Cosa c'è che non va?Non riesco a trovare imap() in itertools in Python
>>> import itertools
>>> dir(itertools)
['__doc__', '__loader__', '__name__', '__package__', '__spec__', '_grouper', '_tee', '_tee_dataobject', 'accumulate', 'chain', 'combinations', 'combinations_with_replacement', 'compress', 'count', 'cycle', 'dropwhile', 'filterfalse', 'groupby', 'islice', 'permutations', 'product', 'repeat', 'starmap', 'takewhile', 'tee', 'zip_longest']
>>> itertools.imap()
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
itertools.imap()
AttributeError: 'module' object has no attribute 'imap'
Può essere interessante anche per dare un'occhiata a [itertools.starmap] (https://docs.python.org/3.6/library/itertools.html#itertools.starmap) in pyhton3. –