[Learning] Should I define methods on values or pointers?

Stack Overflow: https://stackoverflow.com/questions/25382073/defining-golang-struct-function-using-pointer-or-not

Can someone explain to me why appending to an array works when you do this:

func (s *Sample) Append(name string) {
    d := &Stuff{
        name: name,
    }
    s.data = append(s.data, d)
}

But not when you do this:

func (s Sample) Append(name string) {
    d := &Stuff{
        name: name,
    }
    s.data = append(s.data, d)
}

Is there any reason at all why you would want to use the second example.

[Learning] Odoo super call dependency test

A test logs how Odoo process modules dependency with different install order

Test source code: https://github.com/NothingCtrl/odoo_super_dep_test

[Learning] The dangers of assert in Python (a.k.a know what you're doing!)

There are many ways to find bugs in Python code: the built-in debugger (pdb), a healthy amount of unit tests, a debugger in an IDE like Pycharm or Visual Studio, try/catch statements, if/else statements, assert statements, or the tried and true practice of covering every inch of your codebase in print() statements like it’s going out of style.

Assert statements can help us catch bugs quickly and are far less intrusive than copious amounts of print statements. However, unlike print statements, assert statements can be unexpectedly risky to use!

This article explores how to use asserts safely and what causes them to be unsafe. By the end of this article, you’ll know how to use assert most optimally without inadvertently opening yourself up to security issues.

[Learn] Hello World - the weirdest way!

Lòng vòng trên internet và lượm được, viết chương trình in ra "Hello world!" the weirdest way!

python hello_world.py
Hello World!