Skip to content

Prevent Python from treating _Callable an iterable #116

Open
@uwinx

Description

@uwinx

Problem

Due to lack of __iter__ implementation, Python is attempting to iterate over _Callable when possible. It's generally an undesired behavior, given the purposes of the _Callable class.

You can easily reproduce the issue:

[*__import__("lambdas")._]

Implementation

That should be a no-brainer to fix and write tests for.

class _Callable:
    __iter__ = None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions