Trey Hunner
banner
trey.io
Trey Hunner
@trey.io
Python & Django team trainer

I help folks sharpen their Python skills with https://PythonMorsels.com 🐍🍪

YIMBY. 95% vegan.
It's that time of year when I listen to that really beautiful Tim Minchin song. 💜
White Wine In The Sun by Tim Minchin
YouTube video by Tim Minchin
youtu.be
December 24, 2025 at 9:06 PM
In case you're curious what app I use for [insert thing here], here's my default apps of 2025.

treyhunner.com/2025/12/defa...
Default Apps of 2025
Here are my default apps of 2025. My 2024 list is here. The Libro, YNAB, SavvyCal, and GLM links below are referral links. You can find more of my …
treyhunner.com
December 23, 2025 at 7:04 PM
I just published a new article on how whitespace is your friend. 🫶

Well-placed spaces and newlines can really improve the readability of your #Python code.
Embrace whitespace
Well placed spaces and line breaks can greatly improve the readability of your Python code.
pym.dev
December 16, 2025 at 11:59 PM
Reposted by Trey Hunner
Worked on this a bunch today to make it substantially faster and published it to Pypi, so you can now try it yourself much easier:

```
uvx llmwalk -p "What is 2+2?"
```

github.com/samwho/llmwalk
December 14, 2025 at 4:32 PM
"Christmas Tree Farm" - Day 12 - Advent of Code 2025 #AdventOfCode

It's the last day. This one looks like it will require a lot of effort and I'm skeptical that I will enjoy myself or learn anything useful (to me) from it.

I think I'm giving up. 11 days was good enough. 🤷
Day 12 - Advent of Code 2025
adventofcode.com
December 12, 2025 at 6:54 PM
I just completed "Reactor" - Day 11 - Advent of Code 2025 #AdventOfCode #Python

Both parts ended up being easier than I initially expected... though I spent quite a while chasing my tail on part 2 before realizing I was overcomplicating things.

mastodon.social/@treyhunner/...
Trey Hunner 🐍 (@treyhunner@mastodon.social)
Content warning: Advent of Code - Day 11
mastodon.social
December 12, 2025 at 5:57 AM
To check for a prefix or suffix, use the string startswith or endswith methods. Read more ‘‰ https://trey.io/dley4p #Python
December 11, 2025 at 8:42 PM
I've completed "Factory" - Day 10 - Advent of Code 2025 #AdventOfCode #Python

I almost gave up on part 2 but ended up learning something new instead.

It's something I may never need except on silly coding puzzles, but it was a bit interesting.

mastodon.social/@treyhunner/...
Trey Hunner 🐍 (@treyhunner@mastodon.social)
Content warning: Advent of Code - Day 10
mastodon.social
December 11, 2025 at 4:42 PM
Decorators are the most common use case for nested functions in Python. Read more ‘‰ https://trey.io/4u4pj0 #Python
December 11, 2025 at 12:39 AM
40 years ago (Dec 10, 1985) Carl Sagan testified before the US Congress on climate change.
Carl Sagan testifying before Congress in 1985 on climate change
Original source: https://www.c-span.org/video/?125856-1/greenhouse-effect DECEMBER 10, 1985 “Witnesses testified on how the greenhouse effect will change the global climate system and possible…
www.youtube.com
December 10, 2025 at 2:00 AM
I just completed "Movie Theater" - Day 9 - Advent of Code 2025 #AdventOfCode #Python

Didn't like this one at all.

mastodon.social/@treyhunner/...
Trey Hunner 🐍 (@treyhunner@mastodon.social)
Content warning: Advent of Code - Day 9
mastodon.social
December 9, 2025 at 6:55 PM
I just completed "Playground" - Day 8 - Advent of Code 2025 #AdventOfCode #Python

I found myself using an interesting number of Python features that I rarerly have an excuse to reach for.

mastodon.social/@treyhunner/...
Trey Hunner 🐍 (@treyhunner@mastodon.social)
I just completed "Playground" - Day 8 - Advent of Code 2025 #AdventOfCode #Python Longer and uglier code than yesterday's, but there was no performance concern with the (mostly) brute force approach ...
mastodon.social
December 8, 2025 at 6:19 AM
I just completed "Laboratories" - Day 7 - Advent of Code 2025 #AdventOfCode #Python

