Skip to content

Instantly share code, notes, and snippets.

@Zeturic
Created March 12, 2022 03:45
Show Gist options
  • Save Zeturic/6bc449fecdc77c3fc6e88d1bbbfdeb88 to your computer and use it in GitHub Desktop.
Save Zeturic/6bc449fecdc77c3fc6e88d1bbbfdeb88 to your computer and use it in GitHub Desktop.
parentheses in `struct` format strings for substructures
`pathlib.Path.read_lines` and `pathlib.Path.write_lines`
lazy version of str.splitlines
easier way to manage range objects
method that returns (start, stop, step) as a tuple
methods that take return modified copies
ChainSet
OrderedSet
read-only proxies for lists and sets
collections.abc classes should have useful reprs
optionally ensure that all keys are strings when encoding into json
string literal that doesn't even allow escaping quotes
iterator that remembers current value
currying as a method on functions
list literals should be properly sized
list comprehensions should use length_hint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment