I really like Ruff these days for both simplicity and performance, looks like it has a rule for this https://
docs.astral.sh/ruff/rules/mut
able-argument-default/
…
@simonw
-
Ruff Python Linter: Simplicity and Performance Benefits
By
–
-
Python Default Argument Trap: Correct Implementation Patterns
By
–
Yeah, it's a nasty trap that one. I think there are linters that can spot it these days. The correct pattern looks like this: def my_function(a, b=None): b = b or [] … Or this if you want to support false-y values being passed for b: b = [] if b is None else b
-

OpenAI removes login requirement for GPT 3.5 in some markets
By
–
No login required to use https://t.co/9K5QiU4tjM with GPT 3.5 now (in some markets)
— Simon Willison (@simonw) 1 avril 2024
I wonder how their scraping prevention works? I imagine the temptation for people to abuse this as a free 3.5 API will be pretty strong https://t.co/OKiRaUxHc3No login required to use https://
chat.openai.com with GPT 3.5 now (in some markets) I wonder how their scraping prevention works? I imagine the temptation for people to abuse this as a free 3.5 API will be pretty strong -
Developer explains id-token feature implementation approach
By
–
I don't like complaining about something like this without offering a solution, so I've opened a new issue with my own attempt at explaining how id-token works based on my current mental model of the feature
-
Users Want AI Tools to Follow Instructions Reliably
By
–
Gotta admit I'd resent it I am a deeply curious person, but not "find an Etruscan scholar" curious for something like this I understand the limitations of these tools, and I'd be fine with the disclaimer, but I also like my computers to do the things I tell them to do!
-
Long AI prompts for OCR and document processing tools
By
–
Most of my recent prompts are a fair bit longer than those – I put a few of them in https://
simonwillison.net/2024/Mar/30/oc
r-pdfs-images/
… and a bunch more in the issues where I iterated on it: https://
github.com/simonw/tools/i
ssues?q=isissue+isclosed
… -
OCR Tool Adds Clipboard Paste Feature for Image Text Extraction
By
–
Great idea – I just added that. Hitting Ctrl+V on https://
tools.simonwillison.net/ocr when you have an image on your clipboard should work now Issue here: -
AWS Textract GPT-4 Vision Claude Gemini Comparison Guide
By
–
I suggest trying out AWS Textract and GPT-4 Vision and Claude 3 and Gemini Pro, they're all a bit of a pain to get up and running with though
-
Low-Cost Privacy-First Project Reaches Technical Limits
By
–
I'm pretty much done with it I think – I think this is about as far as I can push it without adding a server-side component, and the whole point of this project is to avoid that and be as low-cost and privacy-friendly as possible
-

Arabic Language Support for OCR Tool Testing
By
–
That seems to work for me when I select "Arabic" from the menu – though I don't know Arabic so I can't speak for the quality of the results! https://
tools.simonwillison.net/ocr?language=a
ra
…