Opened 7 years ago

Closed 7 years ago

#14568 closed enhancement (fixed)

prepend list to lazy_list

Reported by: vdelecroix Owned by: vdelecroix
Priority: major Milestone: sage-5.10
Component: misc Keywords: lazy list
Cc: Merged in: sage-5.10.rc0
Authors: Vincent Delecroix Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

The patch allows to prepend a (finite) list to a (potentially infinite) infinite list:

sage: from sage.misc.lazy_list import lazy_list
sage: from itertools import count
sage: l = lazy_list(i**2 for i in count()); l
lazy list [0, 1, 4, ...]
sage: ['toto', 'bibi'] + l
lazy list ['toto', 'bibi', 0, ...]

Attachments (1)

trac_14568-prepend_list_to_lazy_list.patch (2.0 KB) - added by vdelecroix 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by vdelecroix

  • Status changed from new to needs_review

comment:2 follow-up: Changed 7 years ago by tscrim

  • Authors changed from vdelecroix to Vincent Delecroix
  • Reviewers set to Travis Scrimshaw

Hey Vincent,

Two minor things. First, you have a typo on line 40: arround should be around. Second, the commit message should have a short description on the first line; something like:

#14568: Allows to prepend a list to a lazy list.

Otherwise looks good.

Best,
Travis

Changed 7 years ago by vdelecroix

comment:3 in reply to: ↑ 2 Changed 7 years ago by vdelecroix

Replying to tscrim: Hi Travis,

Two minor things. First, you have a typo on line 40: arround should be around. Second, the commit message should have a short description on the first line; something like:

#14568: Allows to prepend a list to a lazy list.

done.

Otherwise looks good.

great !

Thanks for having a look, Best, Vincent

comment:4 Changed 7 years ago by tscrim

  • Status changed from needs_review to positive_review

Thanks Vincent.

comment:5 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.10.rc0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.