Fixes immutable types being unusable when in iterables because they were getting size checked, and also made sure to not skip size checks on iterables if a TypeError is raised while checking the size of the contents, instead only the iter(obj) line is checked by the try-except, using an else instead.
Checklist
PR Type
[ ] This PR is a code change that implements a feature request.
[x] This PR fixes an issue.
[ ] This PR adds a new feature that is not an open feature request.
[ ] This PR is not a code change (e.g. documentation, README, ...)
Other
[ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
[ ] If code changes were made then they have been tested.
[ ] I have updated the documentation to reflect the changes.
Summary
Fixes immutable types being unusable when in iterables because they were getting size checked, and also made sure to not skip size checks on iterables if a TypeError is raised while checking the size of the contents, instead only the iter(obj) line is checked by the try-except, using an else instead.
Checklist
PR Type
Other