Skip to content

Conversation

radiumatic
Copy link

Python first checks bool and then len to determine whether an object is Truthy. Given the fact that an empty cache returns 0 for the length, it breaks checks that rely on if cache instead of if cache is not None to detect whether it's initialized. This commit fixes the issue.

Python first checks __bool__ and then __len__ to determine whether an object is Truthy. Given the fact that an empty cache returns 0 for the length, it breaks checks that rely on `if cache` instead of `if cache is not None` to detect whether it's initialized. This commit fixes the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant