8000 Replace lib2to3.fixes.fix_dict to avoid unnecessarily list() calls · Issue #304 · PythonCharmers/python-future · GitHub
[go: up one dir, main page]

Skip to content
Replace lib2to3.fixes.fix_dict to avoid unnecessarily list() calls #304
Open
@xmo-odoo

Description

@xmo-odoo

lib2to3.fixes.fix_dict will basically wrap any call to dict.keys(), .values() or .items() in list() no matter its context.

However as far as I can tell the calls are more or less pointless when the result is either directly iterated upon (e.g. for k, v in d.items()) or checked for containment (e.g. if a in d.keys()) leading to lots of diff-noise to revert.

Would be nice if python-future had its own dict-iteration fixer avoiding this annoyance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0