Ben Chuanlong Du's Blog

It is never too late to learn.

Manage Your Python Project Using Poetry

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips and Traps

  1. Python Poetry is current the best project management tool for Python!

  2. Python Poetry supports Python package dependencies on GitHub. For example, if a Python package depends on https …

The Deref Trait in Rust

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. In short, do NOT implement the Deref trait unless you are absolutely sure that it's needed! According to Rust Official Doc - Deref, Deref should only be implemented for smart pointers. The …

Thread-Local Storage for Rayon

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

There might be issue if the code relies on Drop of the struct. For example, if you create a BufWriter in thread-local storage, last buffered output might not flush. You have …