Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Python from treating _Callable an iterable #116

Open
uwinx opened this issue Sep 10, 2022 · 0 comments
Open

Prevent Python from treating _Callable an iterable #116

uwinx opened this issue Sep 10, 2022 · 0 comments

Comments

@uwinx
Copy link

uwinx commented Sep 10, 2022

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant