Add methods to string objects.
Negroup
negroup at gmail.com
Thu Jun 30 06:01:18 EDT 2005
Hi all.
I'm writing a simple Python module containing functions to process
strings in various ways. Actually it works importing the module that
contains the function I'm interested in, and calling
my_module.my_function('mystring').
I was just asking if it is possible to "extend" string objects'
behaviour so that it becomes possible to invoke something like
'anystring'.my_method().
1) does the latter approach bring some advantages?
2) how is it possible to achieve this goal?
Any pointer will be appreciated, thanks.
More information about the Python-list
mailing list