"this is my string".myfunction(argument)
This is very simple in javascript. With the keyword this i can access to my string directly. Is that possible with python?
You can inherit from str and define your own methods:
class myString(str):
def my_method(self, ...):
# ...
some_string = myString("StackOverflow")
print some_string.count("a") # method from string
print some_string.myMethod(...) # your defined method
my_funcion(str1, str2) It will be "similar" to str1.my_function(str2)join() in the new function you will create. I don't see the point of "extending" it."my spliter".join_reverse(list) instead of join_reverse("my spliter", list) ?