3 ms·
module_function is different in that it makes the method both a class method (i.e. an instance method on the singleton class) and a private instance method (so
by cout 2y ago
module_function is different in that it makes the method both a class method (i.e. an instance method on the singleton class) and a private instance method (so you can call the method with implicit self). Once upon a time a used this a lot because it felt conceptually similar to a C++ static member function, but I rarely use it any more.