Don't use something like this as an interview question unless combinatorics is a big part of the job. 🤮

mastodon.social/@treyhunner/...
Trey Hunner 🐍 (@treyhunner@mastodon.social)
Content warning: Advent of Code - Day 7
mastodon.social
December 7, 2025 at 6:59 AM
I've completed "Trash Compactor" - Day 6 - Advent of Code 2025 #AdventOfCode #Python

mastodon.social/@treyhunner/...
Trey Hunner 🐍 (@treyhunner@mastodon.social)
Content warning: Advent of Code - Day 6
mastodon.social
December 6, 2025 at 6:26 AM
TIL 2 words that (I think?) describe me:

1. sentientist: like humanism without the human-only focus
2. ostrovegan: veganism that allows eating animals that likely can't experience pain

Putting a word to an idea has power: it eases communication, but also makes it easier to hold an idea in my head.
December 5, 2025 at 8:09 PM
Reposted by Trey Hunner
PyLadiesCon starts tomorrow! All sessions are online, a mix of pre-recorded talks and workshops. Registration is free:
pretix.eu/pyladiescon/...

Join my session at 10:50AM about "Red-teaming for LLM-powered apps" and check out the talks from the MSFT databases team on DocumentDB and PostgreSQL.
December 4, 2025 at 11:01 PM
I just completed "Cafeteria" - Day 5 - Advent of Code 2025 #AdventOfCode #Python

Explanation and a link to my solution: mastodon.social/@treyhunner/...
Trey Hunner 🐍 (@treyhunner@mastodon.social)
Content warning: Advent of Code - Day 5
mastodon.social
December 5, 2025 at 5:33 AM
Reposted by Trey Hunner
Did you know you can do

int(my_string, 0)

and Python will parse the string as if it's a literal? Super handy, and I only learned about it five minutes ago!
December 5, 2025 at 1:41 AM
Reposted by Trey Hunner
Hey all! Friendly reminder: the Diversify Tech newsletter is completely free

Every week, I share resources to help you grow your tech career. Join here: www.diversifytech.com/join

Here's what one of our longtime members had to say:
www.linkedin.com/feed/update/...
December 4, 2025 at 5:16 PM
I've completed "Printing Department" - Day 4 - Advent of Code 2025 #AdventOfCode #Python

I was afraid that my part 2 was inefficient at first. It turns out I just had a bug that caused an infinite loop.

More commentary: mastodon.social/@treyhunner/...
Day 4 - Advent of Code 2025
adventofcode.com
December 4, 2025 at 5:40 AM
Reposted by Trey Hunner
📢 We are thrilled to present one of the panels at #PyLadiesCon.🐍🎉

Don't miss this opportunity to learn from the best and connect with the #Python community.🐍

🗣️ Language: English

Register for PyLadiesCon now:👇
2025.conference.pyladies.com/en/

#PyLadies #PSF
December 3, 2025 at 7:15 PM
Apparently I'm pretty consistent with what I talk about on Bluesky. 😅 ... also I use that 😅 emoji a lot

My most-used words in 2025 were:

1. "python" (360×)
2. "code" (43×)
3. "function" (39×)
4. "pyconus" (36×)
5. "morsels" (35×)

See which words you used the most here: anisota.net/harvest
December 3, 2025 at 7:24 PM
I just completed "Lobby" - Day 3 - Advent of Code 2025 #AdventOfCode #Python

My commentary and code is (behind a spoiler) at: mastodon.social/@treyhunner/...
Day 3 - Advent of Code 2025
adventofcode.com
December 3, 2025 at 5:44 AM
During today's #GivingTuesday, I'd like to share my own thinking around giving.

In this thread, I'll ask you to consider:

1. Why might you want to give?
2. What can you give?
3. Where might you give to?
December 2, 2025 at 7:55 PM
New screencast on wrapping text in #Python

pym.dev/wrapping-text/
Wrapping text output in Python
Python's textwrap module includes utilities for wrapping text to a maximum line length.
pym.dev
December 2, 2025 at 5:41 PM