19 items tagged “james-bennett”
2023
Several libraries let you declare objects with type-hinted members and automatically derive validation rules and serialization/deserialization from the type hints – Pydantic is the most popular, but alternatives like msgspec are out there too. There’s also a whole new generation of web frameworks like FastAPI and Starlite which use type hints at runtime to do not just input validation and serialization/deserialization but also things like dependency injection.
Personally, I’ve seen more significant gains in productivity from those runtime usages of Python’s type hints than from any static ahead-of-time type checking, which mostly is only useful to me as documentation.
2022
Boring Python: code quality. James Bennett provides an opinionated guide to setting up Python tools for linting, code formatting and and other code quality concerns. Of particular interest to me is his section on packaging checks, which introduces a whole bunch of new-to-me tools that can help avoid accidentally shipping broken packages to PyPI.
2020
James Bennett on why Django should not support JWT in core (via) The topic of adding JWT support to Django core comes up occasionally—here’s James Bennett’s detailed argument for not doing that. The short version is that the JWT specification isn’t just difficult to implement securely: it’s fundamentally flawed, which results in things like five implementations in three different languages all manifesting the same vulnerability. Third party modules exist that add JWT support to Django, but baking it into core would act as a form of endorsement and Django’s philosophy has always been to encourage people towards best practices.
2009
History of Django’s popularity. “What sequence of events made Django the most popular Python web framework?”—insightful answers from Alex Martelli and James Bennett.
Insofar as it encouraged workaday web professionals to recognize that there are such things as best practices independent of particular browser implementations, I think XHTML can be termed successful. Insofar as it got people thinking about the possibility of a better Web ahead of us, I think XHTML can be termed successful. Insofar as it changed the popular conception of professional web design and thrust standards into the forefront, I think XHTML can be termed successful.
2008
A Few Corrections To “On Packaging”. From Ian Bicking.
On packaging. James Bennett discusses the problems with setuptools (and ruby gems), and recommends Ian Bicking’s pip as a setuptools replacement.
James Bennett: Why HTML. Finally, somewhere to point people when they ask why I avoid XHTML that’s a bit more up to date than Hixie’s rant from 2002.
There are two [Wikipedias]: One is the public-facing reliable-enough-on-average encyclopedia that people read every day, which makes for nice fluff pieces in the media about "these new Web thingamajigs that the kids are building, aren't they neat?". The other is the insular behind-the-scenes bureaucracy, which reads like an improvised performance of the collected writings of Clay Shirky.
Minimal. James Bennett follows Ryan Tomayko’s example and experiments with the minimalist school of blog design.
James B. on Pownce (via) James Bennett has started using Pownce for sort of medium-format blog entries, longer than a tweet but shorter than a blog essay and delivered with a healthy dose of snark.
Legacy. James Bennett has what I think is the most interesting analysis of the X-UA-Compatible header to date.
2007
The future of web standards. Nice analysis from James Bennett, who suggests that successful open source projects (Linux, Python, Perl etc) could be used as the model for a more effective standards process, and points out that Ian Hickson is something of a BDFL for the WHAT-WG.
Updates to template_utils. James Bennett’s Django template_utils library now provides tags for consuming external RSS and Atom feeds. Combine with template fragment caching for an instant mashup written just using templates.
Newforms, part 1. James Bennett provides a detailed description of Django’s newforms (not so new now though, they’ve been around for over a year), complete with attractive diagrams.
Django documentation bookmarklets. James Bennett continues his month-long series of daily Django tutorials with documentation for one of Django’s best kept secrets: application introspection HTTP headers and bookmarklets that make use of them.
JavaScript Minifier that doesn’t break code (via) Perl re-implementation of Douglas Crockford’s classic JSMin that doesn’t clobber IE’s conditional comments, by Peter Michaux.
Django snippets. James Bennett’s new site for Django snippets. The source code to the whole site is available.
mimeparse.py (via) Parsing mime-types is harder than you might think.