Archive
All published posts
Jan 17 – Jan 23, 20224 years ago
Featured this weekLink
Jan 10 – Jan 16, 20224 years ago
Featured this weekWriting
functools.total_ordering makes adding all of six of the rich comparison operators to your custom classes much easier, and more likely that you remember all of them.
From the Docs: The class must define one of __lt__(), __le__(), __gt__(), or __ge__ In addition, the class should supply an __eq__() method.
one of these
- lt()
- le()
- gt()
- ge()
and required to have this one
- eq()
Here is an example using the Enum I was working on the other day.
from enum import Enum, auto
from functools import total_ordering
@total_ordering
class LifeCycle(Enum):
configure = auto()
glob = auto()
load = auto()
pre_render = auto()
render = auto()
post_render = auto()
save = auto()
def __lt__(self, other):
try:
return self.value < other.value
except AttributeError:
return self.value < other
def __eq__(self, other):
try:
return self.value == other.value
except AttributeError:
return self.value == other
Link
Link
Jan 3 – Jan 9, 20224 years ago
Featured this weekLink
Link
Dec 27 – Jan 2, 20224 years ago
Featured this weekLink
Link
Link
Dec 20 – Dec 26, 20214 years ago
Featured this weekWriting
Smoother Python with automatic imports | pyflyby
Link
Link
Dec 13 – Dec 19, 20214 years ago
Featured this weekLink
Dec 6 – Dec 12, 20214 years ago
Featured this weekWriting
You must use augroup with autocmd in vim | Here’s how
Link
Nov 29 – Dec 5, 20214 years ago
Featured this weekWriting
Code Review from the comfort of vim | Diffurcate
Writing
Setup a yaml schema | yamlls for a silky smooth setup
Writing
Open files FAST from zsh | or bash if thats your thing
Writing
How linux users install a text editor
Writing
30 days dotfile ricing
Link
Link
Link
Link
Nov 15 – Nov 21, 20214 years ago
Featured this weekWriting
JUT | Read Notebooks in the Terminal
Writing
Waylon Walker
Writing
kedro catalog create
Link
Nov 8 – Nov 14, 20214 years ago
Featured this weekLink
Nov 1 – Nov 7, 20214 years ago
Featured this weekLink
Link
Oct 25 – Oct 31, 20215 years ago
Featured this weekWriting
nvim conf 2021 | IDE’s are slow | Waylon Walker
Link
Link
Link
Link
Oct 18 – Oct 24, 20215 years ago
Featured this weekLink
Link
Link
Link
Oct 11 – Oct 17, 20215 years ago
Featured this weekLink
Link
Link
Link
Link
Link
Oct 4 – Oct 10, 20215 years ago
Featured this weekWriting
Just Ask Ipython for help
Writing
Hacktoberfest 2021?
Writing
I made a neovim plugin
Calendar data could not load. Try again.