-
Notifications
You must be signed in to change notification settings - Fork 207
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
Use zip for iterating over the formatted values #206
Use zip for iterating over the formatted values #206
Conversation
I think we could also update Now this change is not very explicitly showing the root-cause that we're dealing with strings, I think we need to fix in the right place. |
By definition, >>> from collections.abc import Sequence
>>> from sqlalchemy.orm.collections import InstrumentedList
>>> isinstance(InstrumentedList(), Sequence)
True But, choosing the minimum interface for treating value is generally good. If we just need to iterate over the value to render, we can use On the other hand, if we plan to use |
Note that >>> from collections.abc import Sequence
>>> isinstance("foo", Sequence)
True |
Anyway, I think merging this PR will not affect your design decision because |
@okapies Yes you're right about the definitions, my comment was not really accurate. But since |
I know this won't discard your PR, using |
Ok. Anyway, could you please release a new version including #204? It is a show-stopper for our app. |
Yes sure, I'll merge these and do the release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR 👍
🙇 |
Fix to use
zip
for iterating over the formatted values. It prevents retrievingformatted_value
by index especially when it isIterable
but notSequence
.Ref. #204.