[Django] #25093: utils.datastructures.OrderedSet doesn't implement __len__

5 views
Skip to first unread message

Django

unread,
Jul 9, 2015, 10:09:59 AM7/9/15
to django-...@googlegroups.com
#25093: utils.datastructures.OrderedSet doesn't implement __len__
-----------------------------+--------------------
Reporter: kezabelle | Owner: nobody
Type: New feature | Status: new
Component: Utilities | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------
{{{
>>> 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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25093>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 9, 2015, 10:58:13 AM7/9/15
to django-...@googlegroups.com
#25093: utils.datastructures.OrderedSet doesn't implement __len__
-----------------------------+------------------------------------

Reporter: kezabelle | Owner: nobody
Type: New feature | Status: new
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* easy: 0 => 1
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/25093#comment:1>

Django

unread,
Jul 9, 2015, 1:49:41 PM7/9/15
to django-...@googlegroups.com
#25093: utils.datastructures.OrderedSet doesn't implement __len__
-----------------------------+-------------------------------------
Reporter: kezabelle | Owner: darkryder
Type: New feature | Status: assigned
Component: Utilities | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+-------------------------------------
Changes (by darkryder):

* owner: nobody => darkryder
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/25093#comment:2>

Django

unread,
Jul 9, 2015, 2:51:48 PM7/9/15
to django-...@googlegroups.com
#25093: utils.datastructures.OrderedSet doesn't implement __len__
-----------------------------+-------------------------------------
Reporter: kezabelle | Owner: darkryder
Type: New feature | Status: assigned
Component: Utilities | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-----------------------------+-------------------------------------
Changes (by charettes):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/25093#comment:3>

Django

unread,
Jul 9, 2015, 4:06:44 PM7/9/15
to django-...@googlegroups.com
#25093: utils.datastructures.OrderedSet doesn't implement __len__
-----------------------------+---------------------------------------------

Reporter: kezabelle | Owner: darkryder
Type: New feature | Status: assigned
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by timgraham):

* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/25093#comment:4>

Django

unread,
Jul 9, 2015, 9:21:31 PM7/9/15
to django-...@googlegroups.com
#25093: utils.datastructures.OrderedSet doesn't implement __len__
-----------------------------+---------------------------------------------
Reporter: kezabelle | Owner: darkryder
Type: New feature | Status: closed
Component: Utilities | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"f675afa13ce89ea25a9798b2f7a57b091bb83dfa" f675afa]:
{{{
#!CommitTicketReference repository=""
revision="f675afa13ce89ea25a9798b2f7a57b091bb83dfa"
Fixed #25093 -- Added utils.datastructures.OrderedSet.__len__()
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25093#comment:5>

Reply all
Reply to author
Forward
0 new messages