K
Kenneth McDonald
This is possible with pure Python classes. Just add the method as new
attribute of the class. However, that won't work for the builtins.
I know that this is somewhat dangerous, and also that I could subclass
the builtins, but not being able to do things like '[1,2,3]'.length
drives me a little nuts. Python is about the only computer language I
use, and I think it's certainly the best of the scripting languages, but
there are inconsistencies in the object model and some other things I
wish I could fix. If could could modify the builtins this way, I'd be
willing to take the risk.
Thanks,
Ken
attribute of the class. However, that won't work for the builtins.
I know that this is somewhat dangerous, and also that I could subclass
the builtins, but not being able to do things like '[1,2,3]'.length
drives me a little nuts. Python is about the only computer language I
use, and I think it's certainly the best of the scripting languages, but
there are inconsistencies in the object model and some other things I
wish I could fix. If could could modify the builtins this way, I'd be
willing to take the risk.
Thanks,
Ken