
Product
A New Design for GitHub PR Comments
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
Listo is an enhanced version of the list
type that aims to do the following:
list
type. For example, listo
has a first
method that returns self[0]
listo
object, but a single argument that is an iterator will be unpacked into a listo
object. This is useful for when you want to pass in a generator or other iterator into a function that expects a listFirst install it via pip, poetry, or whatever you use
pip install listo
Then use it in your code
from listo import listo
lst = listo(1, 2, 3)
assert lst.first() == 1
assert lst.last() == 2
For arguments passed in, it just converts them to a listo
object
lst = listo(1, 2, 3)
assert lst == [1, 2, 3]
lst2 = listo([1, 2, 3]) # list is unpacked
assert lst2 == [1, 2, 3]
lst3 = listo((1, 2, 3)) # tuple is converted and unpacked
assert lst3 == [1, 2, 3]
lst4 = listo([1, 2, 3], (1, 2)) # Two args mean nothing is unpacked
assert lst4 == [[1, 2, 3], (1, 2)]
This is different from standard Python iterator behavior.
Have you tried using Listo and found it useful? Do you have ideas for how to make it better?
We welcome contributions from the community!
See CONTRIBUTING.md for details on how to set up your development environment to contribute to this project, run tests, check code quality, release new versions, and more.
FAQs
An improved version of the List built-in
We found that listo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
Security News
Slopsquatting is a new supply chain threat where AI-assisted code generators recommend hallucinated packages that attackers register and weaponize.