Skip to content

Commit

Permalink
docs: list snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdt committed Jul 23, 2024
1 parent 7fc43cd commit c3dc82e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/actionsheets/data/python/collections/list.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ details = "Considerably faster than list comprehension"
what = "Sample _n_ random numbers between [ _a_, _b_ ) w/o replacement"
code = "random.sample(range(a, b), n)"

[create.lists.iter]
what = "From different lists, generated dynamically by iterating over a list-generating function"
code = """
list(itertools.chain.from_iterable(
[generate_my_list(e) for e in entries]
))
"""

[test]
section = "Test"
Expand Down

0 comments on commit c3dc82e

Please sign in to comment.