mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
transform izip_longest #11424
This commit is contained in:
parent
3f84b07816
commit
49d7149e6d
3 changed files with 32 additions and 16 deletions
|
|
@ -31,9 +31,10 @@ class FixItertoolsImports(fixer_base.BaseFix):
|
|||
if member_name in ('imap', 'izip', 'ifilter'):
|
||||
child.value = None
|
||||
child.remove()
|
||||
elif member_name == 'ifilterfalse':
|
||||
elif member_name in ('ifilterfalse', 'izip_longest'):
|
||||
node.changed()
|
||||
name_node.value = 'filterfalse'
|
||||
name_node.value = ('filterfalse' if member_name[1] == 'f'
|
||||
else 'zip_longest')
|
||||
|
||||
# Make sure the import statement is still sane
|
||||
children = imports.children[:] or [imports]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue