-
Notifications
You must be signed in to change notification settings - Fork 643
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
length
filter should also handle objects
#283
Comments
Right, that'd match Jinja2's behaviour given how JavaScript objects are often used as Python dictionaries. But what about objects with a |
It'd be a minor breaking change, but I still think it's the right thing to do. Marking this as a 3.0 change, since I don't want the breaking change in a 2.x release. |
I don't think "object with length property" is really a reasonable thing for someone to be taking advantage of currently, so I'm going to consider this a bugfix rather than a breaking change. |
In length builtin filter. For objects, "length" is the number of keys the object has. Fixes mozilla#283
In length builtin filter. For objects, "length" is the number of keys the object has. Fixes mozilla#283
Make
length
return the number of a keys an object has.The text was updated successfully, but these errors were encountered: