And if improving your #Python skills is part of your plan for the new year, check out my starter pack of Python teachers, authors, and speakers.
go.bsky.app/M5WjB4s
And if improving your #Python skills is part of your plan for the new year, check out my starter pack of Python teachers, authors, and speakers.
go.bsky.app/M5WjB4s
Trying to edit a NamedTuple or frozen dataclass in Python is much simpler now: there's a new `__replace__` method on them, and the right API to use it is:
>>> v
Vector(x=1, y=2)
>>> import copy
>>> copy.replace(v, x=3)
Vector(x=3, y=2)
Trying to edit a NamedTuple or frozen dataclass in Python is much simpler now: there's a new `__replace__` method on them, and the right API to use it is:
>>> v
Vector(x=1, y=2)
>>> import copy
>>> copy.replace(v, x=3)
Vector(x=3, y=2)
- If you're parsing a .ini file with comments, remember to set the `inline_comment_prefixes` param to ignore inline comments
- Use `config.getboolean()` to parse '1', 'true', 'yes' etc. to True
- If you're parsing a .ini file with comments, remember to set the `inline_comment_prefixes` param to ignore inline comments
- Use `config.getboolean()` to parse '1', 'true', 'yes' etc. to True
docs.python.org/3/library/fu...
Converts a comparison function into a key function - useful for an Advent of Code problem this year!
docs.python.org/3/library/fu...
Converts a comparison function into a key function - useful for an Advent of Code problem this year!
pip install git+github.com/<user>/<monorepo>#subdirectory=my/nested/package
pip install git+github.com/<user>/<monorepo>#subdirectory=my/nested/package
I continue to believe pytest has a feature for every conceivable use case.
It turns out there's a way to pass implicit fixtures using the `pytest.mark.usefixtures` decorator. TIL:
rednafi.com/python/injec...
I continue to believe pytest has a feature for every conceivable use case.
- you can host your data
- it's just json
- it's typed but any app dev can invent those types
- records have URIs
- records are signed so cacheable without trust
- relay aggregates everyone’s events into a global stream
- backends subscribe to relay and update local DBs
- you can host your data
- it's just json
- it's typed but any app dev can invent those types
- records have URIs
- records are signed so cacheable without trust
- relay aggregates everyone’s events into a global stream
- backends subscribe to relay and update local DBs
And here's how it looks like on PyPI (see Meta section): test.pypi.org/project/attr...
And here's how it looks like on PyPI (see Meta section): test.pypi.org/project/attr...
github.com/lebrice/Simp...
github.com/lebrice/Simp...
snarky.ca/what-the-psf...
snarky.ca/what-the-psf...
I work on #Python stuff at Microsoft.
I wrote a book once about the Python compiler, blog sometimes and appear at the odd tech conference.
I work on #Python stuff at Microsoft.
I wrote a book once about the Python compiler, blog sometimes and appear at the odd tech conference.
I was annoyed literally every time I had to do it.
astral.sh/blog/ruff-v0...
I was annoyed literally every time I had to do it.
astral.sh/blog/ruff-v0...
"...your users will know what’s going on. But they won’t be happy about it and it may bring some negative vibes to your tropical vacation, financed by the millions you’ve made from maintaining a FOSS project."
hynek.me/articles/sem...
"...your users will know what’s going on. But they won’t be happy about it and it may bring some negative vibes to your tropical vacation, financed by the millions you’ve made from maintaining a FOSS project."
hynek.me/articles/sem...
discuss.python.org/t/help-power...
discuss.python.org/t/help-power...
(For non-python files within your package, package-data is enough)
setuptools.pypa.io/en/latest/us...
(For non-python files within your package, package-data is enough)
setuptools.pypa.io/en/latest/us...