Tôi đã xây cùng một thư viện concurrency trong Go và Python, hai ngôn ngữ với trải nghiệm hoàn toàn khác nhau.
Go (gliter) sử dụng goroutines và channels cho sự ổn định, rõ ràng. Python (pipevine) với async + multiprocessing mang lại tính linh hoạt nhưng khó đảm bảo tính bền vững.
Câu hỏi được đặt ra: chúng ta có thực sự muốn concurrency dễ sử dụng, hay một số ma sát cần thiết như một rào chắn an toàn?
#programming #concurrency #golang #python #softwareengineering #lậptrình #đồngthời #go #py
A little open heart code-surgery 🥳
1: Refactor, so final part of timeline refresh can be used as call-back
2: Create permanent background thread for Mastodon.py
loop = asyncio.new_event_loop()
threading.Thread(target=loop.run_forever).start()
3: Run in background:
asyncio.run_coroutine_threadsafe(self.do_async(…), loop)
4: Use self.app.call_from_thread() to safely update Textual data
5: Exit gracefully
loop.call_soon_threadsafe(loop.stop)
I recently needed a decorator to turn a regular @pytestdotorg fixture into one which only executes once when run with #pytest-xdist. It took me a while to figure it out, but here it is:
https://www.katzien.de/en/posts/2025-11-11-run-fixture-only-once-in-pytest-with-xdist/
Usage:
```py
class Something(pydantic.BaseModel):
...
@pytest.fixture(scope="session")
@xdist_run_only_once(return_type=Something)
def something() -> Iterator[Something]:
yield Something(...)
```
An Empirical Evaluation of Property-Based Testing in Python via @pushcx https://lobste.rs/s/5hjn9y #python #science #testing
https://dl.acm.org/doi/pdf/10.1145/3764068
Made loads of progress on my matte vinyl stickers for PyCon Ireland!
These are giant removable stickers, suitable for a laptop, notepad, or water bottle.
#PyConIe #Python #PyCon #PythonIe

I had never looked at #LSP but now I want to integrate it in my #neovim setup and I find out that there are a lot for each language… so here comes another question to #python devs: which LSP config do you use in those listed at https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md?
Hope you're all #conda champions too 🐍🫠 #python https://youtube.com/shorts/eCoTu6eigEg?si=WEV-dKWjx2RYVwpa
MicroPython: An Intro to Programming Hardware in Python via @realpython
#python #programming #microcontroller
https://realpython.com/micropython/
Got into the Antagonist¹ dashboard with a small #Python script. The main goal is to be able to do DNS changes in the #Antagonist dashboard so that I can update DNS entries from the command line.
How to get the minimum and maximum values of a sequence in #Python using built-in functions.
Note that both functions also have a handy default parameter you can set if the sequences are empty

Print a range of unicode characters with #Python #QR
#!/usr/bin/python3
import sys
a = int(sys.argv[1],16)
b = int(sys.argv[2],16)
for i in range(a,b + 1):
print(" ".join([str(hex(i))," ",chr(i)]))

**Tự động hóa AI "Nhà máy" Shorts bằng Python – Dự án SideProject!**
Mệt mỏi với việc chỉnh sửa Shorts thủ công, tác giả đã lập trình một AI "Factory" bằng Python tự động hóa toàn bộ pipeline từ Reddit đến Shorts (PRAW → Gemini → Whisper → FFmpeg). Video 9 phút giới thiệu chi tiết và GitHub đã được đăng.
#AI #Python #Reddit #YouTubeShorts #SideProject #TựĐộngHóa #LậpTrình #DựÁnCáNhân