How do I add my own custom attributes to existing built-in Python types? Like a string?
- by sfjedi
I want to do something like this...
def helloWorld():
print "Hello world!"
string.helloWorld = helloWorld
"foo".helloWorld()
Which would print out "Hello world!"