[IronPython] Some thoughts on namespaces, extension methods

Curt Hagenlocher curt at hagenlocher.org
Thu Nov 13 08:40:48 CET 2008


On Thu, Nov 13, 2008 at 12:40 AM, Dan Eloff <dan.eloff at gmail.com> wrote:
>
> The first seems to me an extension of the ancient argument that you
> should not be trusted with fire because you might burn yourself. It's
> a fud appeal, not an argument.

Ever used Ruby? ;)

Although I was very skeptical at first, I've really grown to
appreciate the way that C# and VB implement extension methods. By
using an explicit opt-in to the ones you want, you avoid the hell of
everyone trying to add their favorite overlapping extensions to
"string".

Of course, you can generally modify non-C-based classes in the Python
standard library, but this seems to be much less interesting to the
average Python dev.  Or at least there's no Pythonic culture of insane
monkey-patching.

If it were someday possible to add methods to the Python string class,
I would hope that such a change would not be introduced without some
kind of scoping mechanism to limit visibility.

--
Curt Hagenlocher
curt at hagenlocher.org



More information about the Ironpython-users mailing list