'Naming convention for methods whether they change an object or return changed object [closed]

As it is said in the headline, is there that kind of naming convention, especially in python?

For example there are functions in python sorted (function that returns changed object, but doesn't change object) and list or numpy.ndarray method sort (returns nothing, but changes the object).

But for reversed and list.reverse functions it's not quite the case, reversed returns iterator.

In my case I have Permutation class and I want to add inverse functions for these two cases. Should I name them inverted and inverse (last one will be out of class) or like get_inv and set_inv respectively, because these methods are just like getters and setters (which is also quite true for sorted and sort)?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source