Trey Hunner @trey.io · 08/08/2026Apparently Claude users get 3 free credits to try "/code-review ultra". I spend 2 of my 3 free credits on the same PR and got the same results both times. I feel like each of these results were a review of Anthropic's code than of my own. 🤔 2111
Trey Hunner @trey.io · 31/07/2026Python Tip #212 (of 365): Use any() and all() to check a condition across every item in an iterable 🧵 This: any_negative = False for n in numbers: if n < 0: any_negative = True break Can be rewritten as this: any_negative = any(n < 0 for n in numbers) #Python #DailyPythonTip 141
Trey Hunner @trey.io · 11/07/2026New daily game I've been enjoying hankgreen.com/smush · Jul 11 852 pts · PERFECT 💯 · 2-day streak 🥞🥞🥞 🥞⭐🥞 🥞🥞🥞 110
Trey Hunner @trey.io · 26/06/2026My closest match doesn't surprise me. I would have been very surprised if I was categorized as a "doomer". 010
Trey Hunner @trey.io · 03/05/2026I made it so that once I'm expected to remember the location of a country for over 3 weeks, Whereabouts.Earth will make a confetti explosion where the bits of confetti are made of the flags of the countries I now remember so well! 🎊🇦🇶 I've been having fun making features that bring me joy. 💖 180
Trey Hunner @trey.io · 25/04/2026But I would recommend using functools.cached_property instead. With @cached_property the value is computed once, then cached as a regular attribute. The first access does the work. Every access after that is instant. pym.dev/p/2mjp9/ 030
Trey Hunner @trey.io · 25/04/2026You might be tempted to manually cache a computed value... pym.dev/p/229fd/ 120
Trey Hunner @trey.io · 25/04/2026A @property recomputes its value every time it's accessed. That's fine for computing values that should stay synced each time the attribute is accessed. But if the computation is expensive, you might not want to redo it every time. pym.dev/p/24n3p/ 120
Trey Hunner @trey.io · 23/04/2026Announcing whereabouts.earth for the second time today, this time with a video for those who'd prefer to watch me use it than try it out. I've really been enjoying sharing this with folks today. Happy #EarthDay all! 🌍 0102
Trey Hunner @trey.io · 14/04/2026I love playing games in hotel lobbies during @pycon.us. It's hard to think of someone as an unapproachable stranger when you've spent 20 minutes playing a game in a small group with them. I plan to play games in The Westin lobby during #PyConUS at least a couple nights. See you at The Westin? 1102
Trey Hunner @trey.io · 22/03/2026A Magritte moment from @davepeck.org during the last talk of #PyCascades on t-strings 291
Trey Hunner @trey.io · 21/03/2026Some big ideas in @lukasz.langa.pl's keynote at #PyCascades this morning 1112
Trey Hunner @trey.io · 23/02/2026Python Tip #54 (of 365): Copy-paste your way into comprehensions. 🧵 Have a "for" loop that loops over one list to build up another? You can probably copy-paste your way from a loop into a comprehension. #Python #DailyPythonTip 110
Trey Hunner @trey.io · 12/02/2026When your UI makes a user think "eh there's a 75% chance that this is the right button", something has gone wrong. 040
Trey Hunner @trey.io · 03/12/2025Apparently 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 150
Trey Hunner @trey.io · 27/10/2025Increased diversity in communities usually comes from active outreach work. PyCon's has a partially blinded talk selection processes. If 300 people submit talks and 294 are men, then 98% of talks will likely be from men. If 500 people submit talks and 394 are men, then ~79% will likely be by men. 181
Trey Hunner @trey.io · 23/10/2025When you type code into the Python REPL, it will be colorized as you type it. Read more 👉 trey.io/flfwr9 #Python 021
Trey Hunner @trey.io · 14/10/2025So when writing a file using Python's csv module, you're expected to always specify newline="" when opening the file you're writing to, to make sure that you don't accidentally double up your carriage returns on Windows. Read more 👉 trey.io/ca0qyn #Python 000
Trey Hunner @trey.io · 14/08/2025In the 1960s, teleprinters used a carriage return (CR) to move the printhead back to the beginning of the line, and they used a line feed (LF) to move to the next line. Read more 👉 trey.io/ca0qyn #Python 131
Trey Hunner @trey.io · 04/07/2025This is such a weird email to get from the Social Security Administration... 🙁 010
Trey Hunner @trey.io · 02/07/2025But PEP8 (the official Python style guide) recommends putting binary operators (operators that go in between two values, like and and or) at the beginning of each line, for the sake of readability. Read more 👉 trey.io/f98u5c #Python 010
Trey Hunner @trey.io · 01/07/2025Working with file paths in Python? (splitting, joining, navigating, etc.) Check out #Python's pathlib module. It's great for splitting/joining paths, finding files by filename patterns, renaming files, and more. pym.dev/pathlib-module 170
Trey Hunner @trey.io · 18/05/2025Enjoyed this morning's #PyConUS keynote from @tfmfm.bsky.social & @geoffhing.bsky.social on a very important use for #Python. is.gd/tmppyconus 160
Trey Hunner @trey.io · 16/05/2025Hello #PyConUS attendee who I have probably never met! If you would like to say hello, please message me while we're both in the same city together! I'm on Signal at trey.02. More contact details at trey.io/pycon Also I have Python Morsels stickers! I'd love to give you one. 🐍🍪 042
Trey Hunner @trey.io · 16/05/2025When chatting in the hallway at PyCon, try leaving a gap for someone else to join the conversation. #PyConUS 032
Trey Hunner @trey.io · 16/05/2025We're playing Cabo and other games in the Westin lobby. Come join us #PyConUS folks! 020
Trey Hunner @trey.io · 15/05/2025Don't miss out on the rooftop track at #PyConUS this year! 🌳 There are a couple dozen of us out here eating lunch right now and I many folks will be hanging out here over the next few days of @pycon.us. The rooftop track is like the hallway track, but with a great view! 🖼️ 070
Trey Hunner @trey.io · 27/04/2025Hey #NBPy folks! 👋 I'm flying out tonight, so if you would like a Python Morsels sticker, hug, or a chat, find me today. I would love to say hey to you if we haven't met yet! If you would like a Python Morsels sticker today PLEASE ask me for one (or 10!). I brought so many! 🐍🍪😅 181
Trey Hunner @trey.io · 22/04/2025"There is perhaps no better demonstration of the folly of human conceits than this distant image of our tiny world. To me, it underscores our responsibility to deal more kindly with one another, and to preserve and cherish the pale blue dot, the only home we've ever known." -Carl Sagan #EarthDay 061
Trey Hunner @trey.io · 07/02/2025Well that was weird... DeepSeek R1 just thought for almost 8 minutes before starting to give me a response. 🤯 It used over 22,000 tokens just thinking about a response. 🤔 000
Trey Hunner @trey.io · 30/11/2024Each day, you'll watch a 4 minute video and then attempt to write Python code. ⌨ It's 2 hours of video, but about 20 hours of carefully crafted bite-sized exercises. 🍪 I just launched this course and it's 50% off, but only through Monday. 💸 pym.dev/courses/jumpstart/overview 000
Trey Hunner @trey.io · 20/11/2024Comprehensions have their own scope: >>> n = 4 >>> squares = [n**2 for n in range(9)] >>> n 4 But loops do NOT have their own scope: >>> n = 4 >>> for n in squares: ... >>> n 81 This looks like a #PythonOddity, but there's a good reason. #Python trey.io/function-sco... 2140
Trey Hunner @trey.io · 14/02/2024This photo was captured 33 rotations ago today, 6 million km from the sun. "There is perhaps no better demonstration of the folly of human conceits than this distant image of our tiny world." —Carl Sagan Sagan's full quote from the Cosmos series: youtu.be/GO5FwsblpT8?... Happy #PaleBlueDot Day 💜 020