utils.datastructures.OrderedSet doesn't implement __len__
>>> x = set([1, 2])
>>> len(x)
2
>>> from django.utils.datastructures import OrderedSet
>>> y = OrderedSet([1, 2])
>>> len(y)
TypeError: object of type 'OrderedSet' has no len()
Given the implementation of __iter__
, it seems like it would be plausible to re-use that:
>>> len([z for z in y])
2
Change History
(5)
Easy pickings: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to Sambhav Satija
|
Status: |
new → assigned
|
Has patch: |
set
|
Needs tests: |
set
|
Patch needs improvement: |
set
|
Needs tests: |
unset
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
PR: https://github.com/django/django/pull/4973/files