@
πΊοΈ November 15, 2026 5/5 countries in 6/13 guesses π’π’π’π‘π’ whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
πΊοΈ November 14, 2026 5/5 countries in 13/13 guesses π’π‘π‘π£π whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Python Tip #318 (of 365): Don't shadow built-in names like list, sum, and input. π§΅ Name a variable list and you can't call the list function from the same scope: >>> list = [1, 2, 3] >>> list(range(3)) TypeError: 'list' object is not callable #Python #DailyPythonTip
@
Python Tip #317 (of 365): For complex substitutions, pass a function to re.sub. π§΅ Python's re.sub performs a regular expression substitution, replacing matches with replacement text. It'll also take a FUNCTION, which accepts a match object and returns replacement text. #Python #DailyPythonTip
@
πΊοΈ November 13, 2026 5/5 countries in 6/13 guesses π’π’π’π‘π’ whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Python Tip #316 (of 365): Time code with time.perf_counter. π§΅ Do this: from time import perf_counter start = perf_counter() process(data) elapsed = perf_counter() - start Not this: from time import time start = time() process(data) elapsed = time() - start #Python #DailyPythonTip
@
πΊοΈ November 12, 2026 5/5 countries in 6/13 guesses π’π‘π’π’π’ whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Python Tip #315 (of 365): Don't reach for random.random. π§΅ Need a random integer? Don't multiply a random float and convert the result. The randint function does that more directly. Do this: random.randint(1, 6) Not this: int(random.random() * 6) + 1 #Python #DailyPythonTip https://pym.dev/random-numbers/
@
I gave a lightning talk at PyCon US 2025 that I've referenced a few times in conversations since then, so I decided to make a text version of it. https://treyhunner.com/2026/11/systems-gates-and-rage/
@
βIn Python, the syntax for calling a function is the same as the syntax for making a new class instance.β Read more π https://pym.dev/class-or-function/ #Python
@
πΊοΈ November 11, 2026 5/5 countries in 8/13 guesses π’π’π΅π’π’ whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Python Tip #314 (of 365): Split on multiple separators with re.split. π§΅ >>> import re >>> tags = "python;regex,strings" >>> re.split(r'[,;]', tags) ['python', 'regex', 'strings'] #Python #DailyPythonTip
@
βThe Car class isn't technically a subclass of Goose, but it's seen as a sort of virtual subclass.β Read more π pym.dev/goose-typing/ #Python https://pym.dev/goose-typing/
@
πΊοΈ November 10, 2026 5/5 countries in 7/13 guesses π’π’π‘π‘π’ whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Python Tip #313 (of 365): Don't use match-case as a switch statement. π§΅ Python's match statement is for STRUCTURAL PATTERN MATCHING. If you just need to check for specific values, an "if" statement is simpler. #Python #DailyPythonTip https://pym.dev/switch-case-in-python/
@
πΊοΈ November 9, 2026 5/5 countries in 6/13 guesses π’π’π’π‘π’ whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
βFor example, what if you wanted to launch another program from within Python, pass it inputs, and then capture its output?β Read more π https://pym.dev/running-subprocesses-in-python/ #Python
@
Python Tip #312 (of 365): Use the "utf-8-sig" encoding for CSV files. π§΅ Many CSV files start with an invisible byte order mark (BOM). When read as "utf-8", the first column name starts with a UTF-8 BOM character: >>> rows[0] {'\ufeffdate': '2026-10-01', 'kwh': '12.5'} #Python #DailyPythonTip
@
βPython 3.15 also has a big syntax addition: explicit lazy imports.β Read more π pym.dev/python315/ #Python https://pym.dev/python315/
@
πΊοΈ November 8, 2026 5/5 countries in 7/13 guesses π’π’π‘π‘π’ whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Python Tip #311 (of 365): Make directories with parents and exist_ok. π§΅ Like this: pathlib.Path("reports/2026").mkdir(parents=True, exist_ok=True) #Python #DailyPythonTip
@
πΊοΈ November 7, 2026 5/5 countries in 8/13 guesses π π‘π’π’π’ whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Python Tip #310 (of 365): Match objects by their type and attributes with match-case. π§΅ A class pattern checks an object's type (like isinstance does) and the values of its attributes, capturing attributes into variables. #Python #DailyPythonTip https://pym.dev/match-case-parsing-python/
@
I've been wanting a term for this! I think economists call this "negative-sum behavior", but I like @hankgreen.bsky.social's term better. Free riding, rent-seeking, & negative externalities CAN be negative-sum, but aren't always. Deadweight loss describes the vanished value, but NOT the behavior. https://youtu.be/8aynUCHKnlA?si=Q03vnoxf2RdI15Tm
@
Apparently the 15 years anniversary of the #EditorConfig project was 3 weeks ago. I made a vim plugin and convinced myself I could figure out how to make extensions for the other text editors. I'm glad I reached out to Hong Xu to ask if he was interested in teaming up. https://github.com/editorconfig/editorconfig-vim/commit/21af375dce0591f4d77db7ebcfa26eb1db2e9198
@
Today is a very borderful day Whereabouts Daily πΊοΈ November 6, 2026 5/5 countries in 7/13 guesses π’π’π‘π‘π’ whereabouts.earth/daily/ #Whereabouts https://whereabouts.earth/daily/
@
Python Tip #309 (of 365): Match dictionaries by their keys with match-case. π§΅ It's handy for JSON from an API: does a response have an error key, or a type key with a specific value? Without match, that's an if-elif chain of "in" checks, key lookups, and equality checks. #Python #DailyPythonTip
@
βPython code is meant to be read and understood by humans as well as the Python interpreter.β Read more π https://pym.dev/unnecessary-syntax/ #Python