Skip to content

Instantly share code, notes, and snippets.

@StanFromIreland
StanFromIreland / README.md
Created October 28, 2026 11:30
`list.remove` ignore-if-not-present idioms in the top 5000 PyPI packages

list.remove ignore-if-not-present idioms in the top 5000 PyPI packages

In the two attached files, the raw data from the PyPI search is available (slightly edited for readability):

  • idiom-1: if-check idiom
  • idiom-2: try/except idiom

Examples

From that data, here are a few cherry-picked examples from the top 5000 PyPI packages: