python

Back Open Paginator
27.02.2026 20:42
wojtek (@wojtek@social.vivaldi.net)

@grifdail someone is attacking #python 🫣🤭




Show Original Post


27.02.2026 20:10
treyhunner (@treyhunner@mastodon.social)

Python Tip #58 (of 365):

Aggregate with reducer functions.

You can combine generator expressions with reducer functions to lazily pre-process data before it's aggregated.

sum(), math‍.prod(), the string join() method, and any()/all() can all be thought of as reducer functions.

Reducer functions accept an iterable and reduce it down to a single object.

Generator expressions pair well with collection constructors (as in tip #57) AND with reducer functions.

🧵(1/2)




Show Original Post


27.02.2026 18:55
JGraber (@JGraber@mastodon.social)

Friday #320: Store Embeddings in ChromaDB -

pythonfriday.dev/2026/02/320-s




Show Original Post


27.02.2026 18:42
247CodeGirl (@247CodeGirl@mastodon.social)

Season 1 Lesson 5 Part 6 - Your First Steps - Split Without Arguments - in Python





Show Original Post


27.02.2026 18:38
mopicmp (@mopicmp@mastodon.social)

Python Tip: defaultdict Magic

from collections import defaultdict
groups = defaultdict(list)
for item in data:
groups[item.category].append(item)
# No KeyError, auto-creates lists

defaultdict creates missing keys automatically. No more 'if key not in dict' checks.

raccoonette.gumroad.com/l/Pyth




Show Original Post


27.02.2026 18:38
mopicmp (@mopicmp@mastodon.social)

Python Tip: match/case (Structural Pattern Matching)

match command.split():
case ['go', direction]:
move(direction)
case ['pick', 'up', item]:
grab(item)
case _:
print('Unknown command')

Python 3.10 match/case goes beyond switch statements. It destructures and binds variables.

raccoonette.gumroad.com/l/Pyth




Show Original Post


27.02.2026 18:30
pytexas (@pytexas@fosstodon.org)

Want to keep up with the latest #Python events and news in #Texas? Sign up for the #PyTexas newsletter today!

pytexas.org/newsletter





Show Original Post


27.02.2026 18:16
zopyx (@zopyx@mastodon.world)

#Python dataclasses are the weak alternative to #Pydantic...don't argue with an extra dependency




Show Original Post


27.02.2026 18:14
trevdev (@trevdev@fosstodon.org)

Six years ago I taught my first student Python programming for a non-profit alternative school. Fast forward today and that student is now a man, and he is teaching Python to kids who are on the spectrum at that same school. This is probably the proudest moment in my career.

#Python #programming #teaching




Show Original Post


27.02.2026 17:59
bmaxv (@bmaxv@noc.social)

Not my #gamedev work. But someone using the same (niche) engine!! #panda3 #python

Evolution algorithm breeds enemies!

youtu.be/tSrzMIWYKBc?si=YqKke_




Show Original Post


27.02.2026 17:55
sethmlarson (@sethmlarson@mastodon.social)

Deprecate confusing APIs like “os.path.commonprefix()”. After fixing a vulnerability in , I started digging into the confusing API and found more than I expected.

👉 sethmlarson.dev/deprecate-conf




Show Original Post


27.02.2026 17:30
JavaScriptBuzz (@JavaScriptBuzz@mastodon.social)

Closures vs Nested Functions: Scope Magic Comparison

JavaScript closures vs Python nested functions. Which language's scoping system creates more powerful patterns? Prepare to be amazed!

youtube.com/watch?v=ilodCyPjAQI




Show Original Post


1 ...412 413 414 415 416 417 418 419 420 421 422 ...1591
UP