A sentence I never thought I'd read
"A pet albino skunk on a walk." A pet skunk, what? Legal in Ohio, per PBS! Amazing.
"A pet albino skunk on a walk." A pet skunk, what? Legal in Ohio, per PBS! Amazing.
Being only vaguely familiar with it, I was surprised to read today that test-driven development (TDD) doesn't mean you test every function. Testing Without Mocks describes "test-driving" code in a similar way. The examples proceed with writing a test for a simplified version of a behavior
A script with too many functions can be just as dreadful as one with too few. Few functions should be five hundred lines long. Usually it will be clearer if split up. Split up code too much and it becomes hard to change or reason about. That's especially
I am using Pandas for a script. It loads some data, does processing on that data, then saves them back out. At the start I log the size of the data in memory since it could be somewhat large (gigabytes). To calculate that I use something like df.memory_usage(
I think of a thunk as something you can evaluate, where the evaluated value may or may not be cached. Do we have those in Python? Duh, of course. It's just a function that takes no arguments. If you want/need you can wrap it in @cache or