Skip to content

Instantly share code, notes, and snippets.

View simonwhitaker's full-sized avatar

Simon Whitaker simonwhitaker

  • Oxfordshire, UK
View GitHub Profile

Python: Type Aliases vs New Types

If you're a fan of Python type hinting, you may have noticed that there are two different ways to create your own types: type aliases and using the NewType helper.

Type aliases look like this:

Vector = list[float]
@simonwhitaker
simonwhitaker / Local Host Privacy Notice.md
Last active February 5, 2023 22:34
Local Host Privacy Notice

Privacy Notice for Local Host

Local Host doesn't collect any of your data. Nothing.

  • It does not connect to any external services
  • It does not show ads
  • It does not attempt to monetise you in any way.

I hope you enjoy Local Host! If you have any questions about this privacy notice, drop me a line on hi@s1mn.io and I'll be happy

#!/usr/bin/env python3
from itertools import combinations
# `combinations` gives all possible combinations of a sequence, with each
# combination in sorted order. So e.g. `combinations([1, 2, 3, 4], 3)` will
# yield:
#
# 1, 2, 3
# 1, 2, 4