Python and micropayments
13th March 2003
Fredrik Lundh has started posting his book The Standard Python Library online, in response to O’Reilly’s decision not to publish a second edition of the book. I’d never read it before, but having sampled the first two chapters I’m hooked. It works a bit like a “cookbook”, with a plethora of code samples explained in detail accompanied by tips and tricks relating to the language. The Lazy Import class, which loads a module only when an attribute of the module is called for the first time, is a classic example:
class LazyImport: def __init__(self, module_name): self.module_name = module_name self.module = None def __getattr__(self, name): if self.module is None: self.module = __import__(self.module_name) return getattr(self.module, name) string = LazyImport("string") print string.lowercase
Frederick plans to release a chapter every Friday until the whole book has been posted. Alernatively, you can buy the whole 1999 edition from him as a PDF file for the princely sum of $5.00, which works out at £3.18 in GBP via PayPal.
I think that was my first ever micropayment.
More recent articles
- Gemini 2.0 Flash: An outstanding multi-modal LLM with a sci-fi streaming mode - 11th December 2024
- ChatGPT Canvas can make API requests now, but it's complicated - 10th December 2024
- I can now run a GPT-4 class model on my laptop - 9th December 2024