Skip to content

Create deque instance directly from range object. - #33

Merged
yasoob merged 1 commit into
yasoob:masterfrom
homeworkprod:patch-1
Aug 18, 2015
Merged

Create deque instance directly from range object.#33
yasoob merged 1 commit into
yasoob:masterfrom
homeworkprod:patch-1

Conversation

@homeworkprod

Copy link
Copy Markdown
Contributor

Explicitly iterating over the range object in the form of a list comprehension (BTW, a generator expression here would be more appropriate, and easier to read) without transforming or filtering elements is unnecessary, so the range object can be used to directly feed its values to the deque on instantiation.

Explicitly iterating over the range object in the form of a list comprehension (BTW, a generator expression here would be more appropriate, and easier to read) without transforming or filtering elements is unnecessary, so the range object can be used to directly feed its values to the deque on instantiation.
@homeworkprod

Copy link
Copy Markdown
Contributor Author

Works on both Python 2 (tested on 2.7.9) and 3 (tested on 3.4.2).

yasoob added a commit that referenced this pull request Aug 18, 2015
Create deque instance directly from range object.
@yasoob
yasoob merged commit 386360e into yasoob:master Aug 18, 2015
@yasoob

yasoob commented Aug 18, 2015

Copy link
Copy Markdown
Owner

Thanks! 👍

@homeworkprod
homeworkprod deleted the patch-1 branch September 8, 2015 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants